Skip to content

Commit 61c4b7f

Browse files
committed
Hide some follow-up errors
1 parent aebe8a7 commit 61c4b7f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

compiler/rustc_hir_analysis/src/impl_wf_check.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ fn enforce_impl_params_are_constrained(
8686
let impl_predicates = tcx.predicates_of(impl_def_id);
8787
let impl_trait_ref = tcx.impl_trait_ref(impl_def_id).map(ty::EarlyBinder::instantiate_identity);
8888

89+
impl_trait_ref.error_reported()?;
90+
8991
let mut input_parameters = cgp::parameters_for_impl(tcx, impl_self_ty, impl_trait_ref);
9092
cgp::identify_constrained_generic_params(
9193
tcx,

tests/ui/traits/issue-78372.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {}
5555
= help: add `#![feature(dispatch_from_dyn)]` to the crate attributes to enable
5656
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
5757

58-
error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion between structures
59-
--> $DIR/issue-78372.rs:3:1
60-
|
61-
LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {}
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63-
6458
error[E0038]: the trait `Foo` cannot be made into an object
6559
--> $DIR/issue-78372.rs:12:17
6660
|
@@ -88,6 +82,12 @@ LL | fn foo(self: Smaht<Self, T>);
8882
= note: type of `self` must be `Self` or a type that dereferences to it
8983
= help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
9084

85+
error[E0378]: the trait `DispatchFromDyn` may only be implemented for a coercion between structures
86+
--> $DIR/issue-78372.rs:3:1
87+
|
88+
LL | impl<T> DispatchFromDyn<Smaht<U, MISC>> for T {}
89+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
90+
9191
error: aborting due to 8 previous errors
9292

9393
Some errors have detailed explanations: E0038, E0307, E0378, E0412, E0658.

0 commit comments

Comments
 (0)