Skip to content

Commit 5829287

Browse files
authored
Rollup merge of rust-lang#104515 - chenyukang:yukang/fix-104510-ice, r=compiler-errors
ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug Fixes rust-lang#104510
2 parents 43fa291 + 9c2d4dd commit 5829287

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
7373
let ty = self.typeck_results.borrow().expr_ty_adjusted(expr);
7474
let ty = self.resolve_vars_if_possible(ty);
7575
if ty.has_non_region_infer() {
76-
assert!(self.is_tainted_by_errors());
7776
self.tcx.ty_error()
7877
} else {
7978
self.tcx.erase_regions(ty)
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// needs-asm-support
2+
// only-x86_64
3+
4+
struct W<T: ?Sized>(Oops);
5+
//~^ ERROR cannot find type `Oops` in this scope
6+
7+
unsafe fn test() {
8+
let j = W(());
9+
let pointer = &j as *const _;
10+
core::arch::asm!(
11+
"nop",
12+
in("eax") pointer,
13+
);
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0412]: cannot find type `Oops` in this scope
2+
--> $DIR/issue-104510-ice.rs:4:21
3+
|
4+
LL | struct W<T: ?Sized>(Oops);
5+
| ^^^^ not found in this scope
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0412`.

0 commit comments

Comments
 (0)