0

If you lookup the trait impls for the Rc type you will see these 2 impls:

impl<T: ?Sized> !marker::Send for Rc<T> {}
impl<T: ?Sized> !marker::Sync for Rc<T> {}

These are negative impls which means you are telling the compiler not to automatically implement them, which is fine but this is not on stable yet, see: https://github.com/rust-lang/rust/issues/68318

How is it possible, if right before the definition they use the cfg flag that this is on stable:

#[stable(feature = "rust1", since = "1.0.0")]
impl<T: ?Sized> !marker::Send for Rc<T> {}
cafce25
  • 15,907
  • 4
  • 25
  • 31
Kuly14
  • 496
  • 3
  • 12
  • 3
    The standard library can use unstable features, hence things [like the `Try` trait](https://doc.rust-lang.org/src/core/option.rs.html#2394-2412), [specialization](https://doc.rust-lang.org/src/alloc/string.rs.html#2544), or negative impls. – Masklinn Mar 16 '23 at 06:58
  • Negative impls do not merely prohibit automatically deriving the trait, they also promise there will not be an implementation of it in the future. – user3840170 Mar 16 '23 at 09:27

0 Answers0