Skip to content
Draft
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
8 changes: 1 addition & 7 deletions compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ impl SingleAttributeParser for ExportNameParser {
Allow(Target::Static),
Allow(Target::Fn),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::Trait { body: true })),
Allow(Target::Method(MethodKind::TraitImpl)),
Warn(Target::Field),
Warn(Target::Arm),
Warn(Target::MacroDef),
Warn(Target::MacroCall),
]);
const TEMPLATE: AttributeTemplate = template!(NameValueStr: "name");
const STABILITY: AttributeStability = AttributeStability::Stable;
Expand Down Expand Up @@ -386,13 +381,12 @@ impl NoArgsAttributeParser for NoMangleParser {
note: "the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them",
unsafe_since: Some(Edition2024),
};
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowListWarnRest(&[
const ALLOWED_TARGETS: AllowedTargets<'_> = AllowedTargets::AllowList(&[
Allow(Target::Fn),
Allow(Target::Static),
Allow(Target::Method(MethodKind::Inherent)),
Allow(Target::Method(MethodKind::TraitImpl)),
AllowSilent(Target::Const), // Handled in the `InvalidNoMangleItems` pass
Error(Target::Closure),
]);
const STABILITY: AttributeStability = AttributeStability::Stable;
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoMangle;
Expand Down
5 changes: 0 additions & 5 deletions src/tools/miri/test-cargo-miri/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies = [
"issue_1567",
"issue_1691",
"issue_1705",
"issue_rust_86261",
"proc-macro2",
"proc_macro_crate",
]
Expand Down Expand Up @@ -82,10 +81,6 @@ dependencies = [
"byteorder 1.5.0",
]

[[package]]
name = "issue_rust_86261"
version = "0.1.0"

[[package]]
name = "once_cell"
version = "1.21.3"
Expand Down
1 change: 0 additions & 1 deletion src/tools/miri/test-cargo-miri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ proc_macro_crate = { path = "proc-macro-crate" }
issue_1567 = { path = "issue-1567" }
issue_1691 = { path = "issue-1691" }
issue_1705 = { path = "issue-1705" }
issue_rust_86261 = { path = "issue-rust-86261" }

[dev-dependencies]
byteorder_2 = { package = "byteorder", version = "0.5" } # to test dev-dependencies behave as expected, with renaming
Expand Down
7 changes: 0 additions & 7 deletions src/tools/miri/test-cargo-miri/issue-rust-86261/Cargo.toml

This file was deleted.

19 changes: 0 additions & 19 deletions src/tools/miri/test-cargo-miri/issue-rust-86261/src/lib.rs

This file was deleted.

5 changes: 0 additions & 5 deletions src/tools/miri/test-cargo-miri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ mod test {

extern crate cargo_miri_test;
extern crate exported_symbol;
extern crate issue_rust_86261;

// Make sure in-crate tests with dev-dependencies work
#[test]
Expand All @@ -86,14 +85,10 @@ mod test {
fn exported_symbol() -> i32;
fn assoc_fn_as_exported_symbol() -> i32;
fn make_true() -> bool;
fn NoMangleStruct();
fn no_mangle_struct();
}
assert_eq!(unsafe { exported_symbol() }, 123456);
assert_eq!(unsafe { assoc_fn_as_exported_symbol() }, -123456);
assert!(unsafe { make_true() });
unsafe { NoMangleStruct() }
unsafe { no_mangle_struct() }
}
}

Expand Down
2 changes: 0 additions & 2 deletions tests/codegen-llvm/issues/issue-32031.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![crate_type = "lib"]

#[no_mangle]
pub struct F32(f32);

// other: define{{.*}}float @add_newtype_f32(float %a, float %b)
Expand All @@ -17,7 +16,6 @@ pub fn add_newtype_f32(a: F32, b: F32) -> F32 {
F32(a.0 + b.0)
}

#[no_mangle]
pub struct F64(f64);

// other: define{{.*}}double @add_newtype_f64(double %a, double %b)
Expand Down
6 changes: 2 additions & 4 deletions tests/ui/attributes/attr-on-mac-call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

fn main() {
#[export_name = "x"]
//~^ WARN attribute cannot be used on macro calls
//~| WARN previously accepted
//~^ ERROR attribute cannot be used on macro calls
#[unsafe(naked)]
//~^ WARN attribute cannot be used on macro calls
//~| WARN previously accepted
Expand Down Expand Up @@ -45,8 +44,7 @@ fn main() {
//~^ WARN attribute cannot be used on macro calls
//~| WARN previously accepted
#[no_mangle]
//~^ WARN attribute cannot be used on macro calls
//~| WARN previously accepted
//~^ ERROR attribute cannot be used on macro calls
#[deprecated]
//~^ WARN attribute cannot be used on macro calls
//~| WARN previously accepted
Expand Down
Loading
Loading