about summary refs log tree commit diff
path: root/tests/ui/box/suggest-box-for-expr-field-issue-139631.stderr
blob: 01bd0523a162d4e93ebec71b93a337c6da2f4847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
error[E0308]: mismatched types
  --> $DIR/suggest-box-for-expr-field-issue-139631.rs:11:18
   |
LL |     let v2 = X { a };
   |                  ^ expected `Box<u32>`, found integer
   |
   = note: expected struct `Box<u32>`
                found type `{integer}`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
help: store this in the heap by calling `Box::new`
   |
LL |     let v2 = X { a: Box::new(a) };
   |                  ++++++++++++ +

error[E0308]: mismatched types
  --> $DIR/suggest-box-for-expr-field-issue-139631.rs:12:21
   |
LL |     let v3 = Y { y: a };
   |                     ^ expected `Box<u32>`, found integer
   |
   = note: expected struct `Box<u32>`
                found type `{integer}`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
help: store this in the heap by calling `Box::new`
   |
LL |     let v3 = Y { y: Box::new(a) };
   |                     +++++++++ +

error[E0560]: struct `Y` has no field named `a`
  --> $DIR/suggest-box-for-expr-field-issue-139631.rs:13:18
   |
LL |     let v4 = Y { a };
   |                  ^ unknown field
   |
help: a field with a similar name exists
   |
LL -     let v4 = Y { a };
LL +     let v4 = Y { y };
   |

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0308, E0560.
For more information about an error, try `rustc --explain E0308`.