about summary refs log tree commit diff
path: root/library/core/src/future
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-12-20 16:57:14 +0100
committerLukas Markeffsky <@>2024-12-20 16:57:14 +0100
commit42c00cb6479d6e03742968e06c6d280a272acd53 (patch)
treec31e60187c98f3a54e3ad4dec73e7b258241c37e /library/core/src/future
parent8a1f8039a7ded79d3d4fe97b110016d89f2b11e2 (diff)
split up `#[rustc_deny_explicit_impl]` attribute
This commit splits the `#[rustc_deny_explicit_impl(implement_via_object = ...)]` attribute
into two attributes `#[rustc_deny_explicit_impl]` and `#[rustc_do_not_implement_via_object]`.

This allows us to have special traits that can have user-defined impls but do not have the
automatic trait impl for trait objects (`impl Trait for dyn Trait`).
Diffstat (limited to 'library/core/src/future')
-rw-r--r--library/core/src/future/async_drop.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/library/core/src/future/async_drop.rs b/library/core/src/future/async_drop.rs
index 7de5fe67cd0..ea6d3b800e6 100644
--- a/library/core/src/future/async_drop.rs
+++ b/library/core/src/future/async_drop.rs
@@ -133,7 +133,9 @@ pub trait AsyncDrop {
 }
 
 #[lang = "async_destruct"]
-#[rustc_deny_explicit_impl(implement_via_object = false)]
+#[cfg_attr(bootstrap, rustc_deny_explicit_impl(implement_via_object = false))]
+#[cfg_attr(not(bootstrap), rustc_deny_explicit_impl)]
+#[cfg_attr(not(bootstrap), rustc_do_not_implement_via_object)]
 trait AsyncDestruct {
     type AsyncDestructor: Future<Output = ()>;
 }