From dc050f6d5bb1cb9d7529b6d9881ad99d8ce6a20d Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 22 Jan 2024 19:33:45 +0000 Subject: [PATCH] Add a test --- .../normalize-region-obligations.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/ui/traits/next-solver/normalize-region-obligations.rs diff --git a/tests/ui/traits/next-solver/normalize-region-obligations.rs b/tests/ui/traits/next-solver/normalize-region-obligations.rs new file mode 100644 index 00000000000..13c86b630f6 --- /dev/null +++ b/tests/ui/traits/next-solver/normalize-region-obligations.rs @@ -0,0 +1,22 @@ +// revisions: normalize_param_env normalize_obligation +// check-pass +// compile-flags: -Znext-solver + +trait Foo { + #[cfg(normalize_param_env)] + type Gat<'a> where ::Assoc: 'a; + #[cfg(normalize_obligation)] + type Gat<'a> where Self: 'a; +} + +trait Mirror { type Assoc: ?Sized; } +impl Mirror for T { type Assoc = T; } + +impl Foo for T { + #[cfg(normalize_param_env)] + type Gat<'a> = i32 where T: 'a; + #[cfg(normalize_obligation)] + type Gat<'a> = i32 where ::Assoc: 'a; +} + +fn main() {}