]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/non_zero_assigned_something.stderr
Rollup merge of #106644 - alexcrichton:update-wasi-toolchain, r=cuviper
[rust.git] / tests / ui / mismatched_types / non_zero_assigned_something.stderr
1 error[E0308]: mismatched types
2   --> $DIR/non_zero_assigned_something.rs:2:35
3    |
4 LL |     let _: std::num::NonZeroU64 = 1;
5    |            --------------------   ^ expected struct `NonZeroU64`, found integer
6    |            |
7    |            expected due to this
8    |
9 help: consider calling `NonZeroU64::new`
10    |
11 LL |     let _: std::num::NonZeroU64 = NonZeroU64::new(1).unwrap();
12    |                                   ++++++++++++++++ ++++++++++
13
14 error[E0308]: mismatched types
15   --> $DIR/non_zero_assigned_something.rs:6:43
16    |
17 LL |     let _: Option<std::num::NonZeroU64> = 1;
18    |            ----------------------------   ^ expected enum `Option`, found integer
19    |            |
20    |            expected due to this
21    |
22    = note: expected enum `Option<NonZeroU64>`
23               found type `{integer}`
24 help: consider calling `NonZeroU64::new`
25    |
26 LL |     let _: Option<std::num::NonZeroU64> = NonZeroU64::new(1);
27    |                                           ++++++++++++++++ +
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0308`.