Opened 3 years ago
Closed 3 years ago
#18456 closed enhancement (fixed)
rustc-1.72.0
| Reported by: | Bruce Dubbs | Owned by: | Xi Ruoyao |
|---|---|---|---|
| Priority: | normal | Milestone: | 12.1 |
| Component: | BOOK | Version: | git |
| Severity: | normal | Keywords: | |
| Cc: |
Description
New minor version.
Change History (7)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
The ".old" issue still exists and I've reported it as https://github.com/rust-lang/rust/issues/115213.
follow-up: 4 comment:3 by , 3 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
I'll try to see if Firefox and Thunderbird build fine with rustc-1.72.0/cbindgen-0.25.0.
comment:4 by , 3 years ago
Replying to Xi Ruoyao:
I'll try to see if Firefox and Thunderbird build fine with rustc-1.72.0/cbindgen-0.25.0.
Firefox builds and runs fine.
comment:6 by , 3 years ago
What's in 1.72.0 stable
Rust reports potentially useful cfg-disabled items in errors
You can conditionally enable Rust code using cfg, such as to provide certain
functions only with certain crate features, or only on particular platforms.
Previously, items disabled in this way would be effectively invisible to the
compiler. Now, though, the compiler will remember the name and cfg conditions
of those items, so it can report (for example) if a function you tried to call
is unavailable because you need to enable a crate feature.
Compiling my-project v0.1.0 (/tmp/my-project)
error[E0432]: unresolved import `rustix::io_uring`
--> src/main.rs:1:5
|
1 | use rustix::io_uring;
| ^^^^^^^^^^^^^^^^ no `io_uring` in the root
|
note: found an item that was configured out
--> /home/username/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustix-0.38.8/src/lib.rs:213:9
|
213 | pub mod io_uring;
| ^^^^^^^^
= note: the item is gated behind the `io_uring` feature
For more information about this error, try `rustc --explain E0432`.
error: could not compile `my-project` (bin "my-project") due to previous error
Const evaluation time is now unlimited
To prevent user-provided const evaluation from getting into a compile-time infinite loop or otherwise taking unbounded time at compile time, Rust previously limited the maximum number of *statements* run as part of any given constant evaluation. However, especially creative Rust code could hit these limits and produce a compiler error. Worse, whether code hit the limit could vary wildly based on libraries invoked by the user; if a library you invoked split a statement into two within one of its functions, your code could then fail to compile.
Now, you can do an unlimited amount of const evaluation at compile time. To
avoid having long compilations without feedback, the compiler will always emit
a message after your compile-time code has been running for a while, and repeat
that message after a period that doubles each time. By default, the compiler
will also emit a deny-by-default lint (const_eval_long_running) after a large
number of steps to catch infinite loops, but you can
allow(const_eval_long_running) to permit especially long const evaluation.
Uplifted lints from Clippy
Several lints from Clippy have been pulled into rustc:
- `clippy::undropped_manually_drops` to `undropped_manually_drops` (deny)
ManuallyDropdoes not drop its inner value, so callingstd::mem::dropon it does nothing. Instead, the lint will suggestManuallyDrop::into_innerfirst, or you may use the unsafeManuallyDrop::dropto run the destructor in-place. This lint is denied by default.
- `clippy::invalid_utf8_in_unchecked` to `invalid_from_utf8_unchecked`() (deny) and `invalid_from_utf8` (warn)
- The first checks for calls to
std::str::from_utf8_uncheckedandstd::str::from_utf8_unchecked_mutwith an invalid UTF-8 literal, which violates their safety pre-conditions, resulting in undefined behavior. This lint is denied by default. - The second checks for calls to
std::str::from_utf8andstd::str::from_utf8_mutwith an invalid UTF-8 literal, which will always return an error. This lint is a warning by default.
- The first checks for calls to
- `clippy::cmp_nan` to `invalid_nan_comparisons`() (warn)
- This checks for comparisons with
f32::NANorf64::NANas one of the operands. NaN does not compare meaningfully to anything – not even itself – so those comparisons are always false. This lint is a warning by default, and will suggest calling theis_nan()method instead.
- This checks for comparisons with
- `clippy::cast_ref_to_mut` to `invalid_reference_casting` (allow)
- This checks for casts of
&Tto&mut Twithout using interior mutability, which is immediate undefined behavior, even if the reference is unused. This lint is currently allowed by default due to potential false positives, but it is planned to be denied by default in 1.73 after implementation improvements.
- This checks for casts of
Stabilized APIs
These APIs are now stable in const contexts:
- `CStr::from_bytes_with_nul`
- `CStr::to_bytes`
- `CStr::to_bytes_with_nul`
- https://doc.rust-lang.org/stable/std/ffi/struct.CStr.html#method.to_str`CStr::to_str`
Other changes
Check out everything that changed in Rust, Cargo, and Clippy.
comment:7 by , 3 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
Fixed at r12.0-54-g808aeec3d8 and r12.0-55-gce49f79e46.

The test suite needs some additional operation:
before
python3 x.py test.