Skip to content

Commit

Permalink
fix #104510, Remove is_tainted_by_errors since we have ty_error for d…
Browse files Browse the repository at this point in the history
…elay bug
  • Loading branch information
chenyukang committed Nov 16, 2022
1 parent bebd57a commit 9c2d4dd
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 0 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 16 additions & 0 deletions src/test/ui/typeck/issue-104510-ice.rs
Original file line number Diff line number Diff line change
@@ -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() {}
9 changes: 9 additions & 0 deletions src/test/ui/typeck/issue-104510-ice.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 9c2d4dd

Please sign in to comment.