-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tweak 'static
suggestion code
#71235
Changes from all commits
13c1dae
1f43fc0
322b204
ad379cd
59c816d
25f8966
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1017,18 +1017,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |
|
||
self.prohibit_generics(trait_ref.path.segments.split_last().unwrap().1); | ||
|
||
let path_span = if let [segment] = &trait_ref.path.segments[..] { | ||
// FIXME: `trait_ref.path.span` can point to a full path with multiple | ||
// segments, even though `trait_ref.path.segments` is of length `1`. Work | ||
// around that bug here, even though it should be fixed elsewhere. | ||
// This would otherwise cause an invalid suggestion. For an example, look at | ||
// `src/test/ui/issues/issue-28344.rs`. | ||
segment.ident.span | ||
} else { | ||
trait_ref.path.span | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity, was this fixed elsewhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Partly. I think this used to affect multiple tests but the only case that appears now is at https://github.com/rust-lang/rust/pull/71235/files#diff-1bd3f65ee2d72d0225a5db83a8391165. |
||
let (substs, assoc_bindings, arg_count_correct) = self.create_substs_for_ast_trait_ref( | ||
path_span, | ||
trait_ref.path.span, | ||
trait_def_id, | ||
self_ty, | ||
trait_ref.path.segments.last().unwrap(), | ||
|
@@ -1729,6 +1719,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |
self.ast_region_to_region(lifetime, None) | ||
} else { | ||
self.re_infer(None, span).unwrap_or_else(|| { | ||
// FIXME: these can be redundant with E0106, but not always. | ||
struct_span_err!( | ||
tcx.sess, | ||
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.
It seems that the semantics of the return value of
report_elision_failure
have changed. What does thebool
indicate here? Would you mind documenting it?