Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add note to non-exhaustive match on reference to empty #80651

Merged
merged 3 commits into from
Jan 4, 2021

Conversation

GroteGnoom
Copy link

Rust prints "type &A is non-empty" even is A is empty.
This is the intended behavior, but can be confusing.
This commit adds a note to non-exhaustive pattern errors if they are a
reference to something uninhabited.

I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.

Maybe the added test is superfluous, because
always-inhabited-union-ref already checks for this case.

This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.

Fixes #78123

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 3, 2021
@cjgillot
Copy link
Contributor

cjgillot commented Jan 3, 2021

I only see changes to the tests. Did you forget to commit the changes you made to the compiler?

@jyn514 jyn514 added A-diagnostics Area: Messages for errors, warnings, and lints A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 3, 2021
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 8000/11241
..................................................................................i................. 8100/11241
.................................................................................................... 8200/11241
.............................................................................................i...... 8300/11241
..................F......................................F.......................................... 8400/11241
................................................iiii.iiii........................................... 8600/11241
........i.............i............................................................................. 8700/11241
.................................................................................................... 8800/11241
.................................................................................................... 8900/11241
.................................................................................................... 8900/11241
.................................................................................................... 9000/11241
.................................................................................................... 9100/11241
.................................................................................................... 9200/11241
.....................................i......i....................................................... 9300/11241
............................................................................iiiiii..iiiiii.i........ 9400/11241
.................................................................................................... 9600/11241
.................................................................................................... 9700/11241
.................................................................................................... 9800/11241
.................................................................................................... 9900/11241
---
diff of stderr:

6    |
7    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
8    = note: the matched value is of type `&!`
-    = note: references are always considered inhabited
10 
11 error[E0004]: non-exhaustive patterns: type `Foo` is non-empty


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/always-inhabited-union-ref/always-inhabited-union-ref.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args pattern/usefulness/always-inhabited-union-ref.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/pattern/usefulness/always-inhabited-union-ref.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/always-inhabited-union-ref" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/always-inhabited-union-ref/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0004]: non-exhaustive patterns: type `&!` is non-empty
   |
   |
