rust/src/test/compile-fail/mutable-enum-indirect.rs

13 lines
251 B
Rust
Raw Normal View History

// Tests that an `&` pointer to something inherently mutable is itself
// to be considered mutable.
#[no_freeze]
enum Foo { A }
fn bar<T: Freeze>(_: T) {}
fn main() {
let x = A;
bar(&x); //~ ERROR type parameter with an incompatible type
}