]> git.lizzy.rs Git - rust.git/commitdiff
Add regression test for #21140
authorCorey Farwell <coreyf@rwell.org>
Sun, 12 Jul 2015 11:42:06 +0000 (20:42 +0900)
committerCorey Farwell <coreyf@rwell.org>
Tue, 14 Jul 2015 13:57:55 +0000 (22:57 +0900)
Closes #21140

src/test/compile-fail/issue-23595-1.rs
src/test/run-pass/issue-21140.rs [new file with mode: 0644]

index 4dc717558b176657c7a9cfb35d7d7b0c47e72ad2..749b261e38719a89e481a41f2831678df23d217c 100644 (file)
@@ -14,7 +14,9 @@ trait Hierarchy {
     type Value;
     type ChildKey;
     type Children = Index<Self::ChildKey, Output=Hierarchy>;
-    //~^ ERROR: the value of the associated type must be specified
+    //~^ ERROR: the value of the associated type `ChildKey`
+    //~^^ ERROR: the value of the associated type `Children`
+    //~^^^ ERROR: the value of the associated type `Value`
 
     fn data(&self) -> Option<(Self::Value, Self::Children)>;
 }
diff --git a/src/test/run-pass/issue-21140.rs b/src/test/run-pass/issue-21140.rs
new file mode 100644 (file)
index 0000000..c19f332
--- /dev/null
@@ -0,0 +1,15 @@
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Trait where Self::Out: std::fmt::Display {
+    type Out;
+}
+
+fn main() {}