Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4305769
Tweak handling of "struct like start" where a struct isn't supported
estebank Sep 24, 2025
a4e87e9
Support `#[rustc_align_static]` inside `thread_local!`
Jules-Bertholet Sep 10, 2025
bb48c16
Simplify logic slightly
estebank Sep 24, 2025
4d32b9a
Hoist non-platform-specific code out of `thread_local_inner!`
Jules-Bertholet Sep 27, 2025
86f2d42
indexing: reword help
hkBst Sep 15, 2025
5b809b3
Don't enable shared memory with Wasm atomics
daxpedda Oct 1, 2025
8dfea22
implement `Box::take`
edwloef Oct 1, 2025
6961953
Switch `citool` to 2024 edition
GuillaumeGomez Oct 1, 2025
4baf920
Initialize llvm submodule if not already the case to run citool
GuillaumeGomez Oct 1, 2025
3e8ce2b
Adjust WASI and WALI targets
daxpedda Oct 1, 2025
94f00f4
Fix memory leak in `os` impl
Jules-Bertholet Oct 1, 2025
5991c87
Update books
rustbot Oct 1, 2025
30d57ab
mbe: Rename a local variable to match corresponding field names
joshtriplett Sep 14, 2025
6bff1ab
mbe: Support `unsafe` attribute rules
joshtriplett Sep 14, 2025
05c5b87
mbe: Add parsing tests for `unsafe` macro rules
joshtriplett Sep 14, 2025
ea0e00c
mbe: Add tests for `unsafe` attr invocation
joshtriplett Sep 14, 2025
4fc0a0d
mbe: `expand_invoc`: Add comment about not needing to check safety of…
joshtriplett Sep 28, 2025
59c4dfe
Forbid `//@ compile-flags: -Cincremental=` in tests
Zalathar Oct 1, 2025
92aac1b
Rollup merge of #146281 - Jules-Bertholet:static-align-thread-local, …
matthiaskrgr Oct 2, 2025
ac7beab
Rollup merge of #146535 - joshtriplett:mbe-unsafe-attr, r=petrochenkov
matthiaskrgr Oct 2, 2025
7320d3e
Rollup merge of #146585 - hkBst:indexing-1, r=jdonszelmann
matthiaskrgr Oct 2, 2025
e041b2c
Rollup merge of #147004 - estebank:ascription-in-pat, r=fee1-dead
matthiaskrgr Oct 2, 2025
b78b107
Rollup merge of #147221 - Zalathar:incremental, r=lqd
matthiaskrgr Oct 2, 2025
8a18176
Rollup merge of #147225 - daxpedda:wasm-u-u-atomics-threads, r=alexcr…
matthiaskrgr Oct 2, 2025
fbe6834
Rollup merge of #147227 - edwloef:box_take, r=joboet
matthiaskrgr Oct 2, 2025
f4dcfa6
Rollup merge of #147233 - GuillaumeGomez:citool-submodule-init, r=Kobzol
matthiaskrgr Oct 2, 2025
2d1efe7
Rollup merge of #147236 - rustbot:docs-update, r=ehuss
matthiaskrgr Oct 2, 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
mbe: Add tests for unsafe attr invocation
  • Loading branch information
joshtriplett committed Oct 1, 2025
commit ea0e00c5738f56970ad3ed3cc3d27c19715cd9ea
19 changes: 19 additions & 0 deletions tests/ui/macros/macro-rules-attr-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ macro_rules! forward_referenced_attr {
macro_rules! cyclic_attr {
attr() {} => {}
}

macro_rules! attr_with_safety {
unsafe attr() { struct RequiresUnsafe; } => {};
attr() { struct SafeInvocation; } => {};
}

#[attr_with_safety]
struct SafeInvocation;

//~v ERROR: unnecessary `unsafe` on safe attribute invocation
#[unsafe(attr_with_safety)]
struct SafeInvocation;

//~v ERROR: unsafe attribute invocation requires `unsafe`
#[attr_with_safety]
struct RequiresUnsafe;

#[unsafe(attr_with_safety)]
struct RequiresUnsafe;
14 changes: 13 additions & 1 deletion tests/ui/macros/macro-rules-attr-error.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ LL | #[local_attr]
|
= note: this error originates in the attribute macro `local_attr` (in Nightly builds, run with -Z macro-backtrace for more info)

error: unnecessary `unsafe` on safe attribute invocation
--> $DIR/macro-rules-attr-error.rs:63:3
|
LL | #[unsafe(attr_with_safety)]
| ^^^^^^

error: unsafe attribute invocation requires `unsafe`
--> $DIR/macro-rules-attr-error.rs:67:1
|
LL | #[attr_with_safety]
| ^^^^^^^^^^^^^^^^^^^

error: cannot find macro `local_attr` in this scope
--> $DIR/macro-rules-attr-error.rs:27:5
|
Expand Down Expand Up @@ -59,5 +71,5 @@ note: a macro with the same name exists, but it appears later
LL | macro_rules! cyclic_attr {
| ^^^^^^^^^^^

error: aborting due to 6 previous errors
error: aborting due to 8 previous errors