Skip to content

Commit 93c1380

Browse files
remove inhabitedness check
1 parent 1205e82 commit 93c1380

File tree

5 files changed

+7
-9
lines changed

5 files changed

+7
-9
lines changed

compiler/rustc_mir/src/transform/remove_zsts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ impl<'tcx> MirPass<'tcx> for RemoveZsts {
1616
StatementKind::Assign(box (place, _)) => {
1717
let place_ty = place.ty(local_decls, tcx).ty;
1818
if let Ok(layout) = tcx.layout_of(param_env.and(place_ty)) {
19-
if layout.is_zst() && !layout.abi.is_uninhabited() {
19+
if layout.is_zst() {
2020
if tcx.consider_optimizing(|| {
2121
format!(
2222
"RemoveZsts - Place: {:?} SourceInfo: {:?}",

src/test/ui/consts/const-eval/panic-assoc-never-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ impl PrintName {
1515

1616
fn main() {
1717
let _ = PrintName::VOID;
18-
//~^ ERROR erroneous constant used
18+
//~^ ERROR erroneous constant encountered
1919
}

src/test/ui/consts/const-eval/panic-assoc-never-type.stderr

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ LL | #![warn(const_err)]
1515
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1616
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1717

18-
error[E0080]: erroneous constant used
18+
error: erroneous constant encountered
1919
--> $DIR/panic-assoc-never-type.rs:17:13
2020
|
2121
LL | let _ = PrintName::VOID;
22-
| ^^^^^^^^^^^^^^^ referenced constant has errors
22+
| ^^^^^^^^^^^^^^^
2323

2424
error: aborting due to previous error; 1 warning emitted
2525

26-
For more information about this error, try `rustc --explain E0080`.

src/test/ui/consts/const-eval/panic-never-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ const VOID: ! = panic!();
1111

1212
fn main() {
1313
let _ = VOID;
14-
//~^ ERROR erroneous constant used
14+
//~^ ERROR erroneous constant encountered
1515
}

src/test/ui/consts/const-eval/panic-never-type.stderr

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ LL | #![warn(const_err)]
1515
= note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800>
1616
= note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
1717

18-
error[E0080]: erroneous constant used
18+
error: erroneous constant encountered
1919
--> $DIR/panic-never-type.rs:13:13
2020
|
2121
LL | let _ = VOID;
22-
| ^^^^ referenced constant has errors
22+
| ^^^^
2323

2424
error: aborting due to previous error; 1 warning emitted
2525

26-
For more information about this error, try `rustc --explain E0080`.

0 commit comments

Comments
 (0)