From d9e2259d659dfd3abd931bf6e1c4eb54d101a8f7 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Mon, 11 Feb 2019 11:58:56 +0100 Subject: Relax some Hash bounds on HashMap and HashSet Notably, hash iterators don't require any trait bounds to be iterated. --- src/test/ui/issues/issue-35677.rs | 7 ++++--- src/test/ui/issues/issue-35677.stderr | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/test') diff --git a/src/test/ui/issues/issue-35677.rs b/src/test/ui/issues/issue-35677.rs index 71e2125ffd2..ba2d503d7fc 100644 --- a/src/test/ui/issues/issue-35677.rs +++ b/src/test/ui/issues/issue-35677.rs @@ -1,6 +1,7 @@ -use std::collections::HashMap; -fn intersect_map(this: &mut HashMap, other: HashMap) -> bool { - this.drain() +use std::collections::HashSet; + +fn is_subset(this: &HashSet, other: &HashSet) -> bool { + this.is_subset(other) //~^ ERROR no method named } diff --git a/src/test/ui/issues/issue-35677.stderr b/src/test/ui/issues/issue-35677.stderr index 61ddb75b3b5..99d99db93f3 100644 --- a/src/test/ui/issues/issue-35677.stderr +++ b/src/test/ui/issues/issue-35677.stderr @@ -1,12 +1,12 @@ -error[E0599]: no method named `drain` found for type `&mut std::collections::HashMap` in the current scope - --> $DIR/issue-35677.rs:3:10 +error[E0599]: no method named `is_subset` found for type `&std::collections::HashSet` in the current scope + --> $DIR/issue-35677.rs:4:10 | -LL | this.drain() - | ^^^^^ +LL | this.is_subset(other) + | ^^^^^^^^^ | - = note: the method `drain` exists but the following trait bounds were not satisfied: - `K : std::cmp::Eq` - `K : std::hash::Hash` + = note: the method `is_subset` exists but the following trait bounds were not satisfied: + `T : std::cmp::Eq` + `T : std::hash::Hash` error: aborting due to previous error -- cgit 1.4.1-3-g733a5