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 
bar<T: Sync>(_: T)13 fn bar<T: Sync>(_: T) {}
14 
main()15 fn main() {
16     let x = Foo::A(NoSync);
17     bar(&x);
18     //~^ ERROR `NoSync` cannot be shared between threads safely [E0277]
19 }
20