forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#60641 - estebank:defer-ice, r=oli-obk
Instead of ICEing on incorrect pattern, use delay_span_bug Fix rust-lang#60635.
- Loading branch information
Showing
3 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
struct A {} | ||
|
||
impl A { | ||
fn new() {} | ||
} | ||
|
||
fn hof<F>(_: F) where F: FnMut(()) {} | ||
|
||
fn ice() { | ||
hof(|c| match c { | ||
A::new() => (), //~ ERROR expected tuple struct/variant, found method | ||
_ => () | ||
}) | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0164]: expected tuple struct/variant, found method `<A>::new` | ||
--> $DIR/fn-in-pat.rs:11:9 | ||
| | ||
LL | A::new() => (), | ||
| ^^^^^^^^ not a tuple variant or struct | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0164`. |