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
warning: a method with this name may be added to the standard library in the future
--> src/main.rs:13:47
|
13 | println!("{}", unsafe { Some("hello").unwrap_unchecked() });
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unstable_name_collisions)]` on by default
= warning: once this method 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 `OptionExt::unwrap_unchecked(...)` to keep using the current method
= help: add `#![feature(option_result_unwrap_unchecked)]` to the crate attributes to enable `Option::<T>::unwrap_unchecked`
The warning is correct: #81383 added Option::unwrap_unchecked so this code is a future incompatibility hazard. The bug is that #[allow(unstable_name_collisions)] does not suppress the lint, although it works at function scope.
This code gives a warning on the latest nightly:
The warning is correct: #81383 added
Option::unwrap_unchecked
so this code is a future incompatibility hazard. The bug is that#[allow(unstable_name_collisions)]
does not suppress the lint, although it works at function scope.rustc --version --verbose
:The text was updated successfully, but these errors were encountered: