You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the lock methods from fs_std cause rustc warnings on rust 1.84:
use fs4::fs_std::FileExt;pubfnread_file(filename:&str) -> String{letmut file = std::fs::File::open(filename).unwrap();
file.lock_shared().unwrap();letmut data = String::new();
file.read_to_string(&mut data).unwrap();
data
}
$ cargo +beta-2024-11-27 check
warning: a method with this name may be added to the standard library in the future
--> src/lib.rs:10:10
|
10 | 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, which are tracked by the file_lock feature (rust-lang/rust#130994).
The text was updated successfully, but these errors were encountered:
eric-seppanen
changed the title
FileExt methods cause compiler warnings on rust 1.83
FileExt methods cause compiler warnings on rust 1.84
Nov 27, 2024
mstange
added a commit
to mstange/samply
that referenced
this issue
Jan 19, 2025
Using the lock methods from
fs_std
cause rustc warnings on rust 1.84:The name collision happens for
lock_shared
,try_lock_shared
, andunlock
, which are tracked by thefile_lock
feature (rust-lang/rust#130994).The text was updated successfully, but these errors were encountered: