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
This commit is contained in:
parent
7fb583be7b
commit
f3191a450c
2 changed files with 234 additions and 244 deletions
12
src/test/compile-fail/mutable-enum-indirect.rs
Normal file
12
src/test/compile-fail/mutable-enum-indirect.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue