@@ -44,9 +44,8 @@ use hir;
44
44
use hir:: map:: Definitions ;
45
45
use hir:: map:: definitions:: DefPathData ;
46
46
use hir:: def_id:: { DefIndex , DefId } ;
47
- use hir:: def:: { Def , CtorKind , PathResolution } ;
47
+ use hir:: def:: { Def , PathResolution } ;
48
48
use session:: Session ;
49
- use lint;
50
49
51
50
use std:: collections:: BTreeMap ;
52
51
use std:: iter;
@@ -857,22 +856,8 @@ impl<'a> LoweringContext<'a> {
857
856
}
858
857
PatKind :: Lit ( ref e) => hir:: PatKind :: Lit ( self . lower_expr ( e) ) ,
859
858
PatKind :: TupleStruct ( ref path, ref pats, ddpos) => {
860
- match self . resolver . get_resolution ( p. id ) . map ( |d| d. base_def ) {
861
- Some ( def @ Def :: StructCtor ( _, CtorKind :: Const ) ) |
862
- Some ( def @ Def :: VariantCtor ( _, CtorKind :: Const ) ) => {
863
- // Temporarily lower `UnitVariant(..)` into `UnitVariant`
864
- // for backward compatibility.
865
- let msg = format ! ( "expected tuple struct/variant, found {} `{}`" ,
866
- def. kind_name( ) , path) ;
867
- self . sess . add_lint (
868
- lint:: builtin:: MATCH_OF_UNIT_VARIANT_VIA_PAREN_DOTDOT ,
869
- p. id , p. span , msg
870
- ) ;
871
- hir:: PatKind :: Path ( None , self . lower_path ( path) )
872
- }
873
- _ => hir:: PatKind :: TupleStruct ( self . lower_path ( path) ,
859
+ hir:: PatKind :: TupleStruct ( self . lower_path ( path) ,
874
860
pats. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) , ddpos)
875
- }
876
861
}
877
862
PatKind :: Path ( ref opt_qself, ref path) => {
878
863
let opt_qself = opt_qself. as_ref ( ) . map ( |qself| {
0 commit comments