From 4d2a3bb13bb04d3ad6c0a3add4883c64200fa96c Mon Sep 17 00:00:00 2001 From: flip1995 Date: Mon, 1 Apr 2019 00:10:48 +0200 Subject: [PATCH] Deny internal lints on librustc_typeck --- src/librustc_typeck/astconv.rs | 1 + src/librustc_typeck/check/wfcheck.rs | 4 ++-- src/librustc_typeck/lib.rs | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index fba4414c127..fba6a607eef 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -102,6 +102,7 @@ enum GenericArgPosition { /// Dummy type used for the `Self` of a `TraitRef` created for converting /// a trait object, and which gets removed in `ExistentialTraitRef`. /// This type must not appear anywhere in other converted types. +#[cfg_attr(not(stage0), allow(usage_of_ty_tykind))] const TRAIT_OBJECT_DUMMY_SELF: ty::TyKind<'static> = ty::Infer(ty::FreshTy(0)); impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o { diff --git a/src/librustc_typeck/check/wfcheck.rs b/src/librustc_typeck/check/wfcheck.rs index 3579810b8d7..d108e7c3107 100644 --- a/src/librustc_typeck/check/wfcheck.rs +++ b/src/librustc_typeck/check/wfcheck.rs @@ -3,7 +3,7 @@ use crate::hir::def_id::DefId; use rustc::traits::{self, ObligationCauseCode}; -use rustc::ty::{self, Lift, Ty, TyCtxt, TyKind, GenericParamDefKind, TypeFoldable, ToPredicate}; +use rustc::ty::{self, Lift, Ty, TyCtxt, GenericParamDefKind, TypeFoldable, ToPredicate}; use rustc::ty::subst::{Subst, InternalSubsts}; use rustc::util::nodemap::{FxHashSet, FxHashMap}; use rustc::mir::interpret::ConstValue; @@ -354,7 +354,7 @@ fn check_item_type<'a, 'tcx>( let mut forbid_unsized = true; if allow_foreign_ty { - if let TyKind::Foreign(_) = fcx.tcx.struct_tail(item_ty).sty { + if let ty::Foreign(_) = fcx.tcx.struct_tail(item_ty).sty { forbid_unsized = false; } } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 1fa16352b86..4a7b1e67366 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -71,6 +71,7 @@ #![recursion_limit="256"] #![deny(rust_2018_idioms)] +#![cfg_attr(not(stage0), deny(internal))] #![allow(explicit_outlives_requirements)] #[macro_use] extern crate log; -- 2.44.0