diff --git a/src/librustc/infer/canonical.rs b/src/librustc/infer/canonical.rs index 9519baa3ff7bc..4e0cf59e8a7fd 100644 --- a/src/librustc/infer/canonical.rs +++ b/src/librustc/infer/canonical.rs @@ -609,12 +609,6 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx> bug!("encountered a canonical type during canonicalization") } - // Replace a `()` that "would've fallen back" to `!` with just `()`. - ty::TyTuple(ref tys, true) => { - assert!(tys.is_empty()); - self.tcx().mk_nil() - } - ty::TyClosure(..) | ty::TyGenerator(..) | ty::TyGeneratorWitness(..) @@ -634,7 +628,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx> | ty::TyFnPtr(_) | ty::TyDynamic(..) | ty::TyNever - | ty::TyTuple(_, false) + | ty::TyTuple(..) | ty::TyProjection(..) | ty::TyForeign(..) | ty::TyParam(..) diff --git a/src/librustc/traits/query/dropck_outlives.rs b/src/librustc/traits/query/dropck_outlives.rs index 0fe4daa36ed4a..1caab6fd89ef9 100644 --- a/src/librustc/traits/query/dropck_outlives.rs +++ b/src/librustc/traits/query/dropck_outlives.rs @@ -236,7 +236,7 @@ fn trivial_dropck_outlives<'cx, 'tcx>(tcx: TyCtxt<'cx, '_, 'tcx>, ty: Ty<'tcx>) // (T1..Tn) and closures have same properties as T1..Tn -- // check if *any* of those are trivial. - ty::TyTuple(ref tys, _) => tys.iter().cloned().all(|t| trivial_dropck_outlives(tcx, t)), + ty::TyTuple(ref tys) => tys.iter().cloned().all(|t| trivial_dropck_outlives(tcx, t)), ty::TyClosure(def_id, ref substs) => substs .upvar_tys(def_id, tcx) .all(|t| trivial_dropck_outlives(tcx, t)), diff --git a/src/librustc_traits/dropck_outlives.rs b/src/librustc_traits/dropck_outlives.rs index 2274f3942bdbc..2a8cfe5cc06b3 100644 --- a/src/librustc_traits/dropck_outlives.rs +++ b/src/librustc_traits/dropck_outlives.rs @@ -184,7 +184,7 @@ fn dtorck_constraint_for_ty<'a, 'gcx, 'tcx>( dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ety) } - ty::TyTuple(tys, _) => tys.iter() + ty::TyTuple(tys) => tys.iter() .map(|ty| dtorck_constraint_for_ty(tcx, span, for_ty, depth + 1, ty)) .collect(), diff --git a/src/test/ui/feature-gate-never_type.stderr b/src/test/ui/feature-gate-never_type.stderr deleted file mode 100644 index 187be6d829137..0000000000000 --- a/src/test/ui/feature-gate-never_type.stderr +++ /dev/null @@ -1,43 +0,0 @@ -error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:17:17 - | -LL | type Ma = (u32, !, i32); //~ ERROR type is experimental - | ^ - | - = help: add #![feature(never_type)] to the crate attributes to enable - -error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:18:20 - | -LL | type Meeshka = Vec; //~ ERROR type is experimental - | ^ - | - = help: add #![feature(never_type)] to the crate attributes to enable - -error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:19:16 - | -LL | type Mow = &fn(!) -> !; //~ ERROR type is experimental - | ^ - | - = help: add #![feature(never_type)] to the crate attributes to enable - -error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:20:19 - | -LL | type Skwoz = &mut !; //~ ERROR type is experimental - | ^ - | - = help: add #![feature(never_type)] to the crate attributes to enable - -error[E0658]: The `!` type is experimental (see issue #35121) - --> $DIR/feature-gate-never_type.rs:23:16 - | -LL | type Wub = !; //~ ERROR type is experimental - | ^ - | - = help: add #![feature(never_type)] to the crate attributes to enable - -error: aborting due to 5 previous errors - -For more information about this error, try `rustc --explain E0658`.