From 7dae9ac852fbb51b8d658eb838f1993c6cafa178 Mon Sep 17 00:00:00 2001 From: lcnr Date: Tue, 26 Nov 2024 13:49:23 +0100 Subject: [PATCH] add test for alias-bound shadowing, rename folder --- .../alias-bound-shadowed-by-env.rs | 19 +++++++++++++++++++ .../ambig-env-no-shadow.rs | 0 .../discard-impls-shadowed-by-env-1.rs | 0 .../discard-impls-shadowed-by-env-2.rs | 0 .../discard-impls-shadowed-by-env-3.rs | 0 ...zes_to_ignores_unnormalizable_candidate.rs | 0 ...to_ignores_unnormalizable_candidate.stderr | 0 .../param-candidate-shadows-project.rs | 0 .../param-candidate-shadows-project.stderr | 0 .../param-env-impl-conflict.rs | 0 10 files changed, 19 insertions(+) create mode 100644 tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/ambig-env-no-shadow.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/discard-impls-shadowed-by-env-1.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/discard-impls-shadowed-by-env-2.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/discard-impls-shadowed-by-env-3.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/normalizes_to_ignores_unnormalizable_candidate.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/normalizes_to_ignores_unnormalizable_candidate.stderr (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/param-candidate-shadows-project.rs (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/param-candidate-shadows-project.stderr (100%) rename tests/ui/traits/next-solver/{env-shadows-impls => normalization-shadowing}/param-env-impl-conflict.rs (100%) diff --git a/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs b/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs new file mode 100644 index 00000000000..c0b169abcd5 --- /dev/null +++ b/tests/ui/traits/next-solver/normalization-shadowing/alias-bound-shadowed-by-env.rs @@ -0,0 +1,19 @@ +//@ compile-flags: -Znext-solver +//@ check-pass + +trait Super { + type Assoc; +} +trait Bound { + type Assoc: Super; +} +trait Trait: Super {} + +// Elaborating the environment results in a `T::Assoc: Super` where-bound. +// This where-bound must not prevent normalization via the `Super` +// item bound. +fn heck>(x: ::Assoc) -> u32 { + x +} + +fn main() {} diff --git a/tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs b/tests/ui/traits/next-solver/normalization-shadowing/ambig-env-no-shadow.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/ambig-env-no-shadow.rs rename to tests/ui/traits/next-solver/normalization-shadowing/ambig-env-no-shadow.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-1.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-1.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-1.rs rename to tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-1.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-2.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-2.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-2.rs rename to tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-2.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-3.rs b/tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-3.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/discard-impls-shadowed-by-env-3.rs rename to tests/ui/traits/next-solver/normalization-shadowing/discard-impls-shadowed-by-env-3.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.rs b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.rs rename to tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.stderr b/tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.stderr similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/normalizes_to_ignores_unnormalizable_candidate.stderr rename to tests/ui/traits/next-solver/normalization-shadowing/normalizes_to_ignores_unnormalizable_candidate.stderr diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.rs b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.rs rename to tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.rs diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.stderr b/tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.stderr similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/param-candidate-shadows-project.stderr rename to tests/ui/traits/next-solver/normalization-shadowing/param-candidate-shadows-project.stderr diff --git a/tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs b/tests/ui/traits/next-solver/normalization-shadowing/param-env-impl-conflict.rs similarity index 100% rename from tests/ui/traits/next-solver/env-shadows-impls/param-env-impl-conflict.rs rename to tests/ui/traits/next-solver/normalization-shadowing/param-env-impl-conflict.rs