-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lint #[inline(always)] closure in #[target_feature] functions #133408
base: master
Are you sure you want to change the base?
Lint #[inline(always)] closure in #[target_feature] functions #133408
Conversation
The job Click to see the possible cause of the failure (guessed by this bot)
|
I am in favor of this lint, but IMO it should get input from some other people as well, so let's r? compiler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact since this is a new lint, we'll need approval from @rust-lang/lang. @calebzulawski can you make the PR description a bit more self-contained so t-lang has the required context here?
&& !tcx.codegen_fn_attrs(owner_id).target_features.is_empty() | ||
{ | ||
if codegen_fn_attrs.inline == InlineAttr::Always { | ||
if let Some(inline_span) = inline_span { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if let Some(inline_span) = inline_span { | |
// Do *not* inherit target features here, that could be unsound. | |
if let Some(inline_span) = inline_span { |
&& !tcx.codegen_fn_attrs(owner_id).target_features.is_empty() | ||
{ | ||
if codegen_fn_attrs.inline == InlineAttr::Always { | ||
if let Some(inline_span) = inline_span { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if we don't have the span? Something is still wrong, so we should still emit a lint -- it can point at the closure instead of the attribute, maybe?
Make #108655 a future-incompatible lint as suggested in #69098 (comment)
r? @RalfJung