Skip to content

Commit 4dd8941

Browse files
committed
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 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.
1 parent 884dcee commit 4dd8941

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/intrinsics/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use rustc_middle::ty::GenericArgsRef;
2323
use rustc_middle::ty::layout::ValidityRequirement;
2424
use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths};
2525
use rustc_span::source_map::Spanned;
26-
use rustc_span::symbol::{Symbol, sym};
26+
use rustc_span::{Symbol, sym};
2727

2828
pub(crate) use self::llvm::codegen_llvm_intrinsic_call;
2929
use crate::cast::clif_intcast;

src/main_shim.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
22
use rustc_hir::LangItem;
33
use rustc_middle::ty::{AssocKind, GenericArg};
44
use rustc_session::config::{EntryFnType, sigpipe};
5-
use rustc_span::DUMMY_SP;
6-
use rustc_span::symbol::Ident;
5+
use rustc_span::{DUMMY_SP, Ident};
76

87
use crate::prelude::*;
98

0 commit comments

Comments
 (0)