Skip to content

Commit 0c49893

Browse files
committed
Emit warning
1 parent da33dc0 commit 0c49893

File tree

1 file changed

+7
-0
lines changed
  • src/librustc_typeck/check

1 file changed

+7
-0
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,13 @@ fn typeck_tables_of_with_fallback<'tcx>(
11641164

11651165
if inhabited {
11661166
debug!("All arguments are inhabited!");
1167+
fcx.tcx()
1168+
.sess
1169+
.struct_span_warn(
1170+
path.span,
1171+
"Fallback to `!` may introduce undefined behavior",
1172+
)
1173+
.emit();
11671174
}
11681175
}
11691176
}

0 commit comments

Comments
 (0)