-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
Using the lock methods from fs2
cause rustc warnings on rust 1.84:
pub fn read_file(filename: &str) -> String {
let mut file = std::fs::File::open(filename).unwrap();
file.lock_shared().unwrap();
let mut data = String::new();
file.read_to_string(&mut data).unwrap();
data
}
warning: a method with this name may be added to the standard library in the future
--> src/lib.rs:8:10
|
8 | file.lock_shared().unwrap();
| ^^^^^^^^^^^
|
= warning: once this associated item is added to the standard library, the ambiguity may cause an error or change in behavior!
= note: for more information, see issue #48919 <https://github.com/rust-lang/rust/issues/48919>
= help: call with fully qualified syntax `lock_shared(...)` to keep using the current method
= note: `#[warn(unstable_name_collisions)]` on by default
The name collision happens for lock_shared
, try_lock_shared
, and unlock
.
ntc2 and benidi
Metadata
Metadata
Assignees
Labels
No labels