Implicit deref patterns allow previously ill-typed programs. Make sure they're still ill-typed without the feature gate. I've thrown in a test for `deref!(_)` too, though it seems it refers to `deref_patterns` as a library feature.
15 lines
321 B
Rust
15 lines
321 B
Rust
// gate-test-deref_patterns
|
|
|
|
fn main() {
|
|
match Box::new(0) {
|
|
deref!(0) => {}
|
|
//~^ ERROR: use of unstable library feature `deref_patterns`: placeholder syntax for deref patterns
|
|
_ => {}
|
|
}
|
|
|
|
match Box::new(0) {
|
|
0 => {}
|
|
//~^ ERROR: mismatched types
|
|
_ => {}
|
|
}
|
|
}
|