rust/tests/ui/lint/use-redundant/use-redundant-prelude-rust-2021.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
332 B
Rust
Raw Normal View History

//@ check-pass
//@ edition:2021
2024-04-11 14:10:34 -04:00
#![warn(redundant_imports)]
2024-04-11 14:10:34 -04:00
use std::convert::TryFrom;//~ WARNING the item `TryFrom` is imported redundantly
use std::convert::TryInto;//~ WARNING the item `TryInto` is imported redundantly
fn main() {
let _e: Result<i32, _> = 8u8.try_into();
let _f: Result<i32, _> = i32::try_from(8u8);
}