Skip to content

Rollup of 10 pull requests #143790

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

Closed
wants to merge 37 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2988b2c
tests: Fix duplicated-path-in-error fail with musl
Gelbpunkt Jun 10, 2025
b2299e2
fix: correct assertion to check for 'noinline' attribute presence bef…
dillona Jul 8, 2025
62f58db
Port `#[const_trait]` to the new attribute system
GrigorenkoPV Jun 23, 2025
938916d
Port `#[rustc_deny_explicit_impl]` to the new attribute system
GrigorenkoPV Jun 23, 2025
adb325f
Port `#[rustc_do_not_implement_via_object]` to the new attribute system
GrigorenkoPV Jun 23, 2025
6f8e92d
Port `#[rustc_coinductive]` to the new attribute system
GrigorenkoPV Jun 23, 2025
813ec60
Port `#[type_const]` to the new attribute system
GrigorenkoPV Jun 23, 2025
6193783
Port `#[rustc_specialization_trait]` to the new attribute system
GrigorenkoPV Jun 23, 2025
a57a885
Port `#[rustc_unsafe_specialization_marker]` to the new attribute system
GrigorenkoPV Jun 23, 2025
12f6487
Port `#[marker]` to the new attribute system
GrigorenkoPV Jun 23, 2025
507ebce
Port `#[fundamental]` to the new attribute system
GrigorenkoPV Jun 23, 2025
1bdf703
Port `#[rustc_paren_sugar]` to the new attribute system
GrigorenkoPV Jun 23, 2025
a6bc816
Reorder attribute parsers in `traits.rs`
GrigorenkoPV Jun 24, 2025
e9e6495
Port `#[rustc_allow_incoherent_impl]` to the new attribute system
GrigorenkoPV Jun 24, 2025
e584ed0
Port `#[rustc_coherence_is_core]` to the new attribute system
GrigorenkoPV Jun 24, 2025
04bb68a
compiler: recomment `needs_fn_once_adapter_shim`
workingjubilee Jul 10, 2025
a866377
Add target maintainer information for aarch64-unknown-linux-musl
Gelbpunkt Jul 10, 2025
ed96f00
fix typos in function names in the `target_feature` test
fluiderson Jul 10, 2025
3c11029
docs: clarify “dag” in std::sys_common doc comment
ColtenOuO Jul 8, 2025
2861274
x: clippy fixes
hkBst Jul 11, 2025
b87a1b1
x: move to edition 2024
hkBst Jul 11, 2025
dcf965d
x: use let-else
hkBst Jul 11, 2025
011d4aa
Call `get_switch_int_data` on a block with SwitchInt terminator
tmiasko Jul 11, 2025
ba3b7a7
build-helper: clippy fixes
hkBst Jul 11, 2025
39f7707
compiler: comment on some call-related codegen fn in cg_ssa
workingjubilee Jul 10, 2025
5b6d661
Remove support for SwitchInt edge effects in backward dataflow analyses
tmiasko Jul 11, 2025
3ffd47d
Add a comment explaining the split
Gelbpunkt Jul 11, 2025
933da97
Rollup merge of #142301 - Gelbpunkt:duplicated-path-in-error-musl, r=…
matthiaskrgr Jul 11, 2025
02df24f
Rollup merge of #143403 - GrigorenkoPV:attributes/traits, r=jdonszelmann
matthiaskrgr Jul 11, 2025
e932509
Rollup merge of #143633 - dillona:noinline-assert, r=fee1-dead
matthiaskrgr Jul 11, 2025
1412294
Rollup merge of #143647 - ColtenOuO:master, r=ChrisDenton
matthiaskrgr Jul 11, 2025
25b1232
Rollup merge of #143716 - workingjubilee:document-some-codegen-backen…
matthiaskrgr Jul 11, 2025
4d89e63
Rollup merge of #143747 - Gelbpunkt:aarch64-musl-maintainer, r=jieyouxu
matthiaskrgr Jul 11, 2025
0fb53e7
Rollup merge of #143759 - fluiderson:rdttff, r=aDotInTheVoid
matthiaskrgr Jul 11, 2025
88066c8
Rollup merge of #143767 - hkBst:cleanup-x, r=jieyouxu
matthiaskrgr Jul 11, 2025
1fbfc62
Rollup merge of #143769 - tmiasko:rm-backward-switch-int, r=lqd
matthiaskrgr Jul 11, 2025
2f82343
Rollup merge of #143770 - hkBst:build-helper-cleanup, r=Kobzol
matthiaskrgr Jul 11, 2025
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
Prev Previous commit
Next Next commit
Reorder attribute parsers in traits.rs
  • Loading branch information
