diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-09-05 15:51:34 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-09-05 20:11:34 +0200 |
| commit | fdf56cfc7c4101e31eaf969eaceda78a51f84fa7 (patch) | |
| tree | 94c10f6fb2dfdec7703c6cf4355e2a440548aadf | |
| parent | 84f0c3f79a85329dd79a54694ff8a7f427c842e9 (diff) | |
| download | rust-fdf56cfc7c4101e31eaf969eaceda78a51f84fa7.tar.gz rust-fdf56cfc7c4101e31eaf969eaceda78a51f84fa7.zip | |
Add test.
| -rw-r--r-- | src/test/incremental/issue-100521-change-struct-name-assocty.rs | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/test/incremental/issue-100521-change-struct-name-assocty.rs b/src/test/incremental/issue-100521-change-struct-name-assocty.rs new file mode 100644 index 00000000000..7f8d1e60881 --- /dev/null +++ b/src/test/incremental/issue-100521-change-struct-name-assocty.rs @@ -0,0 +1,65 @@ +// revisions: rpass1 rpass2 + +pub fn foo() { + bar(); + baz::<()>(); +} + +fn bar() +where + <() as Table>::AllColumns:, +{ +} + +fn baz<W>() +where + W: AsQuery, + <W as AsQuery>::Query:, +{ +} + +trait AsQuery { + type Query; +} + +trait UnimplementedTrait {} + +impl<T> AsQuery for T +where + T: UnimplementedTrait, +{ + type Query = (); +} + +struct Wrapper<Expr>(Expr); + +impl<Ret> AsQuery for Wrapper<Ret> { + type Query = (); +} + +impl AsQuery for () +where + Wrapper<<() as Table>::AllColumns>: AsQuery, +{ + type Query = (); +} + +trait Table { + type AllColumns; +} + +#[cfg(rpass1)] +impl Table for () { + type AllColumns = Checksum1; +} +#[cfg(rpass1)] +struct Checksum1; + +#[cfg(rpass2)] +impl Table for () { + type AllColumns = Checksum2; +} +#[cfg(rpass2)] +struct Checksum2; + +fn main() {} |
