diff options
| author | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-12 11:27:08 +0000 |
|---|---|---|
| committer | Oli Scherer <github35764891676564198441@oli-obk.de> | 2021-03-15 17:33:28 +0000 |
| commit | cdbb0ff8ca7d6a4d6d858e03ffcc5360ddf60a3f (patch) | |
| tree | 8cd6349512918ad6e4cae00502f9fd63f018dd49 /compiler/rustc_trait_selection/src | |
| parent | 3abdb08351d7c944e1dfab72a06fe5074b2bc227 (diff) | |
| download | rust-cdbb0ff8ca7d6a4d6d858e03ffcc5360ddf60a3f.tar.gz rust-cdbb0ff8ca7d6a4d6d858e03ffcc5360ddf60a3f.zip | |
Special case type aliases from impl trait in const/static types
Diffstat (limited to 'compiler/rustc_trait_selection/src')
| -rw-r--r-- | compiler/rustc_trait_selection/src/opaque_types.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/opaque_types.rs b/compiler/rustc_trait_selection/src/opaque_types.rs index 25ba489032b..d6a585e626c 100644 --- a/compiler/rustc_trait_selection/src/opaque_types.rs +++ b/compiler/rustc_trait_selection/src/opaque_types.rs @@ -422,7 +422,9 @@ 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::Misc => 0, + hir::OpaqueTyOrigin::Binding + | hir::OpaqueTyOrigin::TyAlias + | hir::OpaqueTyOrigin::Misc => 0, }; let span = tcx.def_span(def_id); @@ -581,6 +583,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // Otherwise, generate the label we'll use in the error message. hir::OpaqueTyOrigin::Binding | hir::OpaqueTyOrigin::FnReturn + | hir::OpaqueTyOrigin::TyAlias | hir::OpaqueTyOrigin::Misc => "impl Trait", }; let msg = format!("ambiguous lifetime bound in `{}`", context_name); |
