summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/new-solver/equating-projection-cyclically.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/traits/new-solver/equating-projection-cyclically.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/traits/new-solver/equating-projection-cyclically.rs')
-rw-r--r--tests/ui/traits/new-solver/equating-projection-cyclically.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/ui/traits/new-solver/equating-projection-cyclically.rs b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
index 019c6e81c..2668da1b7 100644
--- a/tests/ui/traits/new-solver/equating-projection-cyclically.rs
+++ b/tests/ui/traits/new-solver/equating-projection-cyclically.rs
@@ -1,11 +1,10 @@
// compile-flags: -Ztrait-solver=next
-// known-bug: unknown
trait Test {
type Assoc;
}
-fn transform<T: Test>(x: T) -> T::Assoc {
+fn transform<T: Test>(x: Inv<T>) -> Inv<T::Assoc> {
todo!()
}
@@ -17,8 +16,13 @@ impl Test for String {
type Assoc = String;
}
+struct Inv<T>(Option<*mut T>);
+
fn main() {
- let mut x = Default::default();
+ let mut x: Inv<_> = Inv(None);
+ // This ends up equating `Inv<?x>` with `Inv<<?x as Test>::Assoc>`
+ // which fails the occurs check when generalizing `?x`.
x = transform(x);
- x = 1i32;
+ //~^ ERROR mismatched types
+ x = Inv::<i32>(None);
}