Uh oh!
There was an error while loading. Please reload this page.
Re-export more rustc_span::symbol things from rustc_span. - #134243
Conversation
rustbot
commented
Dec 13, 2024
Some changes occurred in cfg and check-cfg configuration cc @Urgau
cc @davidtwco, @compiler-errors, @TaKO8Ki Some changes occurred in need_type_info.rs cc @lcnr HIR ty lowering was modified cc @fmease Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt This PR changes MIR cc @oli-obk, @RalfJung, @JakobDegen, @davidtwco, @celinval, @vakaras Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval Some changes occurred in match lowering cc @Nadrieril Some changes occurred in check-cfg diagnostics cc @Urgau These commits modify compiler targets. Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri |
588869a to
5857bd7Compare| @@ -68,7 +68,7 @@ mod span_encoding; | |||
| pub use span_encoding::{DUMMY_SP, Span}; | |||
| pub mod symbol; | |||
| pub use symbol::{Symbol, sym}; | |||
| pub use symbol::{Ident, MacroRulesNormalizedIdent, Symbol, kw, sym}; | |||
There was a problem hiding this comment.
Sorry for the tedious review. This is the line of note. The rest is just shortening rustc_span::symbol:: qualifiers.
oli-obk
commented
Dec 13, 2024
I don't think I find this valuable. Reducing/merging imports is not very useful imo unless it allows removing of crate deps via reexports |
I do think it's valuable. I think it's silly that you can import |
I don't feel too strongly either way since the nesting doesn't seem very steep. Anyway, I'll look at this tmrw since there's several files to go through. |
ytmimi
commented
Dec 13, 2024
@nnethercote I'd like to opt out of these changes for rustfmt. |
bors
commented
Dec 13, 2024
☔ The latest upstream changes (presumably #133099) made this pull request unmergeable. Please resolve the merge conflicts. |
jieyouxu
left a comment
There was a problem hiding this comment.
Thanks for the PR. I looked at the changes individually:
- We should drop rustfmt changes as @ytmimi requested.
- We should ask T-rustdoc if they want to opt-in to the rustdoc import changes (or at least in this PR).
- We should ask T-clippy if they want to opt-in to the clippy import changes (or at least in this PR).
- Compiler changes seem reasonable to me. If we want to make the re-exports/imports of {
Ident,kw,sym} by downstream compiler crates and tool users more consistent, I guess better get it done earlier than later.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nnethercote
commented
Dec 16, 2024
The diff from this file sums up the motivation for this change: It's silly that |
a349719 to
4d6ed1dComparebors
commented
Dec 17, 2024
☔ The latest upstream changes (presumably #134414) made this pull request unmergeable. Please resolve the merge conflicts. |
jieyouxu
commented
Dec 17, 2024
@nnethercote if you don't want to wait for T-clippy/T-rustdoc, we could also split this PR into compiler-only changes vs tools changes, where the tool changes can be sent to the relevant teams. I can r+ the compiler changes specifically. |
4d6ed1d to
dd17220Compare`rustc_span::symbol` defines some things that are re-exported from
`rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some
closely related things such as `Ident` and `kw`. So you can do `use
rustc_span::{Symbol, sym}` but you have to do `use
rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good
reason.
This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`,
and changes many `rustc_span::symbol::` qualifiers in `compiler/` to
`rustc_span::`. This is a 200+ net line of code reduction, mostly
because many files with two `use rustc_span` items can be reduced to
one.dd17220 to
2620eb4Comparennethercote
commented
Dec 18, 2024
I've trimmed this down to just the compiler changes and rebased. It's conflict-prone, so: @bors r=jieyouxu p=1 |
bors
commented
Dec 18, 2024
rust-log-analyzer
commented
Dec 18, 2024
bors
commented
Dec 18, 2024
bors
commented
Dec 18, 2024
☀️ Test successful - checks-actions |
rust-timer
commented
Dec 18, 2024
Finished benchmarking commit (a89ca2c): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 2.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.
CyclesResults (secondary -4.9%)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: 768.784s -> 769.265s (0.06%) |
rustc_span::symboldefines some things that are re-exported fromrustc_span, such asSymbolandsym. But it doesn't re-export some closely related things such asIdentandkw. So you can douse rustc_span::{Symbol, sym}but you have to douse rustc_span::symbol::{Ident, kw}, which is inconsistent for no good reason.This commit re-exports
Ident,kw, andMacroRulesNormalizedIdent, and changes manyrustc_span::symbol::qualifiers torustc_span::. This is a 300+ net line of code reduction, mostly because many files with twouse rustc_spanitems can be reduced to one.r? @jieyouxu