Skip to content

Rename FileName::QuoteExpansion to CfgSpec #135747

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

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
@@ -888,7 +888,7 @@ impl Input {
Input::File(file) => Some(file),
Input::Str { name, .. } => match name {
FileName::Real(real) => real.local_path(),
FileName::QuoteExpansion(_) => None,
FileName::CfgSpec(_) => None,
FileName::Anon(_) => None,
FileName::MacroExpansion(_) => None,
FileName::ProcMacroSourceCode(_) => None,
10 changes: 5 additions & 5 deletions compiler/rustc_span/src/lib.rs
Original file line number Diff line number Diff line change
@@ -305,8 +305,8 @@ impl RealFileName {
#[derive(Debug, Eq, PartialEq, Clone, Ord, PartialOrd, Hash, Decodable, Encodable)]
pub enum FileName {
Real(RealFileName),
/// Call to `quote!`.
QuoteExpansion(Hash64),
/// Strings provided as `--cfg [cfgspec]`.
CfgSpec(Hash64),
/// Command line.
Anon(Hash64),
/// Hack in `src/librustc_ast/parse.rs`.
@@ -353,7 +353,7 @@ impl fmt::Display for FileNameDisplay<'_> {
Real(ref name) => {
write!(fmt, "{}", name.to_string_lossy(self.display_pref))
}
QuoteExpansion(_) => write!(fmt, "<quote expansion>"),
CfgSpec(_) => write!(fmt, "<cfgspec>"),
MacroExpansion(_) => write!(fmt, "<macro expansion>"),
Anon(_) => write!(fmt, "<anon>"),
ProcMacroSourceCode(_) => write!(fmt, "<proc-macro source code>"),
@@ -384,7 +384,7 @@ impl FileName {
| ProcMacroSourceCode(_)
| CliCrateAttr(_)
| Custom(_)
| QuoteExpansion(_)
| CfgSpec(_)
| DocTest(_, _)
| InlineAsm(_) => false,
}
@@ -425,7 +425,7 @@ impl FileName {
pub fn cfg_spec_source_code(src: &str) -> FileName {
let mut hasher = StableHasher::new();
src.hash(&mut hasher);
FileName::QuoteExpansion(hasher.finish())
FileName::CfgSpec(hasher.finish())
}

pub fn cli_crate_attr_source_code(src: &str) -> FileName {
Loading