mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
It is correct to lower !
to _
.
This commit is contained in:
parent
5ad7454f75
commit
ee2cddd8f2
@ -680,8 +680,9 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
|
||||
cx.pattern_arena.alloc_from_iter(pats.into_iter().map(|p| self.lower_pat(p)))
|
||||
}
|
||||
PatKind::Never => {
|
||||
// FIXME(never_patterns): handle `!` in exhaustiveness. This is a sane default
|
||||
// in the meantime.
|
||||
// A never pattern matches all the values of its type (namely none). Moreover it
|
||||
// must be compatible with other constructors, since we can use `!` on a type like
|
||||
// `Result<!, !>` which has other constructors. Hence we lower it as a wildcard.
|
||||
ctor = Wildcard;
|
||||
fields = &[];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user