mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Collect fulfillment errors across impls
This commit is contained in:
parent
569ca2bad0
commit
00b976a138
@ -2261,9 +2261,9 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
|
||||
ocx.register_obligations(impl_obligations);
|
||||
|
||||
let errors = ocx.select_where_possible();
|
||||
let mut errors = ocx.select_where_possible();
|
||||
if !errors.is_empty() {
|
||||
fulfillment_errors = errors;
|
||||
fulfillment_errors.append(&mut errors);
|
||||
return None;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,20 @@
|
||||
#![feature(inherent_associated_types)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
struct S<A, B>(A, B);
|
||||
struct Featureless;
|
||||
|
||||
trait One {}
|
||||
trait Two {}
|
||||
|
||||
impl<T: One> S<Featureless, T> {
|
||||
type X = ();
|
||||
}
|
||||
|
||||
impl<T: Two> S<T, Featureless> {
|
||||
type X = String;
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let _: S::<Featureless, Featureless>::X; //~ ERROR the associated type `X` exists for `S<Featureless, Featureless>`, but its trait bounds were not satisfied
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
error: the associated type `X` exists for `S<Featureless, Featureless>`, but its trait bounds were not satisfied
|
||||
--> $DIR/not-found-unsatisfied-bounds-in-multiple-impls.rs:19:43
|
||||
|
|
||||
LL | struct S<A, B>(A, B);
|
||||
| -------------- associated item `X` not found for this struct
|
||||
LL | struct Featureless;
|
||||
| ------------------
|
||||
| |
|
||||
| doesn't satisfy `Featureless: One`
|
||||
| doesn't satisfy `Featureless: Two`
|
||||
...
|
||||
LL | let _: S::<Featureless, Featureless>::X;
|
||||
| ^ associated type cannot be referenced on `S<Featureless, Featureless>` due to unsatisfied trait bounds
|
||||
|
|
||||
= note: the following trait bounds were not satisfied:
|
||||
`Featureless: One`
|
||||
`Featureless: Two`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
Loading…
Reference in New Issue
Block a user