rust/src/test/compile-fail/mutable-enum-indirect.rs
Niko Matsakis f3191a450c Refactor TypeContents to be more scrutable. In particular, create coarser bits
than the current ones, which were very fine-grained.  Also, cleanly distinguish
when properties must be found in *owned* types vs *reachable* types.

Fixes #10157
Fixes #10278
2013-11-05 14:50:35 -05:00

13 lines
251 B
Rust

// 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
}