Skip to content

Commit c124cd5

Browse files
committed
Auto merge of #29870 - petrochenkov:typaren, r=nrc
Like nrc@d21bfff, but for the type grammar. r? @nrc
2 parents 3037b29 + 4a85015 commit c124cd5

File tree

8 files changed

+4
-13
lines changed

8 files changed

+4
-13
lines changed

src/librustc/middle/infer/error_reporting.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,6 @@ impl<'a, 'tcx> Rebuilder<'a, 'tcx> {
14441444
hir::TyTup(tys) => {
14451445
hir::TyTup(tys.into_iter().map(|ty| build_to(ty, to)).collect())
14461446
}
1447-
hir::TyParen(typ) => hir::TyParen(build_to(typ, to)),
14481447
other => other
14491448
};
14501449
hir::Ty { id: id, node: new_node, span: span }

src/librustc_front/fold.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ pub fn noop_fold_ty<T: Folder>(t: P<Ty>, fld: &mut T) -> P<Ty> {
382382
}))
383383
}
384384
TyTup(tys) => TyTup(tys.move_map(|ty| fld.fold_ty(ty))),
385-
TyParen(ty) => TyParen(fld.fold_ty(ty)),
386385
TyPath(qself, path) => {
387386
let qself = qself.map(|QSelf { ty, position }| {
388387
QSelf {

src/librustc_front/hir.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,6 @@ pub enum Ty_ {
848848
TyObjectSum(P<Ty>, TyParamBounds),
849849
/// A type like `for<'a> Foo<&'a Bar>`
850850
TyPolyTraitRef(TyParamBounds),
851-
/// No-op; kept solely so that we can pretty-print faithfully
852-
TyParen(P<Ty>),
853851
/// Unused for now
854852
TyTypeof(P<Expr>),
855853
/// TyInfer means the type should be inferred instead of it having been

src/librustc_front/lowering.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ pub fn lower_ty(_lctx: &LoweringContext, t: &Ty) -> P<hir::Ty> {
225225
}))
226226
}
227227
TyTup(ref tys) => hir::TyTup(tys.iter().map(|ty| lower_ty(_lctx, ty)).collect()),
228-
TyParen(ref ty) => hir::TyParen(lower_ty(_lctx, ty)),
228+
TyParen(ref ty) => {
229+
return lower_ty(_lctx, ty);
230+
}
229231
TyPath(ref qself, ref path) => {
230232
let qself = qself.as_ref().map(|&QSelf { ref ty, position }| {
231233
hir::QSelf {

src/librustc_front/print/pprust.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -506,11 +506,6 @@ impl<'a> State<'a> {
506506
}
507507
try!(self.pclose());
508508
}
509-
hir::TyParen(ref typ) => {
510-
try!(self.popen());
511-
try!(self.print_type(&**typ));
512-
try!(self.pclose());
513-
}
514509
hir::TyBareFn(ref f) => {
515510
let generics = hir::Generics {
516511
lifetimes: f.lifetimes.clone(),

src/librustc_front/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ pub fn walk_variant<'v, V: Visitor<'v>>(visitor: &mut V,
349349

350350
pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
351351
match typ.node {
352-
TyVec(ref ty) | TyParen(ref ty) => {
352+
TyVec(ref ty) => {
353353
visitor.visit_ty(ty)
354354
}
355355
TyPtr(ref mutable_type) => {

src/librustc_typeck/astconv.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,6 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx>,
16241624
.collect();
16251625
tcx.mk_tup(flds)
16261626
}
1627-
hir::TyParen(ref typ) => ast_ty_to_ty(this, rscope, &**typ),
16281627
hir::TyBareFn(ref bf) => {
16291628
require_c_abi_if_variadic(tcx, &bf.decl, bf.abi, ast_ty.span);
16301629
let bare_fn = ty_of_bare_fn(this, bf.unsafety, bf.abi, &*bf.decl);

src/librustdoc/clean/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1606,7 +1606,6 @@ impl Clean<Type> for hir::Ty {
16061606
}
16071607
}
16081608
TyBareFn(ref barefn) => BareFunction(box barefn.clean(cx)),
1609-
TyParen(ref ty) => ty.clean(cx),
16101609
TyPolyTraitRef(ref bounds) => {
16111610
PolyTraitRef(bounds.clean(cx))
16121611
},

0 commit comments

Comments
 (0)