Rollup merge of #82942 - m-ou-se:diagnostics-hardcoded-prelude-v1, r=estebank
Don't hardcode the `v1` prelude in diagnostics, to allow for new preludes. Instead of looking for `std::prelude::v1`, this changes the two places where that was hardcoded to look for `std::prelude::<anything>` instead. This is needed for https://github.com/rust-lang/rust/pull/82217. r? `@estebank`
This commit is contained in:
commit
9dc82face3
2 changed files with 7 additions and 2 deletions
|
@ -334,7 +334,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
|||
.lookup_import_candidates(ident, ns, &self.parent_scope, is_enum_variant)
|
||||
.into_iter()
|
||||
.map(|suggestion| import_candidate_to_enum_paths(&suggestion))
|
||||
.filter(|(_, enum_ty_path)| enum_ty_path != "std::prelude::v1")
|
||||
.filter(|(_, enum_ty_path)| !enum_ty_path.starts_with("std::prelude::"))
|
||||
.collect();
|
||||
if !enum_candidates.is_empty() {
|
||||
if let (PathSource::Type, Some(span)) =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue