Skip to content

Commit 69f74df

Browse files
committed
Deny internal lints in librustc
1 parent dfcd1ef commit 69f74df

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/librustc/ich/hcx.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::session::Session;
99

1010
use std::cmp::Ord;
1111
use std::hash as std_hash;
12-
use std::collections::HashMap;
1312
use std::cell::RefCell;
1413

1514
use syntax::ast;
@@ -394,13 +393,12 @@ impl<'a> HashStable<StableHashingContext<'a>> for DelimSpan {
394393
}
395394
}
396395

397-
pub fn hash_stable_trait_impls<'a, 'gcx, W, R>(
396+
pub fn hash_stable_trait_impls<'a, 'gcx, W>(
398397
hcx: &mut StableHashingContext<'a>,
399398
hasher: &mut StableHasher<W>,
400399
blanket_impls: &[DefId],
401-
non_blanket_impls: &HashMap<fast_reject::SimplifiedType, Vec<DefId>, R>)
402-
where W: StableHasherResult,
403-
R: std_hash::BuildHasher,
400+
non_blanket_impls: &FxHashMap<fast_reject::SimplifiedType, Vec<DefId>>)
401+
where W: StableHasherResult
404402
{
405403
{
406404
let mut blanket_impls: SmallVec<[_; 8]> = blanket_impls

src/librustc/infer/error_reporting/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ use crate::hir::Node;
5656
use crate::middle::region;
5757
use crate::traits::{ObligationCause, ObligationCauseCode};
5858
use crate::ty::error::TypeError;
59-
use crate::ty::{self, subst::{Subst, SubstsRef}, Region, Ty, TyCtxt, TyKind, TypeFoldable};
59+
use crate::ty::{self, subst::{Subst, SubstsRef}, Region, Ty, TyCtxt, TypeFoldable};
6060
use errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
6161
use std::{cmp, fmt};
6262
use syntax_pos::{Pos, Span};
@@ -1094,14 +1094,14 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
10941094
(_, false, _) => {
10951095
if let Some(exp_found) = exp_found {
10961096
let (def_id, ret_ty) = match exp_found.found.sty {
1097-
TyKind::FnDef(def, _) => {
1097+
ty::FnDef(def, _) => {
10981098
(Some(def), Some(self.tcx.fn_sig(def).output()))
10991099
}
11001100
_ => (None, None),
11011101
};
11021102

11031103
let exp_is_struct = match exp_found.expected.sty {
1104-
TyKind::Adt(def, _) => def.is_struct(),
1104+
ty::Adt(def, _) => def.is_struct(),
11051105
_ => false,
11061106
};
11071107

@@ -1140,8 +1140,8 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11401140
diag: &mut DiagnosticBuilder<'tcx>,
11411141
) {
11421142
match (&exp_found.expected.sty, &exp_found.found.sty) {
1143-
(TyKind::Adt(exp_def, exp_substs), TyKind::Ref(_, found_ty, _)) => {
1144-
if let TyKind::Adt(found_def, found_substs) = found_ty.sty {
1143+
(ty::Adt(exp_def, exp_substs), ty::Ref(_, found_ty, _)) => {
1144+
if let ty::Adt(found_def, found_substs) = found_ty.sty {
11451145
let path_str = format!("{:?}", exp_def);
11461146
if exp_def == &found_def {
11471147
let opt_msg = "you can convert from `&Option<T>` to `Option<&T>` using \
@@ -1164,17 +1164,17 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11641164
let mut show_suggestion = true;
11651165
for (exp_ty, found_ty) in exp_substs.types().zip(found_substs.types()) {
11661166
match exp_ty.sty {
1167-
TyKind::Ref(_, exp_ty, _) => {
1167+
ty::Ref(_, exp_ty, _) => {
11681168
match (&exp_ty.sty, &found_ty.sty) {
1169-
(_, TyKind::Param(_)) |
1170-
(_, TyKind::Infer(_)) |
1171-
(TyKind::Param(_), _) |
1172-
(TyKind::Infer(_), _) => {}
1169+
(_, ty::Param(_)) |
1170+
(_, ty::Infer(_)) |
1171+
(ty::Param(_), _) |
1172+
(ty::Infer(_), _) => {}
11731173
_ if ty::TyS::same_type(exp_ty, found_ty) => {}
11741174
_ => show_suggestion = false,
11751175
};
11761176
}
1177-
TyKind::Param(_) | TyKind::Infer(_) => {}
1177+
ty::Param(_) | ty::Infer(_) => {}
11781178
_ => show_suggestion = false,
11791179
}
11801180
}

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3030

3131
#![deny(rust_2018_idioms)]
32+
#![cfg_attr(not(stage0), deny(internal))]
3233
#![allow(explicit_outlives_requirements)]
3334

3435
#![feature(arbitrary_self_types)]

src/librustc/mir/tcx.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a, 'gcx, 'tcx> PlaceTy<'tcx> {
3636
pub fn field_ty(self, tcx: TyCtxt<'a, 'gcx, 'tcx>, f: &Field) -> Ty<'tcx>
3737
{
3838
let answer = match self.ty.sty {
39-
ty::TyKind::Adt(adt_def, substs) => {
39+
ty::Adt(adt_def, substs) => {
4040
let variant_def = match self.variant_index {
4141
None => adt_def.non_enum_variant(),
4242
Some(variant_index) => {

src/librustc/ty/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![cfg_attr(not(stage0), allow(usage_of_ty_tykind))]
2+
13
pub use self::Variance::*;
24
pub use self::AssociatedItemContainer::*;
35
pub use self::BorrowKind::*;

src/librustc/util/common.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#![allow(non_camel_case_types)]
22

3-
use rustc_data_structures::sync::Lock;
3+
use rustc_data_structures::{fx::FxHashMap, sync::Lock};
44

55
use std::cell::{RefCell, Cell};
6-
use std::collections::HashMap;
76
use std::fmt::Debug;
8-
use std::hash::{Hash, BuildHasher};
7+
use std::hash::Hash;
98
use std::panic;
109
use std::env;
1110
use std::time::{Duration, Instant};
@@ -341,8 +340,8 @@ pub trait MemoizationMap {
341340
where OP: FnOnce() -> Self::Value;
342341
}
343342

344-
impl<K, V, S> MemoizationMap for RefCell<HashMap<K,V,S>>
345-
where K: Hash+Eq+Clone, V: Clone, S: BuildHasher
343+
impl<K, V> MemoizationMap for RefCell<FxHashMap<K,V>>
344+
where K: Hash+Eq+Clone, V: Clone
346345
{
347346
type Key = K;
348347
type Value = V;

0 commit comments

Comments
 (0)