diff options
Diffstat (limited to 'tests/ui/mismatched_types/non_zero_assigned_something.rs')
-rw-r--r-- | tests/ui/mismatched_types/non_zero_assigned_something.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/mismatched_types/non_zero_assigned_something.rs b/tests/ui/mismatched_types/non_zero_assigned_something.rs new file mode 100644 index 000000000..d2adbe01c --- /dev/null +++ b/tests/ui/mismatched_types/non_zero_assigned_something.rs @@ -0,0 +1,9 @@ +fn main() { + let _: std::num::NonZeroU64 = 1; + //~^ ERROR mismatched types + //~| HELP consider calling `NonZeroU64::new` + + let _: Option<std::num::NonZeroU64> = 1; + //~^ ERROR mismatched types + //~| HELP consider calling `NonZeroU64::new` +} |