Skip to content

Commit ec75a49

Browse files
committed
Allows #[diagnostic::on_unimplemented] attributes to have multiple
notes This commit extends the `#[diagnostic::on_unimplemented]` (and `#[rustc_on_unimplemented]`) attributes to allow multiple `note` options. This enables emitting multiple notes for custom error messages. For now I've opted to not change any of the existing usages of `#[rustc_on_unimplemented]` and just updated the relevant compile tests.
1 parent fb17423 commit ec75a49

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

core/src/marker.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,20 @@ impl<T: ?Sized> Copy for &T {}
621621
note = "if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock` or `std::sync::atomic::AtomicBool` instead",
622622
),
623623
on(
624-
_Self = "core::cell::Cell<T>",
624+
all(
625+
_Self = "core::cell::Cell<T>",
626+
not(_Self = "core::cell::Cell<u8>"),
627+
not(_Self = "core::cell::Cell<u16>"),
628+
not(_Self = "core::cell::Cell<u32>"),
629+
not(_Self = "core::cell::Cell<u64>"),
630+
not(_Self = "core::cell::Cell<usize>"),
631+
not(_Self = "core::cell::Cell<i8>"),
632+
not(_Self = "core::cell::Cell<i16>"),
633+
not(_Self = "core::cell::Cell<i32>"),
634+
not(_Self = "core::cell::Cell<i64>"),
635+
not(_Self = "core::cell::Cell<isize>"),
636+
not(_Self = "core::cell::Cell<bool>")
637+
),
625638
note = "if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock`",
626639
),
627640
on(

0 commit comments

Comments
 (0)