Files
rust/compiler/rustc_resolve
Jonathan Brouwer 581f102a5f Rollup merge of #159599 - LorrensP-2158466:fix-ambig-trait-glob-lint, r=petrochenkov
Resolver: Record at least 1 ambiguous trait if main decl is not a trait.

Addresses rust-lang/rust#159476.

When recording traits of a particular module, it is possible that a trait hidden in the ambiguity declaration of a main declaration (struct, enum, ...), thus causing us to never record that trait. This caused us to report an error that methods of those traits are not in scope and that we do not report the `AMBIGUOUSLY_GLOB_IMPORTED_TRAIT` lint, which was the case in rust-lang/rust#159476.

We now record at least 1 trait in the collection of ambiguous declarations, such that we don't report that error and can report the relevant lint.

Also updated the linked issue of the lint in question.

r? @petrochenkov
2026-07-20 18:06:09 +02:00
..
2026-06-24 23:18:10 +01:00