GrigorenkoPV committed Jul 8, 2025
commit a6bc8160d64df15ddf08fd9bdcc13d2c5f1028e0
63 changes: 35 additions & 28 deletions compiler/rustc_attr_parsing/src/attributes/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use crate::context::{AcceptContext, Stage};
use crate::parser::ArgParser;

pub(crate) struct SkipDuringMethodDispatchParser;

impl<S: Stage> SingleAttributeParser<S> for SkipDuringMethodDispatchParser {
const PATH: &[Symbol] = &[sym::rustc_skip_during_method_dispatch];
const ATTRIBUTE_ORDER: AttributeOrder = AttributeOrder::KeepFirst;
Expand Down Expand Up @@ -55,11 +54,27 @@ impl<S: Stage> SingleAttributeParser<S> for SkipDuringMethodDispatchParser {
}
}

pub(crate) struct ConstTraitParser;
impl<S: Stage> NoArgsAttributeParser<S> for ConstTraitParser {
const PATH: &[Symbol] = &[sym::const_trait];
pub(crate) struct ParenSugarParser;
impl<S: Stage> NoArgsAttributeParser<S> for ParenSugarParser {
const PATH: &[Symbol] = &[sym::rustc_paren_sugar];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::ParenSugar;
}

pub(crate) struct TypeConstParser;
impl<S: Stage> NoArgsAttributeParser<S> for TypeConstParser {
const PATH: &[Symbol] = &[sym::type_const];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::TypeConst;
}

// Markers

pub(crate) struct MarkerParser;
impl<S: Stage> NoArgsAttributeParser<S> for MarkerParser {
const PATH: &[Symbol] = &[sym::marker];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::ConstTrait;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Marker;
}

pub(crate) struct DenyExplicitImplParser;
Expand All @@ -76,20 +91,17 @@ impl<S: Stage> NoArgsAttributeParser<S> for DoNotImplementViaObjectParser {
const CREATE: fn(Span) -> AttributeKind = AttributeKind::DoNotImplementViaObject;
}

pub(crate) struct CoinductiveParser;
impl<S: Stage> NoArgsAttributeParser<S> for CoinductiveParser {
const PATH: &[Symbol] = &[sym::rustc_coinductive];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Coinductive;
}
// Const traits

pub(crate) struct TypeConstParser;
impl<S: Stage> NoArgsAttributeParser<S> for TypeConstParser {
const PATH: &[Symbol] = &[sym::type_const];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::TypeConst;
pub(crate) struct ConstTraitParser;
impl<S: Stage> NoArgsAttributeParser<S> for ConstTraitParser {
const PATH: &[Symbol] = &[sym::const_trait];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::ConstTrait;
}

// Specialization

pub(crate) struct SpecializationTraitParser;
impl<S: Stage> NoArgsAttributeParser<S> for SpecializationTraitParser {
const PATH: &[Symbol] = &[sym::rustc_specialization_trait];
Expand All @@ -104,11 +116,13 @@ impl<S: Stage> NoArgsAttributeParser<S> for UnsafeSpecializationMarkerParser {
const CREATE: fn(Span) -> AttributeKind = AttributeKind::UnsafeSpecializationMarker;
}

pub(crate) struct MarkerParser;
impl<S: Stage> NoArgsAttributeParser<S> for MarkerParser {
const PATH: &[Symbol] = &[sym::marker];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Marker;
// Coherence

pub(crate) struct CoinductiveParser;
impl<S: Stage> NoArgsAttributeParser<S> for CoinductiveParser {
const PATH: &[Symbol] = &[sym::rustc_coinductive];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::Coinductive;
}

pub(crate) struct FundamentalParser;
Expand All @@ -117,10 +131,3 @@ impl<S: Stage> NoArgsAttributeParser<S> for FundamentalParser {
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::Fundamental;
}

pub(crate) struct ParenSugarParser;
impl<S: Stage> NoArgsAttributeParser<S> for ParenSugarParser {
const PATH: &[Symbol] = &[sym::rustc_paren_sugar];
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::ParenSugar;
}