about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-10-04 15:24:04 +0530
committerGitHub <noreply@github.com>2016-10-04 15:24:04 +0530
commit0e3cd4ed1587bfae58c39c10ced9bdcf6ee763af (patch)
treea2dae0615e0af6d949202873f3d5f8b966e37dd9 /src/test
parent1f9036872d7ea8bee91f8588e3c4a613c58c76cb (diff)
parentd8ddef0de33765c3f86672f20b06b9351763d287 (diff)
downloadrust-0e3cd4ed1587bfae58c39c10ced9bdcf6ee763af.tar.gz
rust-0e3cd4ed1587bfae58c39c10ced9bdcf6ee763af.zip
Rollup merge of #36941 - martinhath:issue-21837, r=alexcrichton
Add regression test for Issue #21837

This PR adds a regression test for Issue #21837, as explained in the comments of the issue.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/issue-21837.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/test/compile-fail/issue-21837.rs b/src/test/compile-fail/issue-21837.rs
new file mode 100644
index 00000000000..86506de1ea9
--- /dev/null
+++ b/src/test/compile-fail/issue-21837.rs
@@ -0,0 +1,20 @@
+// Copyright 2014 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 Bound {}
+pub struct Foo<T: Bound>(T);
+
+pub trait Trait1 {}
+impl<T: Bound> Trait1 for Foo<T> {}
+
+pub trait Trait2 {}
+impl<T> Trait2 for Foo<T> {} //~ ERROR the trait bound `T: Bound` is not satisfied
+
+fn main() {}