Skip to content

Commit

Permalink
Fix tests by keepeing needed suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 20, 2018
1 parent 282f75a commit 0674050
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2716,12 +2716,20 @@ impl<'a> Resolver<'a> {
}
return (err, candidates);
}
(Def::Union(..), _) |
(Def::Variant(..), _) |
(Def::VariantCtor(_, CtorKind::Fictive), _) if ns == ValueNS => {
err.span_label(span, format!("did you mean `{} {{ /* fields */ }}`?",
path_str));
return (err, candidates);
}
(Def::SelfTy(..), _) if ns == ValueNS => {
err.span_label(span, fallback_label);
err.note("can't use `Self` as a constructor, you must use the \
implemented struct");
return (err, candidates);
}
(Def::TyAlias(_), _) if ns == ValueNS => {
(Def::TyAlias(_), _) | (Def::AssociatedTy(..), _) if ns == ValueNS => {
err.note("can't use a type alias as a constructor");
return (err, candidates);
}
Expand Down

0 comments on commit 0674050

Please sign in to comment.