diff options
| author | Ellen <supbscripter@gmail.com> | 2022-01-12 03:19:52 +0000 | 
|---|---|---|
| committer | Ellen <supbscripter@gmail.com> | 2022-01-15 01:16:55 +0000 | 
| commit | 71bbb603f4108bc1f0bc8c8395ec725bb66e7802 (patch) | |
| tree | 668ba88d044cebf908cedfcd9a3479f401fa86f3 /compiler/rustc_lint | |
| parent | b0ec3e09a996f2cb35be7710fd1003c3c38f1667 (diff) | |
| download | rust-71bbb603f4108bc1f0bc8c8395ec725bb66e7802.tar.gz rust-71bbb603f4108bc1f0bc8c8395ec725bb66e7802.zip  | |
initial revert
Diffstat (limited to 'compiler/rustc_lint')
| -rw-r--r-- | compiler/rustc_lint/src/builtin.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/enum_intrinsics_non_enums.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/noop_method_call.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/types.rs | 3 | 
4 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index c0384875a47..43389a2b077 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -152,8 +152,8 @@ declare_lint! { declare_lint_pass!(BoxPointers => [BOX_POINTERS]); impl BoxPointers { - fn check_heap_type<'tcx>(&self, cx: &LateContext<'tcx>, span: Span, ty: Ty<'tcx>) { - for leaf in ty.walk(cx.tcx) { + fn check_heap_type(&self, cx: &LateContext<'_>, span: Span, ty: Ty<'_>) { + for leaf in ty.walk() { if let GenericArgKind::Type(leaf_ty) = leaf.unpack() { if leaf_ty.is_box() { cx.struct_span_lint(BOX_POINTERS, span, |lint| { @@ -1663,7 +1663,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints { ConstEquate(..) | TypeWellFormedFromEnv(..) => continue, }; - if predicate.is_global(cx.tcx) { + if predicate.is_global() { cx.struct_span_lint(TRIVIAL_BOUNDS, span, |lint| { lint.build(&format!( "{} bound {} does not depend on any type \ diff --git a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs index 65772d02376..c5e15a88fdf 100644 --- a/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs +++ b/compiler/rustc_lint/src/enum_intrinsics_non_enums.rs @@ -38,7 +38,7 @@ declare_lint_pass!(EnumIntrinsicsNonEnums => [ENUM_INTRINSICS_NON_ENUMS]); /// Returns `true` if we know for sure that the given type is not an enum. Note that for cases where /// the type is generic, we can't be certain if it will be an enum so we have to assume that it is. fn is_non_enum(t: Ty<'_>) -> bool { - !t.is_enum() && !t.potentially_needs_subst() + !t.is_enum() && !t.needs_subst() } fn enforce_mem_discriminant( diff --git a/compiler/rustc_lint/src/noop_method_call.rs b/compiler/rustc_lint/src/noop_method_call.rs index 600504f7c12..4bcd4c6d603 100644 --- a/compiler/rustc_lint/src/noop_method_call.rs +++ b/compiler/rustc_lint/src/noop_method_call.rs @@ -62,7 +62,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall { _ => return, }; let substs = cx.typeck_results().node_substs(expr.hir_id); - if substs.definitely_needs_subst(cx.tcx) { + if substs.needs_subst() { // We can't resolve on types that require monomorphization, so we don't handle them if // we need to perfom substitution. return; diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs index 32ed6dad7f8..1acff13d1aa 100644 --- a/compiler/rustc_lint/src/types.rs +++ b/compiler/rustc_lint/src/types.rs @@ -1175,9 +1175,6 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { impl<'a, 'tcx> ty::fold::TypeVisitor<'tcx> for ProhibitOpaqueTypes<'a, 'tcx> { type BreakTy = Ty<'tcx>; - fn tcx_for_anon_const_substs(&self) -> Option<TyCtxt<'tcx>> { - Some(self.cx.tcx) - } fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> { match ty.kind() {  | 
