Skip to content

Commit 45920d2

Browse files
committed
Remove redundant tainting. We already taint the first time we set the value
1 parent b103347 commit 45920d2

File tree

1 file changed

+1
-6
lines changed
  • compiler/rustc_hir_typeck/src/fn_ctxt

1 file changed

+1
-6
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
147147
let mut typeck = self.typeck_results.borrow_mut();
148148
let mut node_ty = typeck.node_types_mut();
149149
if let Some(ty) = node_ty.get(id)
150-
&& let Err(e) = ty.error_reported()
150+
&& ty.references_error()
151151
{
152-
// Do not overwrite nodes that were already marked as `{type error}`. This allows us to
153-
// silence unnecessary errors from obligations that were set earlier than a type error
154-
// was produced, but that is overwritten by later analysis. This happens in particular
155-
// for `Sized` obligations introduced in gather_locals. (#117846)
156-
self.set_tainted_by_errors(e);
157152
return;
158153
}
159154

0 commit comments

Comments
 (0)