diff options
| author | bors <bors@rust-lang.org> | 2024-12-18 02:56:38 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-18 02:56:38 +0000 |
| commit | a89ca2c85e61d03c6e41be89508ed3d012f916f8 (patch) | |
| tree | 5101d43e44eb7dae8f58f17ced5b92a9584beb04 /compiler/rustc_infer/src | |
| parent | 52890e82153cd8716d97a96f47fb6ac99dec65be (diff) | |
| parent | 2620eb42d72d24baa1ca1056a769862b92c85f7f (diff) | |
| download | rust-a89ca2c85e61d03c6e41be89508ed3d012f916f8.tar.gz rust-a89ca2c85e61d03c6e41be89508ed3d012f916f8.zip | |
Auto merge of #134243 - nnethercote:re-export-more-rustc_span, r=jieyouxu
Re-export more `rustc_span::symbol` things from `rustc_span`.
`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 to `rustc_span::`. This is a 300+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
r? `@jieyouxu`
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/mod.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_infer/src/traits/util.rs | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs index f3fa3d3a1c8..5086b741a83 100644 --- a/compiler/rustc_infer/src/infer/mod.rs +++ b/compiler/rustc_infer/src/infer/mod.rs @@ -41,8 +41,7 @@ use rustc_middle::ty::{ GenericParamDefKind, InferConst, IntVid, PseudoCanonicalInput, Ty, TyCtxt, TyVid, TypeVisitable, TypingEnv, TypingMode, }; -use rustc_span::Span; -use rustc_span::symbol::Symbol; +use rustc_span::{Span, Symbol}; use snapshot::undo_log::InferCtxtUndoLogs; use tracing::{debug, instrument}; use type_variable::TypeVariableOrigin; diff --git a/compiler/rustc_infer/src/traits/util.rs b/compiler/rustc_infer/src/traits/util.rs index a977bd15d3b..ab8ada1596c 100644 --- a/compiler/rustc_infer/src/traits/util.rs +++ b/compiler/rustc_infer/src/traits/util.rs @@ -1,7 +1,6 @@ use rustc_data_structures::fx::FxHashSet; use rustc_middle::ty::{self, ToPolyTraitRef, TyCtxt}; -use rustc_span::Span; -use rustc_span::symbol::Ident; +use rustc_span::{Ident, Span}; pub use rustc_type_ir::elaborate::*; use crate::traits::{self, Obligation, ObligationCauseCode, PredicateObligation}; |
