]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mut/mutable-enum-indirect.rs
Rollup merge of #93813 - xldenis:public-mir-passes, r=wesleywiser
[rust.git] / src / test / ui / mut / mutable-enum-indirect.rs
1 // Tests that an `&` pointer to something inherently mutable is itself
2 // to be considered mutable.
3
4 #![feature(negative_impls)]
5
6 use std::marker::Sync;
7
8 struct NoSync;
9 impl !Sync for NoSync {}
10
11 enum Foo { A(NoSync) }
12
13 fn bar<T: Sync>(_: T) {}
14
15 fn main() {
16     let x = Foo::A(NoSync);
17     bar(&x);
18     //~^ ERROR `NoSync` cannot be shared between threads safely [E0277]
19 }