Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug #104515

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`.