From d5cb5fb1853952c0e5377e86a09c0fcf5bf2a829 Mon Sep 17 00:00:00 2001 From: León Orell Valerian Liehr Date: Mon, 5 Dec 2022 18:02:47 +0100 Subject: normalize inherent associated types after substitution --- .../normalize-projection-0.rs | 22 ++++++++++++++++++++++ .../normalize-projection-1.rs | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 src/test/ui/associated-inherent-types/normalize-projection-0.rs create mode 100644 src/test/ui/associated-inherent-types/normalize-projection-1.rs (limited to 'src/test') diff --git a/src/test/ui/associated-inherent-types/normalize-projection-0.rs b/src/test/ui/associated-inherent-types/normalize-projection-0.rs new file mode 100644 index 00000000000..50763ecddf9 --- /dev/null +++ b/src/test/ui/associated-inherent-types/normalize-projection-0.rs @@ -0,0 +1,22 @@ +// check-pass + +#![feature(inherent_associated_types)] +#![allow(incomplete_features)] + +struct S(T); + +impl S { + type P = ::P; +} + +trait O { + type P; +} + +impl O for i32 { + type P = String; +} + +fn main() { + let _: S::P = String::new(); +} diff --git a/src/test/ui/associated-inherent-types/normalize-projection-1.rs b/src/test/ui/associated-inherent-types/normalize-projection-1.rs new file mode 100644 index 00000000000..2f7b2551a03 --- /dev/null +++ b/src/test/ui/associated-inherent-types/normalize-projection-1.rs @@ -0,0 +1,22 @@ +// check-pass + +#![feature(inherent_associated_types)] +#![allow(incomplete_features)] + +struct S; + +impl S { + type P = ::P; +} + +trait O { + type P; +} + +impl O for i32 { + type P = String; +} + +fn main() { + let _: S::P = String::new(); +} -- cgit 1.4.1-3-g733a5