Skip to content

Instantly share code, notes, and snippets.

@SpamapS
Created January 3, 2017 19:26
Show Gist options
  • Save SpamapS/34c90511d53c31592e45fff7118f8e8f to your computer and use it in GitHub Desktop.
Save SpamapS/34c90511d53c31592e45fff7118f8e8f to your computer and use it in GitHub Desktop.
clint@clint-ThinkPad-X250:~/src/rustplay/wrappinghashset$ cargo test
Compiling wrappinghashset v0.1.0 (file:///home/clint/src/rustplay/wrappinghashset)
error[E0499]: cannot borrow `hs` as mutable more than once at a time
--> src/lib.rs:87:18
|
76 | for i in hs.iter() {
| -- first mutable borrow occurs here
...
87 | for i in hs.iter() {
| ^^ second mutable borrow occurs here
...
98 | }
| - first borrow ends here
error[E0499]: cannot borrow `hs` as mutable more than once at a time
--> src/lib.rs:93:18
|
76 | for i in hs.iter() {
| -- first mutable borrow occurs here
...
93 | for i in hs.iter() {
| ^^ second mutable borrow occurs here
...
98 | }
| - first borrow ends here
error: aborting due to 2 previous errors
Build failed, waiting for other jobs to finish...
warning: struct is never used: `WrappingHashSet`, #[warn(dead_code)] on by default
--> src/lib.rs:7:1
|
7 | struct WrappingHashSet<'a> {
| _^ starting here...
8 | | hashset: HashSet<&'a str>,
9 | | keys: Vec<&'a str>,
10 | | pos: usize,
11 | | count: usize,
12 | | }
| |_^ ...ending here
warning: struct is never used: `Iter`, #[warn(dead_code)] on by default
--> src/lib.rs:14:1
|
14 | struct Iter<'i, 'a: 'i> {
| _^ starting here...
15 | | whs: &'i mut WrappingHashSet<'a>,
16 | | }
| |_^ ...ending here
warning: method is never used: `new`, #[warn(dead_code)] on by default
--> src/lib.rs:33:5
|
33 | fn new() -> WrappingHashSet<'a> {
| _____^ starting here...
34 | | WrappingHashSet {
35 | | hashset: HashSet::new(),
36 | | keys: Vec::new(),
37 | | pos: 0,
38 | | count: 0,
39 | | }
40 | | }
| |_____^ ...ending here
warning: method is never used: `iter`, #[warn(dead_code)] on by default
--> src/lib.rs:42:5
|
42 | fn iter<'i>(&'a mut self) -> Iter<'i, 'a> {
| _____^ starting here...
43 | | Iter {
44 | | whs: self,
45 | | }
46 | | }
| |_____^ ...ending here
warning: method is never used: `insert`, #[warn(dead_code)] on by default
--> src/lib.rs:48:5
|
48 | fn insert(&mut self, key: &'a str) -> bool {
| _____^ starting here...
49 | | if self.hashset.insert(key) {
50 | | self.keys.push(key);
51 | | return true
52 | | }
53 | | return false
54 | | }
| |_____^ ...ending here
warning: method is never used: `remove`, #[warn(dead_code)] on by default
--> src/lib.rs:56:5
|
56 | fn remove(&mut self, key: &'a str) -> bool {
| ^
error: Could not compile `wrappinghashset`.
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment