treat no_mangle_generic_items as hard error instead of lint warning#154585
treat no_mangle_generic_items as hard error instead of lint warning#154585HerrCai0907 wants to merge 2 commits into
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
|
| assert_contains(&backtrace, "foo", "line-tables-only-helper.rs", 6); | ||
| } | ||
| assert_contains(&backtrace, "bar", "line-tables-only-helper.rs", 10); | ||
| assert_contains(&backtrace, "baz", "line-tables-only-helper.rs", 5); | ||
| assert_contains(&backtrace, "bar", "line-tables-only-helper.rs", 11); | ||
| assert_contains(&backtrace, "baz", "line-tables-only-helper.rs", 6); |
There was a problem hiding this comment.
| assert_contains(&backtrace, "foo", "line-tables-only-helper.rs", 6); | |
| } | |
| assert_contains(&backtrace, "bar", "line-tables-only-helper.rs", 10); | |
| assert_contains(&backtrace, "baz", "line-tables-only-helper.rs", 5); | |
| assert_contains(&backtrace, "bar", "line-tables-only-helper.rs", 11); | |
| assert_contains(&backtrace, "baz", "line-tables-only-helper.rs", 6); | |
| assert_contains(&backtrace, "foo", "line-tables-only-helper.rs", 12); | |
| } | |
| assert_contains(&backtrace, "bar", "line-tables-only-helper.rs", 8); | |
| assert_contains(&backtrace, "baz", "line-tables-only-helper.rs", 4); |
That's based on the CI messages, I'd suggest running the tests locally though.
|
Makes sense to me. Thanks @HerrCai0907, @oli-obk, and @RalfJung. I propose we make this a hard error and accept this (minimal) observed breakage. @rfcbot fcp merge lang |
|
@traviscross has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! cc @rust-lang/lang-advisors: FCP proposed for lang, please feel free to register concerns. |
|
There is a waiting docs PR at rust-lang/reference#1904. Am I correct that the new rule should state the following? r[abi.no_mangle.generic]
It is an error to use `no_mangle` on an item with generic type or constant parameters. |
|
Yes that sounds right. (Though IMO the reference should list where the attribute is allowed, not where it is forbidden.) |
|
@rfcbot reviewed |
|
Agreed. Obviously can't work and easy to describe the error rule -- easier than giving it a meaning -- so 👍 @rfcbot reviewed |
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
|
@rfcbot reviewed |
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. |
|
@HerrCai0907 could you please rebase, and deal with the CI failures? |
View all comments
In rust-lang/miri#4929 (comment), rustc should reject the no_mangled generic function.
This PR treat is as a hard error