about summary refs log tree commit diff
path: root/tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-02-03 22:25:15 +0100
committerGitHub <noreply@github.com>2024-02-03 22:25:15 +0100
commitceeaa8a8520de5ec2bfb450988998e6289090a6f (patch)
treeb1120127ca9be8aaeee56cafb07795baef517f8c /tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parentf3ebf1e50fa266a1ace583826fa2b906f0965ff1 (diff)
parentee2cddd8f2232aaac044c07b1a8ea1ceec083107 (diff)
downloadrust-ceeaa8a8520de5ec2bfb450988998e6289090a6f.tar.gz
rust-ceeaa8a8520de5ec2bfb450988998e6289090a6f.zip
Rollup merge of #120517 - Nadrieril:lower-never-as-wildcard, r=compiler-errors
never patterns: It is correct to lower `!` to `_`.

This is just a comment update but a non-trivial one: it is correct to lower `!` patterns as `_`. The reasoning is that `!` matches all the possible values of the type, since the type is empty. Moreover, we do want to warn that the `Err` is redundant in:
```rust
match x {
  !,
  Err(!),
}
```
which is consistent with `!` behaving like a wildcard.

I did try to introduce `Constructor::Never` and it ended up needing to behave exactly like `Constructor::Wildcard`.

r? ```@compiler-errors```
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions