Rollup merge of #152727 - lcnr:method-ambig-err-taint, r=jackh726

`probe_op` silence ambiguity errors if tainted

see the `proc-macro/quote/not-repeatable.rs` test for a case where this is useful

r? types
This commit is contained in:
Stuart Cook 2026-02-17 13:02:25 +11:00 committed by GitHub
commit dd27f85cb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 57 additions and 53 deletions

View file

@ -490,6 +490,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
.unwrap_or_else(|_| span_bug!(span, "instantiating {:?} failed?", ty));
let ty = self.resolve_vars_if_possible(ty.value);
let guar = match *ty.kind() {
_ if let Some(guar) = self.tainted_by_errors() => guar,
ty::Infer(ty::TyVar(_)) => {
// We want to get the variable name that the method
// is being called on. If it is a method call.