about summary refs log tree commit diff
path: root/compiler/rustc_attr_parsing/src
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-12-13 10:29:23 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-12-18 13:38:53 +1100
commit2620eb42d72d24baa1ca1056a769862b92c85f7f (patch)
tree0639c0002549077bd8521e0517e3b53580bbb71d /compiler/rustc_attr_parsing/src
parent7e6bf003f396aeea510577b4e925d1d95c12ff53 (diff)
downloadrust-2620eb42d72d24baa1ca1056a769862b92c85f7f.tar.gz
rust-2620eb42d72d24baa1ca1056a769862b92c85f7f.zip
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.
Diffstat (limited to 'compiler/rustc_attr_parsing/src')
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs2
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/cfg.rs3
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/confusables.rs2
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/deprecation.rs3
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/repr.rs2
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/stability.rs3
-rw-r--r--compiler/rustc_attr_parsing/src/attributes/util.rs2
7 files changed, 7 insertions, 10 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs
index b9f841800ab..471168ed4f5 100644
--- a/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/allow_unstable.rs
@@ -1,6 +1,6 @@
 use rustc_ast::attr::{AttributeExt, filter_by_name};
 use rustc_session::Session;
-use rustc_span::symbol::{Symbol, sym};
+use rustc_span::{Symbol, sym};
 
 use crate::session_diagnostics;
 
diff --git a/compiler/rustc_attr_parsing/src/attributes/cfg.rs b/compiler/rustc_attr_parsing/src/attributes/cfg.rs
index 8cf8e86100f..bb9aaaa2fea 100644
--- a/compiler/rustc_attr_parsing/src/attributes/cfg.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/cfg.rs
@@ -9,8 +9,7 @@ use rustc_session::config::ExpectedValues;
 use rustc_session::lint::BuiltinLintDiag;
 use rustc_session::lint::builtin::UNEXPECTED_CFGS;
 use rustc_session::parse::feature_err;
-use rustc_span::Span;
-use rustc_span::symbol::{Symbol, kw, sym};
+use rustc_span::{Span, Symbol, kw, sym};
 
 use crate::util::UnsupportedLiteralReason;
 use crate::{fluent_generated, parse_version, session_diagnostics};
diff --git a/compiler/rustc_attr_parsing/src/attributes/confusables.rs b/compiler/rustc_attr_parsing/src/attributes/confusables.rs
index 672fcf05eda..2ced759fd88 100644
--- a/compiler/rustc_attr_parsing/src/attributes/confusables.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/confusables.rs
@@ -2,7 +2,7 @@
 
 use rustc_ast::MetaItemInner;
 use rustc_ast::attr::AttributeExt;
-use rustc_span::symbol::Symbol;
+use rustc_span::Symbol;
 
 /// Read the content of a `rustc_confusables` attribute, and return the list of candidate names.
 pub fn parse_confusables(attr: &impl AttributeExt) -> Option<Vec<Symbol>> {
diff --git a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs
index 2f9872cc311..d7415a7198f 100644
--- a/compiler/rustc_attr_parsing/src/attributes/deprecation.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/deprecation.rs
@@ -6,8 +6,7 @@ use rustc_ast_pretty::pprust;
 use rustc_attr_data_structures::{DeprecatedSince, Deprecation};
 use rustc_feature::Features;
 use rustc_session::Session;
-use rustc_span::Span;
-use rustc_span::symbol::{Symbol, sym};
+use rustc_span::{Span, Symbol, sym};
 
 use super::util::UnsupportedLiteralReason;
 use crate::{parse_version, session_diagnostics};
diff --git a/compiler/rustc_attr_parsing/src/attributes/repr.rs b/compiler/rustc_attr_parsing/src/attributes/repr.rs
index 008edfe6366..124f0aa3eff 100644
--- a/compiler/rustc_attr_parsing/src/attributes/repr.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/repr.rs
@@ -6,7 +6,7 @@ use rustc_ast::{self as ast, MetaItemKind};
 use rustc_attr_data_structures::IntType;
 use rustc_attr_data_structures::ReprAttr::*;
 use rustc_session::Session;
-use rustc_span::symbol::{Symbol, sym};
+use rustc_span::{Symbol, sym};
 
 use crate::ReprAttr;
 use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause};
diff --git a/compiler/rustc_attr_parsing/src/attributes/stability.rs b/compiler/rustc_attr_parsing/src/attributes/stability.rs
index 0d5bd105f05..89937e1c593 100644
--- a/compiler/rustc_attr_parsing/src/attributes/stability.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/stability.rs
@@ -11,8 +11,7 @@ use rustc_attr_data_structures::{
 };
 use rustc_errors::ErrorGuaranteed;
 use rustc_session::Session;
-use rustc_span::Span;
-use rustc_span::symbol::{Symbol, sym};
+use rustc_span::{Span, Symbol, sym};
 
 use crate::attributes::util::UnsupportedLiteralReason;
 use crate::{parse_version, session_diagnostics};
diff --git a/compiler/rustc_attr_parsing/src/attributes/util.rs b/compiler/rustc_attr_parsing/src/attributes/util.rs
index c59d2fec1dc..e36f7dfff5a 100644
--- a/compiler/rustc_attr_parsing/src/attributes/util.rs
+++ b/compiler/rustc_attr_parsing/src/attributes/util.rs
@@ -1,7 +1,7 @@
 use rustc_ast::attr::{AttributeExt, first_attr_value_str_by_name};
 use rustc_attr_data_structures::RustcVersion;
 use rustc_feature::is_builtin_attr_name;
-use rustc_span::symbol::{Symbol, sym};
+use rustc_span::{Symbol, sym};
 
 pub(crate) enum UnsupportedLiteralReason {
     Generic,