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