-
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
Update RELEASES.md for 1.26.0 #49523
Conversation
Holy moly |
The links at the end are not supposed to be rendered, right? |
RELEASES.md
Outdated
- [128-bit integers in the form of `u128` & `i128` are now stable.][49101] | ||
- [`main` now accepts any type implementing the unstable trait | ||
`Termination` (currently `()`, `!`, | ||
`Result<(), E: Debug>`, `Result<!, E: Debug>`).][49162] |
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.
Maybe don't mention the trait, and just write
main()
can now return!
,Result<(), E: Debug>
andResult<!, E: Debug>
in additional to()
.
?
RELEASES.md
Outdated
- [Stabilised the `!` type (A type that has no value).][47630] | ||
- [The inclusive range syntax e.g. `for x in 0..=10` is now stable.][47813] | ||
- [`impl Trait` is now stable allowing you to have abstract | ||
return types.][49255] e.g. `fn foo() -> impl Iterator<Item=u8>` |
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.
impl Trait
can also appear in argument position e.g. fn open(a: impl AsRef<Path>)
.
RELEASES.md
Outdated
|
||
Compiler | ||
-------- | ||
- [LLD is now used as the default linker for `wasm32-unknown-target`.][48125] |
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.
wasm32-unknown-unknown
.
RELEASES.md
Outdated
Language | ||
-------- | ||
- [Closures now implement `Copy + Clone` if all captured variables do.][49299] | ||
- [Stabilised the `!` type (A type that has no value).][47630] |
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.
A type that has no value
! isn't just a ZST (zero sized type), it has special powers. Can't recall what exactly they were but a better name would be "never type".
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.
Oh BTW, if we can't find a suitable fix for #49039 (comment), we may be forced to unstabilize !
again.
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 think there was a thread where it was decided that "never type" is the official, technically correct pronunciation of "!
type", though unfortunately I can't find it. Since !
is how you spell it in code, I'd show both names: "Stabilised the !
type, also known as the "never" type".
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.
"never" is what you need to search for to find it in the docs (https://doc.rust-lang.org/nightly/std/?search=never), so it would be good to include that name here.
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.
Can't recall what exactly they were but a better name would be "never type".
Because there is no value of this type, if the compiler ever sees something with this type, it must be dead code and can be optimized out.
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.
struct Foo;
is definitely a ZST: https://doc.rust-lang.org/nomicon/exotic-sizes.html#zero-sized-types-zsts
(enum Void {}
can be considered as having "size -∞" that just gets saturated to zero since the API returns usize
.)
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.
To clarify: ()
and struct Foo;
are Zero sized types: they have exactly one possible value (()
and Foo
, respectively), so they can be represented with log(1) = 0
bits, hence the name. !
is not zero-sized; it cannot be represented with any number of bits because there are no values of that type.
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'd say a ZST is any type T that fulfills std::mem::size_of::<T>() == 0
. And ! does fulfill it so it is zero sized. I mean when ! has a size of zero, it must be zero-sized right?
In the "abstract" type check world, both struct Foo;
and enum Var{}
can have values. After all you can do things like let v: ! = panic!(); let w: u32 = v; println!("{}", w + 1);
.
In the "technical" code gen world, both ()
and !
get optimized out, their "values" never get onto the stack. The difference only shows if stuff is nested in stuff like Result
, but the nomicon claims that this optimisation is not yet being performed... might be outdated given eddyb's work on it.
So I believe that the statement "a type that has no value" is neither unique to the ! type (as there are types like enum Var {}
) nor is 100% accurate as as far as type checking is concerned it actually can.
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.
And ! does fulfill it so it is zero sized.
Do you mean theoretically or in implementation? Theoretically, it should not have size zero; it's size is undefined. I don't know what the implementation of mem::size_of::<!>()
does, though. I guess 0 is probably the most reasonable answer, but really None
or panic!
would be more correct...
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.
@est31 There are expressions of uninhabited types (what you mean by "the type checking perspective"), but none of these expressions ever actually evaluate to a value (if they do via unsafe code, that's UB). So "no values" is an accurate if not unique description of !
.
Though the specific phrasing "a type that has no value" has an unfortunate double meaning ("has no value" as in "is useless")...
I set the "since" to 1.27 for |
RELEASES.md
Outdated
- [Added hexadecimal formatting for integers with fmt::Debug][48978] | ||
e.g. `assert!(format!("{:02x?}", b"Foo\0") == "[46, 6f, 6f, 00]")` | ||
- [Implemented `Default, Hash` for `cmp::Reverse`.][48628] | ||
- [Optimized `str::repeat` being 8x fast in large cases.][48657] |
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.
typo: "fast" should be "faster"
It was stabilized right before the beta branch was cut for 1.26.0. See rust-lang#49523 (comment)
Fix "since" version for getpid feature. It was stabilized right before the beta branch was cut for 1.26.0. See rust-lang#49523 (comment) This will need to be backported to beta (1.26.0)
Fix "since" version for getpid feature. It was stabilized right before the beta branch was cut for 1.26.0. See rust-lang#49523 (comment) This will need to be backported to beta (1.26.0)
RELEASES.md
Outdated
`fn open(path: impl AsRef<Path>)`. | ||
- [Pattern matching on references are now automatically dereferenced.][49394] | ||
- [128-bit integers in the form of `u128` & `i128` are now stable.][49101] | ||
- [`main` now accepts any type implementing the unstable trait |
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.
Instead of "now accepts any type" I might say "can now return any type"
RELEASES.md
Outdated
`Termination` (currently `()`, `!`, | ||
`Result<(), E: Debug>`, `Result<!, E: Debug>`).][49162] | ||
- [`main` can now return `!`, `Result<(), E: Debug>`, | ||
`Result<!, E: Debug>`).][49162] In addition to `()`. |
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.
Unnecessary ).
.
RELEASES.md
Outdated
_ => println!("Not all points were sequential."), | ||
} | ||
``` | ||
- [Parentheses are now allowed in `dyn` traits.][48481] |
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.
dyn Trait
isn't stable yet, so should this go in the notes?
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 was wondering that myself but it was tagged with relnotes
so I left it in.
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.
@Aaronepower @steveklabnik The relnote was about a breaking change like this:
use std::ops::Fn as dyn;
fn g(_: Box<dyn(std::fmt::Debug)>) {}
Previously it compiles. Now it causes the E0658 "dyn Trait
syntax is unstable" error.
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.
oh huh
Fix "since" version for getpid feature. It was stabilized right before the beta branch was cut for 1.26.0. See rust-lang#49523 (comment) This will need to be backported to beta (1.26.0)
Please also add #49458 ( Given the large amount of stabilization and 1.26-beta being one-week-late, I suggest we double-check c83fa5d...097efa9 for any missing items. |
It was stabilized right before the beta branch was cut for 1.26.0. See rust-lang#49523 (comment)
RELEASES.md
Outdated
|
||
Language | ||
-------- | ||
- [Closures now implement `Copy + Clone` if all captured variables do.][49299] |
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 read this as meaning that both Copy
and Clone
have to be implemented, thus Copy + Clone
, but I think this change is also effective if the captured variables are only Clone
.
RELEASES.md
Outdated
return types.][49255] e.g. `fn foo() -> impl Iterator<Item=u8>` or | ||
`fn open(path: impl AsRef<Path>)`. | ||
- [Pattern matching on references are now automatically dereferenced.][49394] | ||
- [128-bit integers in the form of `u128` & `i128` are now stable.][49101] |
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 think “u128
and i128
” is better than “u128
& i128
”, both from a grammar (English not Rust) point of view and because the ampersand can be confused with the &
operator at first glance.
RELEASES.md
Outdated
Language | ||
-------- | ||
- [Closures now implement `Copy + Clone` if all captured variables do.][49299] | ||
- [Stabilised the `!` type.][47630] (Also known as the never type). |
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.
This is not going to be in 1.26 😢
RELEASES.md
Outdated
`fn open(path: impl AsRef<Path>)`. | ||
- [Pattern matching on references are now automatically dereferenced.][49394] | ||
- [128-bit integers in the form of `u128` & `i128` are now stable.][49101] | ||
- [`main` can now return `!`, `Result<(), E: Debug>`, |
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.
!
should be removed from here.
@Mark-Simulacrum Done |
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.
#46882 definitely needs to be mentioned. It stabilised a few things like const indexing.
RELEASES.md
Outdated
- [`Option::cloned`] | ||
- [`btree_map::Entry::and_modify`] | ||
- [`convert::TryFrom`] | ||
- [`convert::TryInto`] |
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.
TryFrom
and TryInto
were destabilised by #50121.
RELEASES.md
Outdated
let _reversed_pair: &'static _ = &(PAIR.1, PAIR.0); // Doesn't work | ||
} | ||
``` | ||
- [Removed the deprecated unstable `SipHasher{13,24}` from documentation.][49108] |
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.
SipHasher{13,24}
were never stable so there's no reason to include this change.
RELEASES.md
Outdated
- [Implemented `Default, Hash` for `cmp::Reverse`.][48628] | ||
- [Optimized `str::repeat` being 8x faster in large cases.][48657] | ||
- [`ascii::escape_default` is now available in libcore.][48735] | ||
- [Implemented `FromStr` for `PathBuf`][48292] |
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.
This is being reverted: #50401.
It's a few small things like being able to use indexing, dereferencing and tuple struct constructors in a const context. |
Okay, let's get this landed. @bors r+ I'm going to say we're probably not going to backport to beta at this point. |
📌 Commit 85f3ecf has been approved by |
@Aaronepower Could you incorporate comments from https://internals.rust-lang.org/t/1-26-0-prerelease-testing/7475/2 (a clarification on |
@bors r=Mark-Simulacrum |
📌 Commit 111786d has been approved by |
Update RELEASES.md for 1.26.0 [Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)
Rollup of 11 pull requests Successful merges: - #49988 (Mention Result<!, E> in never docs.) - #50148 (turn `ManuallyDrop::new` into a constant function) - #50456 (Update the Cargo submodule) - #50460 (Make `String::new()` const) - #50464 (Remove some transmutes) - #50505 (Added regression function match value test) - #50511 (Add some explanations for #[must_use]) - #50525 (Optimize string handling in lit_token().) - #50527 (Cleanup a `use` in a raw_vec test) - #50539 (Add more logarithm constants) - #49523 (Update RELEASES.md for 1.26.0) Failed merges:
Rendered
r? @Mark-Simulacrum