-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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 #102947 - compiler-errors:sort-elaborated-existential…
…s, r=cjgillot Sort elaborated existential predicates in `object_ty_for_trait` r? `@cjgillot` I think that #102845 caused #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 #102933 Fixes #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!(); | ||
} |