LL |     match uninhab_ref() {
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `&!`


error[E0004]: non-exhaustive patterns: type `Foo` is non-empty
   |
   |
LL | / pub union Foo {
LL | |     foo: !,
LL | | }
   | |_- `Foo` defined here
...
LL |       match uninhab_union() {
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `Foo`

---
diff of stderr:

9    |
10    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
11    = note: the matched value is of type `&A`
-    = note: references are always considered inhabited
14 error: aborting due to previous error
15 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference/issue-78123-non-exhaustive-reference.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args pattern/usefulness/issue-78123-non-exhaustive-reference.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/pattern/usefulness/issue-78123-non-exhaustive-reference/auxiliary"
------------------------------------------

------------------------------------------
stderr:
stderr:
------------------------------------------
error[E0004]: non-exhaustive patterns: type `&A` is non-empty
   |
   |
LL | enum A {}
   | --------- `A` defined here
...
LL |     match a {} //~ ERROR non-exhaustive patterns: type `&A` is non-empty
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `&A`

---

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu


command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:16:46

Rust prints "type `&A` is non-empty" even is A is empty.
This is the intended behavior, but can be confusing.
This commit adds a note to non-exhaustive pattern errors if they are a
reference to something uninhabited.

I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.

Maybe the added test is superfluous, because
`always-inhabited-union-ref` already checks for this case.

This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.

Fixes rust-lang#78123
@varkor
Copy link
Member

varkor commented Jan 3, 2021

r? @Nadrieril

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-9 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
.................................................................................................... 9000/11241
.................................................................................................... 9100/11241
.................................................................................................... 9200/11241
.....................................i......i....................................................... 9300/11241
............................................................................iiiiii..iiiiii.i........ 9400/11241
.................................................................................................... 9600/11241
.................................................................................................... 9700/11241
.................................................................................................... 9800/11241
.................................................................................................... 9900/11241
---
diff of stderr:

23    |
24    = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
25    = note: the matched value is of type `&Void`
+    = note: references are always considered inhabited
26 
27 error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/uninhabited/uninhabited-matches-feature-gated/uninhabited-matches-feature-gated.stderr
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/uninhabited/uninhabited-matches-feature-gated/uninhabited-matches-feature-gated.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args uninhabited/uninhabited-matches-feature-gated.rs`
error: 1 errors occurred comparing output.
status: exit code: 1
status: exit code: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/uninhabited/uninhabited-matches-feature-gated.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zemit-future-incompat-report" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/uninhabited/uninhabited-matches-feature-gated" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/uninhabited/uninhabited-matches-feature-gated/auxiliary"
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
------------------------------------------

------------------------------------------
------------------------------------------
stderr:
------------------------------------------
error[E0004]: non-exhaustive patterns: `Err(_)` not covered
   |
   |
LL |     let _ = match x {   //~ ERROR non-exhaustive
   |                   ^ pattern `Err(_)` not covered
  ::: /checkout/library/core/src/result.rs:250:5
   |
   |
LL |     Err(#[stable(feature = "rust1", since = "1.0.0")] E),
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `std::result::Result<u32, &Void>`

error[E0004]: non-exhaustive patterns: type `&Void` is non-empty
   |
   |
LL | enum Void {}
   | ------------ `Void` defined here
...
LL |     let _ = match x {}; //~ ERROR non-exhaustive
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `&Void`
   = note: the matched value is of type `&Void`
   = note: references are always considered inhabited

error[E0004]: non-exhaustive patterns: type `(Void,)` is non-empty
   |
   |
LL |     let _ = match x {}; //~ ERROR non-exhaustive
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `(Void,)`

error[E0004]: non-exhaustive patterns: type `[Void; 1]` is non-empty
   |
   |
LL |     let _ = match x {}; //~ ERROR non-exhaustive
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `[Void; 1]`

error[E0004]: non-exhaustive patterns: `&[_, ..]` not covered
   |
   |
LL |     let _ = match x {   //~ ERROR non-exhaustive
   |                   ^ pattern `&[_, ..]` not covered
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `&[Void]`

error[E0004]: non-exhaustive patterns: `Err(_)` not covered
   |
   |
LL |     let _ = match x {   //~ ERROR non-exhaustive
   |                   ^ pattern `Err(_)` not covered
  ::: /checkout/library/core/src/result.rs:250:5
   |
   |
LL |     Err(#[stable(feature = "rust1", since = "1.0.0")] E),
   |
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms
   = note: the matched value is of type `std::result::Result<u32, Void>`

error[E0005]: refutable pattern in local binding: `Err(_)` not covered
   |
   |
LL |     let Ok(x) = x;
   |         ^^^^^ pattern `Err(_)` not covered
  ::: /checkout/library/core/src/result.rs:250:5
   |
   |
LL |     Err(#[stable(feature = "rust1", since = "1.0.0")] E),
   |
   |
   = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
   = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
   = note: the matched value is of type `std::result::Result<u32, Void>`
help: you might want to use `if let` to ignore the variant that isn't matched
   |
LL |     if let Ok(x) = x { /* */ }

error: aborting due to 7 previous errors

Some errors have detailed explanations: E0004, E0005.
---
test result: FAILED. 11155 passed; 1 failed; 85 ignored; 0 measured; 0 filtered out; finished in 136.85s



command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--suite" "ui" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-9/bin/FileCheck" "--nodejs" "/usr/bin/node" "--host-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Cdebuginfo=0 -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "9.0.0" "--llvm-components" "aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets amdgpu amdgpuasmparser amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter bpf bpfasmparser bpfcodegen bpfdesc bpfdisassembler bpfinfo codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver engine executionengine fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink lanai lanaiasmparser lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes perfjitevents powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xcore xcorecodegen xcoredesc xcoredisassembler xcoreinfo xray" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"


failed to run: /checkout/obj/build/bootstrap/debug/bootstrap --stage 2 test --exclude src/tools/tidy
Build completed unsuccessfully in 0:15:03

This test is also changed by adding a note about uninhabited references
still counting as inhabited.
@Nadrieril
Copy link
Member

It seems you also need to update the output of ui/uninhabited/uninhabited-matches-feature-gated.rs.
Other than that, looks great to me :)

I did not add tests to check that the note is not shown for
non-references or inhabited references, because this is already done
in other tests.

Fair enough, that's a simple enough case anyways.

This does not handle &&Void or &&&void etc. I could add those as special
cases as well and ignore people who need quadruple
references.

Eh, I can't tell what's needed here. I'm happy either way.

Maybe the added test is superfluous, because always-inhabited-union-ref already checks for this case.

After you add //~ NOTE comments that won't be the case. But also more generally always-inhabited-union-ref is union-specific so someone might change that test later without noticing that the &! bit was not tested elsewhere. From personal experience I prefer to err on the side of more tests.

@GroteGnoom
Copy link
Author

@rustbot label -S-waiting-on-author +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 4, 2021
@Nadrieril
Copy link
Member

Looks good to me, thank you!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 4, 2021

📌 Commit 914bc17 has been approved by Nadrieril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 4, 2021
@bors
Copy link
Contributor

bors commented Jan 4, 2021

⌛ Testing commit 914bc17 with merge ab5b9ae...

@bors
Copy link
Contributor

bors commented Jan 4, 2021

☀️ Test successful - checks-actions
Approved by: Nadrieril
Pushing ab5b9ae to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 4, 2021
@bors bors merged commit ab5b9ae into rust-lang:master Jan 4, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 4, 2021
lnyng pushed a commit to lnyng/resctl that referenced this pull request Jun 2, 2022
Summary:
Turns out that reference to empty enum is consider inhabited: rust-lang/rust#80651

Fix by adding a unreachable clause.

Differential Revision: D36850027

fbshipit-source-id: cc338becc4ebd57c33441c2d8575b07c3052229e
facebook-github-bot pushed a commit to facebookincubator/below that referenced this pull request Jun 3, 2022
Summary:
Turns out that reference to empty enum is consider inhabited: rust-lang/rust#80651

Fix by adding a unreachable clause.

Reviewed By: brianc118

Differential Revision: D36850027

fbshipit-source-id: 83814b331d51bc843629885ed070d527792e9736
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-exhaustiveness-checking Relating to exhaustiveness / usefulness checking of patterns merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-exhaustive patterns error when matching reference to empty enum
10 participants