summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/issue-32350.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/issue-32350.rs')
-rw-r--r--src/test/ui/associated-types/issue-32350.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/issue-32350.rs b/src/test/ui/associated-types/issue-32350.rs
new file mode 100644
index 000000000..bda21eb0e
--- /dev/null
+++ b/src/test/ui/associated-types/issue-32350.rs
@@ -0,0 +1,29 @@
+// check-pass
+
+// This is another instance of the "normalizations don't work" issue with
+// defaulted associated types.
+
+#![feature(associated_type_defaults)]
+
+pub trait Emitter<'a> {
+ type Ctxt: 'a;
+ type CtxtBrw: 'a = &'a Self::Ctxt;
+
+ fn get_cx(&'a self) -> Self::CtxtBrw;
+}
+
+struct MyCtxt;
+
+struct MyEmitter {
+ ctxt: MyCtxt
+}
+
+impl <'a> Emitter<'a> for MyEmitter {
+ type Ctxt = MyCtxt;
+
+ fn get_cx(&'a self) -> &'a MyCtxt {
+ &self.ctxt
+ }
+}
+
+fn main() {}