diff options
| author | bors <bors@rust-lang.org> | 2025-07-04 14:37:30 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-04 14:37:30 +0000 | 
| commit | 0c4fa2690de945f062668acfc36b3f8cfbd013e2 (patch) | |
| tree | 2e57f7883dc3c6de58c406d64b53638140e19a16 /compiler/rustc_attr_parsing | |
| parent | 556d20a834126d2d0ac20743b9792b8474d6d03c (diff) | |
| parent | 3a5da6c4d82a9d7d191ff8d2bfbd8350487ad855 (diff) | |
| download | rust-0c4fa2690de945f062668acfc36b3f8cfbd013e2.tar.gz rust-0c4fa2690de945f062668acfc36b3f8cfbd013e2.zip  | |
Auto merge of #143434 - matthiaskrgr:rollup-eyr4rcb, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang/rust#140643 (Refactor StableMIR) - rust-lang/rust#143286 (Make -Ztrack-diagnostics emit like a note) - rust-lang/rust#143308 (Remove `PointerLike` trait) - rust-lang/rust#143387 (Make __rust_alloc_error_handler_should_panic a function) - rust-lang/rust#143400 (Port `#[rustc_pass_by_value]` to the new attribute system) - rust-lang/rust#143417 (bump termize dep) - rust-lang/rust#143420 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_attr_parsing')
| -rw-r--r-- | compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_attr_parsing/src/context.rs | 3 | 
2 files changed, 9 insertions, 1 deletions
diff --git a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs index 5437803d781..8ad98c8d1d4 100644 --- a/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs +++ b/compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs @@ -17,3 +17,10 @@ impl<S: Stage> NoArgsAttributeParser<S> for PubTransparentParser { const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error; const CREATE: fn(Span) -> AttributeKind = AttributeKind::PubTransparent; } + +pub(crate) struct PassByValueParser; +impl<S: Stage> NoArgsAttributeParser<S> for PassByValueParser { + const PATH: &[Symbol] = &[sym::rustc_pass_by_value]; + const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error; + const CREATE: fn(Span) -> AttributeKind = AttributeKind::PassByValue; +} diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index 43b36b4c554..5ddb686a8c0 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -23,7 +23,7 @@ use crate::attributes::confusables::ConfusablesParser; use crate::attributes::deprecation::DeprecationParser; use crate::attributes::inline::{InlineParser, RustcForceInlineParser}; use crate::attributes::link_attrs::{LinkNameParser, LinkSectionParser}; -use crate::attributes::lint_helpers::{AsPtrParser, PubTransparentParser}; +use crate::attributes::lint_helpers::{AsPtrParser, PassByValueParser, PubTransparentParser}; use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser}; use crate::attributes::must_use::MustUseParser; use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser; @@ -144,6 +144,7 @@ attribute_parsers!( Single<WithoutArgs<MayDangleParser>>, Single<WithoutArgs<NoImplicitPreludeParser>>, Single<WithoutArgs<NoMangleParser>>, + Single<WithoutArgs<PassByValueParser>>, Single<WithoutArgs<PubTransparentParser>>, Single<WithoutArgs<TrackCallerParser>>, // tidy-alphabetical-end  | 
