diff options
| author | bors <bors@rust-lang.org> | 2021-07-20 05:34:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-20 05:34:22 +0000 |
| commit | a72c360a30f9a8160e4f40340cecc9b1ce979cd7 (patch) | |
| tree | 4790248c6db5f17be54ef0d785e5fa4260f0bf05 /compiler/rustc_trait_selection | |
| parent | c9aa2595d9ba2313bbfcc8e0244231baa9c5d9e0 (diff) | |
| parent | 3e857f5743295bf81380e45467372ab45f322e1c (diff) | |
| download | rust-a72c360a30f9a8160e4f40340cecc9b1ce979cd7.tar.gz rust-a72c360a30f9a8160e4f40340cecc9b1ce979cd7.zip | |
Auto merge of #87141 - spastorino:remove_impl_trait_in_bindings, r=oli-obk
Remove impl trait in bindings Closes #86729 r? `@oli-obk`
Diffstat (limited to 'compiler/rustc_trait_selection')
| -rw-r--r-- | compiler/rustc_trait_selection/src/opaque_types.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/structural_match.rs | 6 |
2 files changed, 3 insertions, 9 deletions
diff --git a/compiler/rustc_trait_selection/src/opaque_types.rs b/compiler/rustc_trait_selection/src/opaque_types.rs index cc98cd72566..39013a317fd 100644 --- a/compiler/rustc_trait_selection/src/opaque_types.rs +++ b/compiler/rustc_trait_selection/src/opaque_types.rs @@ -402,9 +402,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { } // These opaque type inherit all lifetime parameters from their // parent, so we have to check them all. - hir::OpaqueTyOrigin::Binding - | hir::OpaqueTyOrigin::TyAlias - | hir::OpaqueTyOrigin::Misc => 0, + hir::OpaqueTyOrigin::TyAlias => 0, }; let span = tcx.def_span(def_id); @@ -996,7 +994,7 @@ impl<'a, 'tcx> Instantiator<'a, 'tcx> { may_define_opaque_type(tcx, self.parent_def_id, opaque_hir_id), origin, ), - _ => (def_scope_default(), hir::OpaqueTyOrigin::Misc), + _ => (def_scope_default(), hir::OpaqueTyOrigin::TyAlias), }; if in_definition_scope { let opaque_type_key = diff --git a/compiler/rustc_trait_selection/src/traits/structural_match.rs b/compiler/rustc_trait_selection/src/traits/structural_match.rs index 3d20a8d5cf3..a6323a65aad 100644 --- a/compiler/rustc_trait_selection/src/traits/structural_match.rs +++ b/compiler/rustc_trait_selection/src/traits/structural_match.rs @@ -19,7 +19,6 @@ pub enum NonStructuralMatchTy<'tcx> { Opaque, Generator, Projection, - Closure, } /// This method traverses the structure of `ty`, trying to find an @@ -155,9 +154,6 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> { ty::Generator(..) | ty::GeneratorWitness(..) => { return ControlFlow::Break(NonStructuralMatchTy::Generator); } - ty::Closure(..) => { - return ControlFlow::Break(NonStructuralMatchTy::Closure); - } ty::RawPtr(..) => { // structural-match ignores substructure of // `*const _`/`*mut _`, so skip `super_visit_with`. @@ -198,7 +194,7 @@ impl<'a, 'tcx> TypeVisitor<'tcx> for Search<'a, 'tcx> { // First check all contained types and then tell the caller to continue searching. return ty.super_visit_with(self); } - ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => { + ty::Closure(..) | ty::Infer(_) | ty::Placeholder(_) | ty::Bound(..) => { bug!("unexpected type during structural-match checking: {:?}", ty); } ty::Error(_) => { |
