-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc_resolve
cleanups
#125105
rustc_resolve
cleanups
#125105
Conversation
The `#[allow(rustdoc:private_intra_doc_links)]` isn't necessary. Also sort them, as is done in other files like `compiler/rustc_errors/src/lib.rs`.
Explicit imports are more standard nowadays and easier to read.
Some minor (English only) heroics are performed to print error messages like "5th rule of macro `m` is never used". The form "rule rust-lang#5 of macro `m` is never used" is just as good and much simpler to implement.
@@ -3026,14 +3024,3 @@ fn is_span_suitable_for_use_injection(s: Span) -> bool { | |||
// import or other generated ones | |||
!s.from_expansion() | |||
} | |||
|
|||
/// Convert the given number into the corresponding ordinal | |||
pub(crate) fn ordinalize(v: usize) -> String { |
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 conflicts with #125042, but I think that one can use just the number too
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 #125042, the function is copied, not referenced (put aside whether it is good or not).
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.
@bors r+
@@ -11,6 +11,7 @@ use rustc_middle::middle::privacy::Level; | |||
use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility}; | |||
use rustc_middle::ty::Visibility; | |||
use std::mem; | |||
use tracing::info; |
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.
Are all of these additions from tracing in different files needed?
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.
Yes. The #[macro_use] extern crate tracing;
gave us implicit import of all tracing
macros. With that gone, we must do explicit imports, and tracing
macros are used in lots of places.
@@ -10,13 +10,13 @@ note: the lint level is defined here | |||
LL | #![deny(unused_macro_rules)] | |||
| ^^^^^^^^^^^^^^^^^^ | |||
|
|||
error: 2nd rule of macro `num` is never used | |||
error: rule #2 of macro `num` is never used | |||
--> $DIR/unused-macro-rules.rs:8:5 | |||
| | |||
LL | (two) => { 2 }; | |||
| ^^^^^ |
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.
Future note: we should emit a single error for all of the unused rules in a single macro.
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (36c0a6d): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 1.6%, secondary 1.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.851s -> 669.26s (0.06%) |
Some improvements I found while looking through this code.
r? @estebank