forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#102947 - compiler-errors:sort-elaborated-ex…
…istentials, r=cjgillot Sort elaborated existential predicates in `object_ty_for_trait` r? `@cjgillot` I think that rust-lang#102845 caused rust-lang#102933. Depending on the order that we elaborate these existential projection predicates, there's no guarantee that they'll be sorted by def id, which is what is failing the assertion in the issue. Fixes rust-lang#102933 Fixes rust-lang#102973
- Loading branch information
Showing
2 changed files
with
43 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// check-pass | ||
|
||
use std::future::Future; | ||
|
||
pub trait Service { | ||
type Response; | ||
type Future: Future<Output = Self::Response>; | ||
} | ||
|
||
pub trait A1: Service<Response = i32> {} | ||
|
||
pub trait A2: Service<Future = Box<dyn Future<Output = i32>>> + A1 { | ||
fn foo(&self) {} | ||
} | ||
|
||
pub trait B1: Service<Future = Box<dyn Future<Output = i32>>> {} | ||
|
||
pub trait B2: Service<Response = i32> + B1 { | ||
fn foo(&self) {} | ||
} | ||
|
||
fn main() { | ||
let x: &dyn A2 = todo!(); | ||
let x: &dyn B2 = todo!(); | ||
} |