-
Notifications
You must be signed in to change notification settings - Fork 13.3k
A few cleanups and minor improvements to typeck #54591
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
Changes from all commits
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 |
---|---|---|
|
@@ -75,7 +75,7 @@ impl<'a, 'tcx> CheckVisitor<'a, 'tcx> { | |
let msg = if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(span) { | ||
format!("unused import: `{}`", snippet) | ||
} else { | ||
"unused import".to_string() | ||
"unused import".to_owned() | ||
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. I also prefer 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. I think The Book just recommends the solution that is simplest to grasp and remember; |
||
}; | ||
self.tcx.lint_node(lint::builtin::UNUSED_IMPORTS, id, span, &msg); | ||
} | ||
|
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.
Someday we should probably get
rustfmt
working on this codebase (which might require some special tooling; compare #53896). I unambiguously agree with most of the spacing changes in this PR, but where my personal æsthetics happen to disagree (here, I would treat the format varargs the same as the other arguments tostruct_span_err!
rather than aligning them to the format string), I tend to doubt that that degree of bikeshedding is part of my duty as a reviewer.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.
Yeah, I guess at one point whitespace tidying will become automated; just I adjust some spots as I go to what I feel looks more readable and hope I'm not the one who feels that way 😜.