about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs1
-rw-r--r--src/test/ui/typeck/issue-104510-ice.rs16
-rw-r--r--src/test/ui/typeck/issue-104510-ice.stderr9
3 files changed, 25 insertions, 1 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
index 8cf70eb5431..a27dae8cc41 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
@@ -73,7 +73,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                 let ty = self.typeck_results.borrow().expr_ty_adjusted(expr);
                 let ty = self.resolve_vars_if_possible(ty);
                 if ty.has_non_region_infer() {
-                    assert!(self.is_tainted_by_errors());
                     self.tcx.ty_error()
                 } else {
                     self.tcx.erase_regions(ty)
diff --git a/src/test/ui/typeck/issue-104510-ice.rs b/src/test/ui/typeck/issue-104510-ice.rs
new file mode 100644
index 00000000000..157bdf07e38
--- /dev/null
+++ b/src/test/ui/typeck/issue-104510-ice.rs
@@ -0,0 +1,16 @@
+// needs-asm-support
+// only-x86_64
+
+struct W<T: ?Sized>(Oops);
+//~^ ERROR cannot find type `Oops` in this scope
+
+unsafe fn test() {
+    let j = W(());
+    let pointer = &j as *const _;
+    core::arch::asm!(
+        "nop",
+        in("eax") pointer,
+    );
+}
+
+fn main() {}
diff --git a/src/test/ui/typeck/issue-104510-ice.stderr b/src/test/ui/typeck/issue-104510-ice.stderr
new file mode 100644
index 00000000000..ddb510ef047
--- /dev/null
+++ b/src/test/ui/typeck/issue-104510-ice.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Oops` in this scope
+  --> $DIR/issue-104510-ice.rs:4:21
+   |
+LL | struct W<T: ?Sized>(Oops);
+   |                     ^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.