File tree 1 file changed +9
-1
lines changed
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> {
2716
2716
}
2717
2717
return ( err, candidates) ;
2718
2718
}
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
+ }
2719
2726
( Def :: SelfTy ( ..) , _) if ns == ValueNS => {
2727
+ err. span_label ( span, fallback_label) ;
2720
2728
err. note ( "can't use `Self` as a constructor, you must use the \
2721
2729
implemented struct") ;
2722
2730
return ( err, candidates) ;
2723
2731
}
2724
- ( Def :: TyAlias ( _) , _) if ns == ValueNS => {
2732
+ ( Def :: TyAlias ( _) , _) | ( Def :: AssociatedTy ( .. ) , _ ) if ns == ValueNS => {
2725
2733
err. note ( "can't use a type alias as a constructor" ) ;
2726
2734
return ( err, candidates) ;
2727
2735
}
You can’t perform that action at this time.
0 commit comments