]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/suggest-change-mut.stderr
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / suggestions / suggest-change-mut.stderr
1 error[E0277]: the trait bound `&T: std::io::Read` is not satisfied
2   --> $DIR/suggest-change-mut.rs:12:48
3    |
4 LL |         let mut stream_reader = BufReader::new(&stream);
5    |                                 -------------- ^^^^^^^ the trait `std::io::Read` is not implemented for `&T`
6    |                                 |
7    |                                 required by a bound introduced by this call
8    |
9 note: required by a bound in `BufReader::<R>::new`
10   --> $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL
11    |
12 LL | impl<R: Read> BufReader<R> {
13    |         ^^^^ required by this bound in `BufReader::<R>::new`
14 help: consider removing the leading `&`-reference
15    |
16 LL -         let mut stream_reader = BufReader::new(&stream);
17 LL +         let mut stream_reader = BufReader::new(stream);
18    | 
19 help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
20    |
21 LL | fn issue_81421<T: Read + Write>(mut stream: T) where &T: std::io::Read {
22    |                                                +++++++++++++++++++++++
23 help: consider changing this borrow's mutability
24    |
25 LL |         let mut stream_reader = BufReader::new(&mut stream);
26    |                                                ~~~~
27
28 error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its trait bounds were not satisfied
29   --> $DIR/suggest-change-mut.rs:16:23
30    |
31 LL |         stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed");
32    |                       ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds
33    |
34   ::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL
35    |
36 LL | pub struct BufReader<R> {
37    | ----------------------- doesn't satisfy `BufReader<&T>: BufRead`
38    |
39    = note: the following trait bounds were not satisfied:
40            `&T: std::io::Read`
41            which is required by `BufReader<&T>: BufRead`
42
43 error: aborting due to 2 previous errors
44
45 Some errors have detailed explanations: E0277, E0599.
46 For more information about an error, try `rustc --explain E0277`.