Skip to content

Commit 0674050

Browse files
committed
Fix tests by keepeing needed suggestions
1 parent 282f75a commit 0674050

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/librustc_resolve/lib.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -2716,12 +2716,20 @@ impl<'a> Resolver<'a> {
27162716
}
27172717
return (err, candidates);
27182718
}
2719+
(Def::Union(..), _) |
2720+
(Def::Variant(..), _) |
2721+
(Def::VariantCtor(_, CtorKind::Fictive), _) if ns == ValueNS => {
2722+
err.span_label(span, format!("did you mean `{} {{ /* fields */ }}`?",
2723+
path_str));
2724+
return (err, candidates);
2725+
}
27192726
(Def::SelfTy(..), _) if ns == ValueNS => {
2727+
err.span_label(span, fallback_label);
27202728
err.note("can't use `Self` as a constructor, you must use the \
27212729
implemented struct");
27222730
return (err, candidates);
27232731
}
2724-
(Def::TyAlias(_), _) if ns == ValueNS => {
2732+
(Def::TyAlias(_), _) | (Def::AssociatedTy(..), _) if ns == ValueNS => {
27252733
err.note("can't use a type alias as a constructor");
27262734
return (err, candidates);
27272735
}

0 commit comments

Comments
 (0)