treat no_mangle_generic_items as hard error instead of lint warning - #154585
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
|
r? @oli-obk |
|
|
|
Please make it a hard error and not a lint at all if crater doesn't show any significant regressions. For crater purposes this works. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
set no_mangle_generic_items deny by default
This comment has been minimized.
This comment has been minimized.
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
This restriction is being added in rust-lang/rust#154585.
|
@bors r=oli-obk |
…items, r=oli-obk treat no_mangle_generic_items as hard error instead of lint warning In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function. This PR treat is as a hard error
…uwer Rollup of 25 pull requests Successful merges: - #154585 (treat no_mangle_generic_items as hard error instead of lint warning) - #158147 (std: fix stack buffer overflow in Windows junction_point) - #160130 (Select cache values to verify by key fingerprint, not value fingerprint) - #160343 (Rename `OutlivesPredicate` to `OutlivesClause`) - #160360 (Remove rustc_middle dependency on rustc_hir_pretty) - #160387 (rustc_codegen_ssa: Correctly apply the static `--jobs-backend` limit to backend parallelism) - #160422 (move mir-opt miri tests to CI logic) - #160444 (Avoid resolving path keywords outside `TypeNS`) - #160510 (Resolver: (un)tracked borrows for `CmRefCell` made safe my unsafe speculative flag) - #155424 ([blocked] Link to proposed LLM policy in CONTRIBUTING and pull request template) - #158726 (std: move futex implementations into sys::sync::futex) - #158762 (Emit thumb code on VEX V5) - #159225 (Split IncrCompSession out of Session) - #159820 (Make the `rustc_unsafe_specialization_marker` attribute actually `unsafe`) - #160198 (Rework `smallest_range_containing` to handle duplicates) - #160362 (Split `SpannedTypeVisitor` into its own crate, `rustc_ty_walk`) - #160390 (autodiff: Handle slice-tailed DSTs in type trees) - #160420 (Suggest `cast_signed()` for overflowing signed integer literals) - #160516 (Add regression test for HRTB projection in closure) - #160520 (Add some tests for specialization) - #160522 (fix(bootstrap): Normalize the names of proc macro dependency crates) - #160523 (Add regression test for opaque type) - #160531 (docs: fix typo in AllowExprMetavar comment) - #160538 (Update expect messages in tcp.rs doc examples to follow the style guide) - #160548 (bootstrap: Register `coverage-map` and `coverage-run` aliases via a separate step)
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #160557 (comment) |
|
This pull request was unapproved. |
ff04387 to
814f124
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
814f124 to
9c37be3
Compare
| // CHECK: ret | ||
|
|
||
| #[unsafe(naked)] | ||
| #[no_mangle] |
There was a problem hiding this comment.
@folkertdev @Amanieu I had to remove the no_mangle here as that does not work any more on generic functions. That means the CHECK-LABEL also does not work any more. I can make it work by hard-coding a bit of the mangling but that may be a bad idea? Any suggestions for what to do with this test?
There was a problem hiding this comment.
You need the name mangling to make it match in the right place, right?
It's probably fine this way. Maybe there is some combination of CHECK-LABEL and CHECK-SAME that works.
There was a problem hiding this comment.
yeah the code we are patching looks like this
40: module asm ".balign 4"
41: module asm ".globl _RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_"
42: module asm ".type _RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_, @function"
43: module asm "_RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_:"
44: module asm "call _RNvXCs3Y2WkPYsbfo_8genericsxNtB2_6Invert6invert"
45: module asm "ret"
46: module asm ".Lfunc_end__RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_:"
47: module asm ".size _RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_, . - _RINvCs3Y2WkPYsbfo_8generics16generic_functionxEB2_"
|
@bors r=oli-obk |
…uwer Rollup of 12 pull requests Successful merges: - #159014 ([rustdoc] Do not take `doc(cfg())` into account when filtering doctests) - #159029 (rustc_llvm: Emit module summaries when using -Clto=fat) - #160574 (Update rustc-perf submodule) - #154585 (treat no_mangle_generic_items as hard error instead of lint warning) - #159473 (Fix, simplify, and document doc meta finalize mode) - #157489 (Add CoerceShared field-wise reborrow WF checks) - #160532 (Add Enzyme bugfix to support rust+llvm23) - #160545 (Reorder the methods in `#[rustc_must_implement_one_of]`) - #160558 (Revert "codegen_ssa: no dbginfo for scalable vec local w/ `-O0`") - #160566 (Re-enable bool indexing assembly test for LLVM 23) - #160569 (Remove `OnDuplicate::Custom`) - #160576 ([rustdoc] Create output file after we checked that the standalone markdown file is valid)
Reference PR:
no_mangleto use the attribute template reference#1904View all comments
In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error