-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate old items in RFC 2700 #72885
Conversation
src/libcore/num/f64.rs
Outdated
#[rustc_deprecated( | ||
since = "1.46.0", | ||
reason = "The associated constant `f64::INFINITY` is now prefered", | ||
suggestion = "f64::INFINITY", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid that rustfix cannot handle this suggestion.
For example, what does rustfix do in this case?
use std::f64;
f64::INFINITY;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran the snippet locally. rustfix doesn't do anything except for this case:
#![warn(deprecated_in_future)]
pub fn foo() -> f64 {
- use std::f64 as float;
- float::INFINITY
+
+ f64::INFINITY
}
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Was it decided to actually deprecate the old constants now? That was met with resistance from some people which is why it was soft-deprecated for now. I'm in favor of fully deprecating them, but I suspect this is too soon after stabilization according to some people(?). Moving ahead and using |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
7571d0d
to
cd1fb91
Compare
cd1fb91
to
9e81b51
Compare
LL | if value <= (u32::max_value() as i64) && value >= 0 { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `u32::try_from(value).is_ok()` | ||
| | ||
= note: `-D clippy::checked-conversions` implied by `-D warnings` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False negative tracked at rust-lang/rust-clippy#5675
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @faern mentioned, we are not ready to start deprecating anything at this point. Could you change the PR to only updating internal usages without any public deprecations?
Closing in favor of #72906. |
…, r=dtolnay Migrate to numeric associated consts The deprecation PR is rust-lang#72885 cc rust-lang#68490 cc rust-lang/rfcs#2700
…, r=dtolnay Migrate to numeric associated consts The deprecation PR is rust-lang#72885 cc rust-lang#68490 cc rust-lang/rfcs#2700
…, r=dtolnay Migrate to numeric associated consts The deprecation PR is rust-lang#72885 cc rust-lang#68490 cc rust-lang/rfcs#2700
…, r=dtolnay Migrate to numeric associated consts The deprecation PR is rust-lang#72885 cc rust-lang#68490 cc rust-lang/rfcs#2700
The numeric associated constants were stabilized from 1.43.0.
This PR deprecates the following items as of 1.46.0:
MIN
/MAX
constants in the integer modulesmin_value
/max_value
methods on the integer types.cc #68490
cc rust-lang/rfcs#2700
r? @dtolnay
cc @faern, @LukasKalbertodt