Allow type_of to return partially non-error types if the type was already tainted
This commit is contained in:
parent
f989d2f625
commit
a04ac26a9d
18 changed files with 174 additions and 51 deletions
|
@ -502,7 +502,9 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
|
|||
bug!("unexpected sort of node in type_of(): {:?}", x);
|
||||
}
|
||||
};
|
||||
if let Err(e) = icx.check_tainted_by_errors() {
|
||||
if let Err(e) = icx.check_tainted_by_errors()
|
||||
&& !output.references_error()
|
||||
{
|
||||
ty::EarlyBinder::bind(Ty::new_error(tcx, e))
|
||||
} else {
|
||||
ty::EarlyBinder::bind(output)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue