Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add incremental test for changing struct name in assoc type. #101451

Merged
merged 1 commit into from
Sep 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/test/incremental/issue-100521-change-struct-name-assocty.rs
Original file line number Diff line number Diff line change
@@ -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() {}