1
Fork 0

Don't hardcode the v1 prelude in diagnostics.

Instead of looking for `std::prelude::v1`, this changes it to look for
`std::prelude::<anything>`.
This commit is contained in:
Mara Bos 2021-03-09 19:40:01 +01:00
parent 1d6b0f626a
commit 1e4d8042fc
2 changed files with 7 additions and 2 deletions

View file

@ -324,7 +324,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)) =