Skip to content
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

Change ! decay from () to ! to keep up with Rust 2024 #6881

Open
xunilrj opened this issue Feb 3, 2025 · 0 comments
Open

Change ! decay from () to ! to keep up with Rust 2024 #6881

xunilrj opened this issue Feb 3, 2025 · 0 comments

Comments

@xunilrj
Copy link
Contributor

xunilrj commented Feb 3, 2025

Take the following rust program as an example:

fn main() {
    let a = None;
    println!("{:?}", std::any::type_name_of_val(&a));
    a = Some([todo!()]);
}

Rust prints "core::option::Option<[(); 1]>" on edition 2021, and "core::option::Option<[!; 1]>" on edition 2024.
This happens because they decide to no longer decay ! to (), see rust-lang/rust#123748

When we were implementing ! we decided to follow Rust, and we now need to decide if we follow edition 2024 or not. I vote to follow it in the future, so we keep differences to Rust only where we think makes a difference.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant