diff options
| author | bors <bors@rust-lang.org> | 2022-01-16 17:22:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-16 17:22:57 +0000 |
| commit | bd3cb52565faab2755ff1bdb54d88bc91f47b4b9 (patch) | |
| tree | 62cae2960feaabe7d5bd0362032102cd48621b3d /compiler/rustc_lint/src/internal.rs | |
| parent | 48e89b00caa94829a5f07e0f1ecb33bf37431244 (diff) | |
| parent | 2b6b49e1d7f1d818b48dbbca11c49f672e25e6ca (diff) | |
| download | rust-bd3cb52565faab2755ff1bdb54d88bc91f47b4b9.tar.gz rust-bd3cb52565faab2755ff1bdb54d88bc91f47b4b9.zip | |
Auto merge of #92970 - matthiaskrgr:rollup-tcx7cfb, r=matthiaskrgr
Rollup of 10 pull requests
Successful merges:
- #92487 (Fix unclosed boxes in pretty printing of TraitAlias)
- #92581 (ARMv6K Horizon - Enable default libraries)
- #92619 (Add diagnostic items for macros)
- #92635 (rustdoc: Yet more intra-doc links cleanup)
- #92646 (feat: rustc_pass_by_value lint attribute)
- #92706 (Clarify explicitly that BTree{Map,Set} are ordered.)
- #92710 (Include Projections when elaborating TypeOutlives)
- #92746 (Parse `Ty?` as `Option<Ty>` and provide structured suggestion)
- #92792 (rustdoc: fix intra-link for generic trait impls)
- #92814 (remove unused FIXME)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_lint/src/internal.rs')
| -rw-r--r-- | compiler/rustc_lint/src/internal.rs | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/compiler/rustc_lint/src/internal.rs b/compiler/rustc_lint/src/internal.rs index c64a67b6b9f..7353cd6b876 100644 --- a/compiler/rustc_lint/src/internal.rs +++ b/compiler/rustc_lint/src/internal.rs @@ -5,10 +5,7 @@ use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext} use rustc_ast as ast; use rustc_errors::Applicability; use rustc_hir::def::Res; -use rustc_hir::{ - GenericArg, HirId, Item, ItemKind, MutTy, Mutability, Node, Path, PathSegment, QPath, Ty, - TyKind, -}; +use rustc_hir::{GenericArg, HirId, Item, ItemKind, Node, Path, PathSegment, QPath, Ty, TyKind}; use rustc_middle::ty; use rustc_session::{declare_lint_pass, declare_tool_lint}; use rustc_span::hygiene::{ExpnKind, MacroKind}; @@ -59,13 +56,6 @@ declare_tool_lint! { } declare_tool_lint! { - pub rustc::TY_PASS_BY_REFERENCE, - Allow, - "passing `Ty` or `TyCtxt` by reference", - report_in_external_macro: true -} - -declare_tool_lint! { pub rustc::USAGE_OF_QUALIFIED_TY, Allow, "using `ty::{Ty,TyCtxt}` instead of importing it", @@ -74,7 +64,6 @@ declare_tool_lint! { declare_lint_pass!(TyTyKind => [ USAGE_OF_TY_TYKIND, - TY_PASS_BY_REFERENCE, USAGE_OF_QUALIFIED_TY, ]); @@ -131,26 +120,6 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind { } } } - TyKind::Rptr(_, MutTy { ty: inner_ty, mutbl: Mutability::Not }) => { - if let Some(impl_did) = cx.tcx.impl_of_method(ty.hir_id.owner.to_def_id()) { - if cx.tcx.impl_trait_ref(impl_did).is_some() { - return; - } - } - if let Some(t) = is_ty_or_ty_ctxt(cx, &inner_ty) { - cx.struct_span_lint(TY_PASS_BY_REFERENCE, ty.span, |lint| { - lint.build(&format!("passing `{}` by reference", t)) - .span_suggestion( - ty.span, - "try passing by value", - t, - // Changing type of function argument - Applicability::MaybeIncorrect, - ) - .emit(); - }) - } - } _ => {} } } |
