about summary refs log tree commit diff
path: root/src/test/ui/const-generics/array-impls
diff options
context:
space:
mode:
authorMark Rousskov <mark.simulacrum@gmail.com>2019-12-26 14:12:56 -0500
committerMark Rousskov <mark.simulacrum@gmail.com>2019-12-26 19:24:45 -0500
commit48859db151b839518bdd9d44a2387c0f6b65d141 (patch)
treeb6baa53fb9e0d98b3b5362e6749364483ed98701 /src/test/ui/const-generics/array-impls
parent3b92689f3d0c3b90fa01d9873cdf01543d51c000 (diff)
downloadrust-48859db151b839518bdd9d44a2387c0f6b65d141.tar.gz
rust-48859db151b839518bdd9d44a2387c0f6b65d141.zip
Relax bounds on HashSet to match hashbrown
No functional changes are made, and all APIs are moved to strictly less
restrictive bounds.

These APIs changed from the old bound listed to the new bound:

T: Hash + Eq -> T
* new
* with_capacity

T: Eq + Hash, S: BuildHasher -> T
* with_hasher
* with_capacity_and_hasher
* hasher

T: Eq + Hash + Debug -> T: Debug
S: BuildHasher -> S
<HashSet as Debug>

T: Eq + Hash -> T
S: BuildHasher + Default -> S: Default
<HashSet as Default>
Diffstat (limited to 'src/test/ui/const-generics/array-impls')
-rw-r--r--src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs1
-rw-r--r--src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr19
2 files changed, 5 insertions, 15 deletions
diff --git a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
index 7fa059583f5..8397d204f35 100644
--- a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
+++ b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.rs
@@ -6,7 +6,6 @@ pub fn no_debug() {
 pub fn no_hash() {
     use std::collections::HashSet;
     let mut set = HashSet::new();
-    //~^ ERROR arrays only have std trait implementations for lengths 0..=32
     set.insert([0_usize; 33]);
     //~^ ERROR arrays only have std trait implementations for lengths 0..=32
 }
diff --git a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
index d885c98dcb2..594a0d4b5d8 100644
--- a/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
+++ b/src/test/ui/const-generics/array-impls/core-traits-no-impls-length-33.stderr
@@ -8,24 +8,15 @@ LL |     println!("{:?}", [0_usize; 33]);
    = note: required by `std::fmt::Debug::fmt`
 
 error[E0277]: arrays only have std trait implementations for lengths 0..=32
-  --> $DIR/core-traits-no-impls-length-33.rs:10:16
+  --> $DIR/core-traits-no-impls-length-33.rs:9:16
    |
 LL |     set.insert([0_usize; 33]);
    |                ^^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
    |
    = note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
 
-error[E0277]: arrays only have std trait implementations for lengths 0..=32
-  --> $DIR/core-traits-no-impls-length-33.rs:8:19
-   |
-LL |     let mut set = HashSet::new();
-   |                   ^^^^^^^^^^^^ the trait `std::array::LengthAtMost32` is not implemented for `[usize; 33]`
-   |
-   = note: required because of the requirements on the impl of `std::cmp::Eq` for `[usize; 33]`
-   = note: required by `std::collections::HashSet::<T>::new`
-
 error[E0369]: binary operation `==` cannot be applied to type `[usize; 33]`
-  --> $DIR/core-traits-no-impls-length-33.rs:15:19
+  --> $DIR/core-traits-no-impls-length-33.rs:14:19
    |
 LL |     [0_usize; 33] == [1_usize; 33]
    |     ------------- ^^ ------------- [usize; 33]
@@ -35,7 +26,7 @@ LL |     [0_usize; 33] == [1_usize; 33]
    = note: an implementation of `std::cmp::PartialEq` might be missing for `[usize; 33]`
 
 error[E0369]: binary operation `<` cannot be applied to type `[usize; 33]`
-  --> $DIR/core-traits-no-impls-length-33.rs:20:19
+  --> $DIR/core-traits-no-impls-length-33.rs:19:19
    |
 LL |     [0_usize; 33] < [1_usize; 33]
    |     ------------- ^ ------------- [usize; 33]
@@ -45,7 +36,7 @@ LL |     [0_usize; 33] < [1_usize; 33]
    = note: an implementation of `std::cmp::PartialOrd` might be missing for `[usize; 33]`
 
 error[E0277]: the trait bound `&[usize; 33]: std::iter::IntoIterator` is not satisfied
-  --> $DIR/core-traits-no-impls-length-33.rs:25:14
+  --> $DIR/core-traits-no-impls-length-33.rs:24:14
    |
 LL |     for _ in &[0_usize; 33] {
    |              ^^^^^^^^^^^^^^ the trait `std::iter::IntoIterator` is not implemented for `&[usize; 33]`
@@ -57,7 +48,7 @@ LL |     for _ in &[0_usize; 33] {
              <&'a mut [T] as std::iter::IntoIterator>
    = note: required by `std::iter::IntoIterator::into_iter`
 
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0277, E0369.
 For more information about an error, try `rustc --explain E0277`.