Skip to content

Remove (now unused) #[rustc_macro_edition_2021] attribute #140067

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
Apr 20, 2025
Merged
Show file tree
Hide file tree
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
1 change: 0 additions & 1 deletion compiler/rustc_attr_data_structures/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ pub enum AttributeKind {
},
MacroTransparency(Transparency),
Repr(ThinVec<(ReprAttr, Span)>),
RustcMacroEdition2021,
Stability {
stability: Stability,
/// Span of the `#[stable(...)]` or `#[unstable(...)]` attribute
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_attr_parsing/src/attributes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub(crate) mod cfg;
pub(crate) mod confusables;
pub(crate) mod deprecation;
pub(crate) mod repr;
pub(crate) mod rustc;
pub(crate) mod stability;
pub(crate) mod transparency;
pub(crate) mod util;
Expand Down
19 changes: 0 additions & 19 deletions compiler/rustc_attr_parsing/src/attributes/rustc.rs

This file was deleted.

2 changes: 0 additions & 2 deletions compiler/rustc_attr_parsing/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInterna
use crate::attributes::confusables::ConfusablesParser;
use crate::attributes::deprecation::DeprecationParser;
use crate::attributes::repr::ReprParser;
use crate::attributes::rustc::RustcMacroEdition2021Parser;
use crate::attributes::stability::{
BodyStabilityParser, ConstStabilityIndirectParser, ConstStabilityParser, StabilityParser,
};
Expand Down Expand Up @@ -77,7 +76,6 @@ attribute_groups!(
// tidy-alphabetical-start
Single<ConstStabilityIndirectParser>,
Single<DeprecationParser>,
Single<RustcMacroEdition2021Parser>,
Single<TransparencyParser>,
// tidy-alphabetical-end
];
Expand Down
8 changes: 0 additions & 8 deletions compiler/rustc_feature/src/builtin_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,14 +676,6 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
"`rustc_never_type_options` is used to experiment with never type fallback and work on \
never type stabilization, and will never be stable"
),
rustc_attr!(
rustc_macro_edition_2021,
Normal,
template!(Word),
ErrorFollowing,
EncodeCrossCrate::No,
"makes spans in this macro edition 2021"
),

// ==========================================================================
// Internal attributes: Runtime related:
Expand Down
9 changes: 1 addition & 8 deletions compiler/rustc_resolve/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::sync::Arc;
use rustc_ast::expand::StrippedCfgItem;
use rustc_ast::{self as ast, Crate, NodeId, attr};
use rustc_ast_pretty::pprust;
use rustc_attr_parsing::{AttributeKind, StabilityLevel, find_attr};
use rustc_attr_parsing::StabilityLevel;
use rustc_data_structures::intern::Interned;
use rustc_errors::{Applicability, DiagCtxtHandle, StashKey};
use rustc_expand::base::{
Expand Down Expand Up @@ -1128,13 +1128,6 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
edition,
);

// The #[rustc_macro_edition_2021] attribute is used by the pin!() macro
// as a temporary workaround for a regression in expressiveness in Rust 2024.
// See https://github.com/rust-lang/rust/issues/138718.
if find_attr!(attrs.iter(), AttributeKind::RustcMacroEdition2021) {
ext.edition = Edition::Edition2021;
}

if let Some(builtin_name) = ext.builtin_name {
// The macro was marked with `#[rustc_builtin_macro]`.
if let Some(builtin_ext_kind) = self.builtin_macros.get(&builtin_name) {
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,6 @@ symbols! {
rustc_lint_opt_ty,
rustc_lint_query_instability,
rustc_lint_untracked_query_information,
rustc_macro_edition_2021,
rustc_macro_transparency,
rustc_main,
rustc_mir,
Expand Down
Loading