Change:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: unexpected non-type Node::GenericParam: Type { default: None, synthetic: false }', 'error: internal compiler error: unexpected non-type Node::GenericParam: Type { default: None, synthetic: false }' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: [typeof] computing type of [typeck] type-checking --
mvce:
:thinking: cc
I'm gonna assume that it is this line that needs additional logic:

Discussion:
err, pick.item.def_id, rcvr.hir_id, <del> *rcvr_ty, </del> <ins> Some(*rcvr_ty), </ins> ); if pick.autoderefs == 0 && !trait_in_other_version_found { err.span_label(

if let SelfSource::QPath(ty) = source && !valid_out_of_scope_traits.is_empty() && let hir::TyKind::Path(path) = ty.kind <del> && let hir::QPath::Resolved(_, path) = path && let Some(def_id) = path.res.opt_def_id() </del> <ins> && let hir::QPath::Resolved(..) = path </ins> && let Some(assoc) = self .tcx .associated_items(valid_out_of_scope_traits[0])

// See if the `Type::function(val)` where `function` wasn't found corresponds to a // `Trait` that is imported directly, but `Type` came from a different version of the // same crate. <del> let rcvr_ty = self.tcx.type_of(def_id).instantiate_identity(); </del> <ins> let rcvr_ty = self.node_ty_opt(ty.hir_id); </ins> trait_in_other_version_found = self.detect_and_explain_multiple_crate_versions( err, assoc.def_id,

err: &mut Diag<'_>, item_def_id: DefId, hir_id: hir::HirId, <del> rcvr_ty: Ty<'_>, </del> <ins> rcvr_ty: Option<Ty<'_>>, </ins> ) -> bool { let hir_id = self.tcx.parent_hir_id(hir_id); let Some(traits) = self.tcx.in_scope_traits(hir_id) else { return false };

let mut multi_span: MultiSpan = trait_span.into(); multi_span.push_span_label(trait_span, format!("this is the trait that is needed")); let descr = self.tcx.associated_item(item_def_id).descr(); <ins> let rcvr_ty = rcvr_ty.map(|t| format!("`{t}`")).unwrap_or_else(|| "the receiver".to_string()); </ins> multi_span <del> .push_span_label(item_span, format!("the {descr} is available for `{rcvr_ty}` here")); </del> <ins> .push_span_label(item_span, format!("the {descr} is available for {rcvr_ty} here")); </ins> for (def_id, import_def_id) in candidates { if let Some(import_def_id) = import_def_id { multi_span.push_span_label(

<del> //@ known-bug: rust-lang/rust#129205 fn x<T: Copy>() { T::try_from(); } </del>

<del> //@ known-bug: rust-lang/rust#129216 //@ only-linux trait Mirror { type Assoc; } struct Foo; fn main() { <Foo as Mirror>::Assoc::new(); } </del>

<ins> // Regression test for https://github.com/rust-lang/rust/issues/129205 fn x<T: Copy>() { T::try_from(); //~ ERROR E0599 } fn main() {} </ins>

<ins> error[E0599]: no function or associated item named `try_from` found for type parameter `T` in the current scope --> $DIR/missing-method-on-type-parameter.rs:3:8 | LL | fn x<T: Copy>() { |      - function or associated item `try_from` not found for this type parameter LL |     T::try_from(); |        ^^^^^^^^ function or associated item not found in `T` | = help: items from traits can only be used if the trait is in scope help: there is an associated function `from` with a similar name --> $SRC_DIR/core/src/convert/mod.rs:LL:COL help: trait `TryFrom` which provides `try_from` is implemented but not in scope; perhaps you want to import it | LL + use std::convert::TryFrom; | error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0599`. </ins>