-
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
Do not provide suggestions when the spans come from expanded code that doesn't point at user code #109082
Conversation
clippy also needs some blessing |
compiler/rustc_middle/src/ty/mod.rs
Outdated
@@ -2487,6 +2487,12 @@ impl<'tcx> TyCtxt<'tcx> { | |||
.hygienic_eq(def_name.span.ctxt(), self.expn_that_defined(def_parent_def_id)) | |||
} | |||
|
|||
pub fn adjust_span(self, span: Span) -> 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.
When should one use adjust_span
? (needs some docs on this function)
All these call sites make me think that this is a bit fragile, if we forget it somewhere, a diagnostic will be subpar and it will be hard to find out where the problematic span is from. Can we do this in a more principled way? Like somewhere during ast lowering or even macro expansion?
tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr
Outdated
Show resolved
Hide resolved
@@ -88,6 +90,7 @@ fn e() { | |||
//~| NOTE cannot move out of here | |||
//~| NOTE move occurs because | |||
//~| HELP consider borrowing here | |||
//~| NOTE in this expansion of desugaring of a resized `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.
this note shows up in json but not in rendered diagnostics
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.
I don't think we'll ever want it to come up. I'll see if I can fully silence it.
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.
I had some trouble finding the right place to silence this. I thought emitter.rs
was the right place, but the place where this seemed to be coming from, wasn't.
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.
🤷 not really a problem
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
Yeah, went ahead and fixed the lint properly in its own commit :) |
in the name of the father, the son, and the holy @ghost, i bless thee |
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
This comment has been minimized.
This comment has been minimized.
05b32a6
to
4661971
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 019556d with merge a9ff946a44b0ea2531c5536d077f72f18806d291... |
☀️ Try build successful - checks-actions |
1 similar comment
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The Miri subtree was changed cc @rust-lang/miri |
☔ The latest upstream changes (presumably #109128) made this pull request unmergeable. Please resolve the merge conflicts. |
Hide invalid proc-macro suggestions and track spans
coming from proc-macros pointing at attribute.
Effectively, unless the proc-macro keeps user spans,
suggestions will not be produced for the code they
produce.
r? @ghost
Fix #107113, fix #107976, fix #107977, fix #108748, fix #106720, fix #90557.
Could potentially address #50141, #67373, #55146, #78862, #74043, #88514, #83320, #91520, #104071. CC #50122, #76360.