about summary refs log tree commit diff
path: root/src/test/compile-fail
diff options
context:
space:
mode:
authorChris Stankus <cdstankus@gmail.com>2017-01-18 00:16:19 -0600
committerChris Stankus <cdstankus@gmail.com>2017-01-18 00:16:19 -0600
commit5c58653e46b73bbc2bb6811be2eefa4b6675c942 (patch)
tree0be338faf852011bef1f378b60c1dd1cbda36a88 /src/test/compile-fail
parentc07a6ae77cd4ceb3cf591d34c5608ca91d1f75d4 (diff)
downloadrust-5c58653e46b73bbc2bb6811be2eefa4b6675c942.tar.gz
rust-5c58653e46b73bbc2bb6811be2eefa4b6675c942.zip
E0122 should apply with where clauses
Diffstat (limited to 'src/test/compile-fail')
-rw-r--r--src/test/compile-fail/issue-17994.rs3
-rw-r--r--src/test/compile-fail/issue-39122.rs13
-rw-r--r--src/test/compile-fail/private-in-public-warn.rs1
3 files changed, 16 insertions, 1 deletions
diff --git a/src/test/compile-fail/issue-17994.rs b/src/test/compile-fail/issue-17994.rs
index fcbc08327b9..ac15bd9d15b 100644
--- a/src/test/compile-fail/issue-17994.rs
+++ b/src/test/compile-fail/issue-17994.rs
@@ -9,5 +9,6 @@
 // except according to those terms.
 
 trait Tr {}
-type Huh<T> where T: Tr = isize; //~ ERROR type parameter `T` is unused
+type Huh<T> where T: Tr = isize; //~  ERROR type parameter `T` is unused
+                                 //~| WARNING E0122
 fn main() {}
diff --git a/src/test/compile-fail/issue-39122.rs b/src/test/compile-fail/issue-39122.rs
new file mode 100644
index 00000000000..2e8a740f893
--- /dev/null
+++ b/src/test/compile-fail/issue-39122.rs
@@ -0,0 +1,13 @@
+// Copyright 2017 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.
+
+type Foo<T: std::ops::Add> = T; //~ WARNING E0122
+
+type Bar<T> where T: std::ops::Add = T; //~ WARNING E0122
diff --git a/src/test/compile-fail/private-in-public-warn.rs b/src/test/compile-fail/private-in-public-warn.rs
index 3496348985d..92d96595fd7 100644
--- a/src/test/compile-fail/private-in-public-warn.rs
+++ b/src/test/compile-fail/private-in-public-warn.rs
@@ -89,6 +89,7 @@ mod traits_where {
     pub type Alias<T> where T: PrivTr = T;
         //~^ ERROR private trait `traits_where::PrivTr` in public interface
         //~| WARNING hard error
+        //~| WARNING E0122
     pub trait Tr2<T> where T: PrivTr {}
         //~^ ERROR private trait `traits_where::PrivTr` in public interface
         //~| WARNING hard error