forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#88312 - jackh726:issue-87748, r=nikomatsakis
Treat types in unnormalized function signatures as well-formed Fixes rust-lang#87748 r? `@nikomatsakis`
- Loading branch information
Showing
6 changed files
with
90 additions
and
9 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
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
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,30 @@ | ||
// Checks that we properly add implied bounds from unnormalized projections in | ||
// inputs when typechecking functions. | ||
|
||
// check-pass | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
trait MyTrait { | ||
type Assoc<'a, 'b> where 'b: 'a; | ||
fn do_sth(arg: Self::Assoc<'_, '_>); | ||
} | ||
|
||
struct A; | ||
struct B; | ||
struct C; | ||
|
||
impl MyTrait for A { | ||
type Assoc<'a, 'b> where 'b: 'a = u32; | ||
fn do_sth(_: u32) {} | ||
} | ||
impl MyTrait for B { | ||
type Assoc<'a, 'b> where 'b: 'a = u32; | ||
fn do_sth(_: Self::Assoc<'_, '_>) {} | ||
} | ||
impl MyTrait for C { | ||
type Assoc<'a, 'b> where 'b: 'a = u32; | ||
fn do_sth(_: Self::Assoc<'static, 'static>) {} | ||
} | ||
|
||
fn main () {} |