diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-24 15:29:57 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2019-03-24 17:36:43 +0300 |
| commit | 5bcf9f4f119b8109c6c642dcfeb63fb39c26950a (patch) | |
| tree | e2672ad513173d8ad73ee42754b3d178936331ab /src/librustc/ty | |
| parent | 7f5a8dcdb95b07234d323cad8492bef96f2bee1b (diff) | |
| download | rust-5bcf9f4f119b8109c6c642dcfeb63fb39c26950a.tar.gz rust-5bcf9f4f119b8109c6c642dcfeb63fb39c26950a.zip | |
Slightly more uniform treatment of struct and variant constructors
Diffstat (limited to 'src/librustc/ty')
| -rw-r--r-- | src/librustc/ty/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 10755a9c021..3ab3ae0c537 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2322,8 +2322,8 @@ impl<'a, 'gcx, 'tcx> AdtDef { pub fn variant_of_def(&self, def: Def) -> &VariantDef { match def { Def::Variant(vid) => self.variant_with_id(vid), - Def::Ctor(hir::CtorOf::Variant, cid, ..) => self.variant_with_ctor_id(cid), - Def::Struct(..) | Def::Ctor(..) | Def::Union(..) | + Def::Ctor(_, cid, ..) => self.variant_with_ctor_id(cid), + Def::Struct(..) | Def::Union(..) | Def::TyAlias(..) | Def::AssociatedTy(..) | Def::SelfTy(..) | Def::SelfCtor(..) => self.non_enum_variant(), _ => bug!("unexpected def {:?} in variant_of_def", def) |
