X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=RELEASES.md;h=36597b1864f25097a54881389f3a1f8fc0db77cc;hb=36d13cb01ba6a0a9b7c13ca2b9461a111cb3e395;hp=f2f9faf8da0b4dc95025b483044d67b589db74c5;hpb=f24cc7b633a8207180d87c4a291fcb4d213d1688;p=rust.git diff --git a/RELEASES.md b/RELEASES.md index f2f9faf8da0..36597b1864f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -5,17 +5,28 @@ Language -------- - [Fixed using binary operations with `&{number}` (e.g. `&1.0`) not having the type inferred correctly.][68129] +- [Attributes such as `#[cfg()]` can now be used on `if` expressions.][69201] **Syntax only changes** - [Allow `type Foo: Ord` syntactically.][69361] -- [Unify item parsing & filter illegal item kinds.][69366] - [Fuse associated and extern items up to defaultness.][69194] -- [Permit attributes on `if` expressions.][69201] - [Syntactically allow `self` in all `fn` contexts.][68764] - [Merge `fn` syntax + cleanup item parsing.][68728] +- [`item` macro fragments can be interpolated into `trait`s, `impl`s, and `extern` blocks.][69366] + For example, you may now write: + ```rust + macro_rules! mac_trait { + ($i:item) => { + trait T { $i } + } + } + mac_trait! { + fn foo() {} + } + ``` These are still rejected *semantically*, so you will likely receive an error but -these changes can be seen and parsed by procedural macros and +these changes can be seen and parsed by macros and conditional compilation. @@ -37,9 +48,6 @@ Libraries `TryFrom>`,`TryFrom>`, and `TryFrom>` respectively.][69538] **Note** These conversions are only available when `N` is `0..=32`. -- [All `to_be_bytes`, `to_le_bytes`, `to_ne_bytes`, `from_be_bytes`, - `from_le_bytes`, and `from_ne_bytes` methods for integers are - now `const`.][69373] - [You can now use associated constants on floats and integers directly, rather than having to import the module.][68952] e.g. You can now write `u32::MAX` or `f32::NAN` with no imports. @@ -60,11 +68,30 @@ Stabilized APIs - [`f64::LOG2_10`] - [`iter::once_with`] +Cargo +----- +- [You can now set config `[profile]`s in your `.cargo/config`, or through + your environment.][cargo/7823] +- [Cargo will now set `CARGO_BIN_EXE_` pointing to a binary's + executable path when running integration tests or benchmarks.][cargo/7697] + `` is the name of your binary as-is e.g. If you wanted the executable + path for a binary named `my-program`you would use `env!("CARGO_BIN_EXE_my-program")`. + Misc ---- - [Certain checks in the `const_err` lint were deemed unrelated to const evaluation][69185], and have been moved to the `unconditional_panic` and `arithmetic_overflow` lints. + +Compatibility Notes +------------------- + +- [Having trailing syntax in the `assert!` macro is now a hard error.][69548] This + has been a warning since 1.36.0. +- [Fixed `Self` not having the correctly inferred type.][69340] This incorrectly + led to some instances being accepted, and now correctly emits a hard error. + +[69340]: https://github.com/rust-lang/rust/pull/69340 Internal Only ------------- @@ -105,11 +132,13 @@ related tools. [69194]: https://github.com/rust-lang/rust/pull/69194/ [69201]: https://github.com/rust-lang/rust/pull/69201/ [69227]: https://github.com/rust-lang/rust/pull/69227/ +[69548]: https://github.com/rust-lang/rust/pull/69548/ [69256]: https://github.com/rust-lang/rust/pull/69256/ [69361]: https://github.com/rust-lang/rust/pull/69361/ [69366]: https://github.com/rust-lang/rust/pull/69366/ -[69373]: https://github.com/rust-lang/rust/pull/69373/ [69538]: https://github.com/rust-lang/rust/pull/69538/ +[cargo/7823]: https://github.com/rust-lang/cargo/pull/7823 +[cargo/7697]: https://github.com/rust-lang/cargo/pull/7697 [`Once::is_completed`]: https://doc.rust-lang.org/std/sync/struct.Once.html#method.is_completed [`f32::LOG10_2`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG10_2.html [`f32::LOG2_10`]: https://doc.rust-lang.org/std/f32/consts/constant.LOG2_10.html