-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5767cad
commit 7fb27e4
Showing
2 changed files
with
51 additions
and
6 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
18 changes: 18 additions & 0 deletions
18
tests/ui/traits/new-solver/trait-upcast-lhs-needs-normalization.rs
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,18 @@ | ||
// check-pass | ||
// compile-flags: -Ztrait-solver=next | ||
|
||
pub trait A {} | ||
pub trait B: A {} | ||
|
||
pub trait Mirror { | ||
type Assoc: ?Sized; | ||
} | ||
impl<T: ?Sized> Mirror for T { | ||
type Assoc = T; | ||
} | ||
|
||
pub fn foo<'a>(x: &'a <dyn B + 'static as Mirror>::Assoc) -> &'a (dyn A + 'static) { | ||
x | ||
} | ||
|
||
fn main() {} |