Skip to content

Commit 526511e

Browse files
Appease clippy again
1 parent 55df920 commit 526511e

File tree

7 files changed

+16
-17
lines changed

7 files changed

+16
-17
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -1376,13 +1376,16 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13761376
ImplTraitContext::Disallowed(
13771377
position @ (ImplTraitPosition::TraitReturn | ImplTraitPosition::ImplReturn),
13781378
) => {
1379-
self.tcx.sess.create_feature_err(
1380-
MisplacedImplTrait {
1381-
span: t.span,
1382-
position: DiagnosticArgFromDisplay(&position),
1383-
},
1384-
sym::return_position_impl_trait_in_trait,
1385-
).emit();
1379+
self.tcx
1380+
.sess
1381+
.create_feature_err(
1382+
MisplacedImplTrait {
1383+
span: t.span,
1384+
position: DiagnosticArgFromDisplay(&position),
1385+
},
1386+
sym::return_position_impl_trait_in_trait,
1387+
)
1388+
.emit();
13861389
hir::TyKind::Err
13871390
}
13881391
ImplTraitContext::Disallowed(position) => {

src/tools/clippy/clippy_lints/src/dereference.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ fn binding_ty_auto_deref_stability<'tcx>(
959959
))
960960
.is_sized(cx.tcx.at(DUMMY_SP), cx.param_env.without_caller_bounds()),
961961
),
962-
TyKind::OpaqueDef(..) | TyKind::ImplTraitInTrait(..) | TyKind::Infer | TyKind::Typeof(..) | TyKind::TraitObject(..) | TyKind::Err => {
962+
TyKind::OpaqueDef(..) | TyKind::Infer | TyKind::Typeof(..) | TyKind::TraitObject(..) | TyKind::Err => {
963963
Position::ReborrowStable(precedence)
964964
},
965965
};

src/tools/clippy/clippy_lints/src/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> {
441441

442442
fn visit_ty(&mut self, ty: &'tcx Ty<'_>) {
443443
match ty.kind {
444-
TyKind::OpaqueDef(item, bounds) => {
444+
TyKind::OpaqueDef(item, bounds, _) => {
445445
let map = self.cx.tcx.hir();
446446
let item = map.item(item);
447447
let len = self.lts.len();

src/tools/clippy/clippy_lints/src/manual_async_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ fn future_trait_ref<'tcx>(
103103
ty: &'tcx Ty<'tcx>,
104104
) -> Option<(&'tcx TraitRef<'tcx>, Vec<LifetimeName>)> {
105105
if_chain! {
106-
if let TyKind::OpaqueDef(item_id, bounds) = ty.kind;
106+
if let TyKind::OpaqueDef(item_id, bounds, false) = ty.kind;
107107
let item = cx.tcx.hir().item(item_id);
108108
if let ItemKind::OpaqueTy(opaque) = &item.kind;
109109
if let Some(trait_ref) = opaque.bounds.iter().find_map(|bound| {

src/tools/clippy/clippy_lints/src/missing_doc.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {
147147
| hir::ItemKind::TraitAlias(..)
148148
| hir::ItemKind::TyAlias(..)
149149
| hir::ItemKind::Union(..)
150-
| hir::ItemKind::OpaqueTy(..)
151-
| hir::ItemKind::ImplTraitPlaceholder(..) => {},
150+
| hir::ItemKind::OpaqueTy(..) => {},
152151
hir::ItemKind::ExternCrate(..)
153152
| hir::ItemKind::ForeignMod { .. }
154153
| hir::ItemKind::GlobalAsm(..)

src/tools/clippy/clippy_lints/src/missing_inline.rs

-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline {
128128
| hir::ItemKind::TyAlias(..)
129129
| hir::ItemKind::Union(..)
130130
| hir::ItemKind::OpaqueTy(..)
131-
| hir::ItemKind::ImplTraitPlaceholder(..)
132131
| hir::ItemKind::ExternCrate(..)
133132
| hir::ItemKind::ForeignMod { .. }
134133
| hir::ItemKind::Impl { .. }

src/tools/clippy/clippy_utils/src/hir_utils.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -987,12 +987,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
987987
}
988988
},
989989
TyKind::Path(ref qpath) => self.hash_qpath(qpath),
990-
TyKind::OpaqueDef(_, arg_list) => {
990+
TyKind::OpaqueDef(_, arg_list, in_trait) => {
991991
self.hash_generic_args(arg_list);
992+
in_trait.hash(&mut self.s);
992993
},
993-
TyKind::ImplTraitInTrait(_) => {
994-
// Do nothing
995-
}
996994
TyKind::TraitObject(_, lifetime, _) => {
997995
self.hash_lifetime(*lifetime);
998996
},

0 commit comments

Comments
 (0)