File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments