fix #104510, Remove is_tainted_by_errors since we have ty_error for delay bug

This commit is contained in:
yukang 2022-11-16 19:40:35 +08:00
parent bebd57a960
commit 9c2d4dd529
3 changed files with 25 additions and 1 deletions

View File

@ -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)

View File

@ -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() {}

View File

@ -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`.