Uh oh!
There was an error while loading. Please reload this page.
Update stdlib to the 2021 edition - #92030
Conversation
rust-highfive
commented
Dec 17, 2021
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
rukai
commented
Dec 17, 2021
Oh, seeing as theres a whole lint against it, maybe this needs more ceremony then some random person coming along and bumping to 2021. rust/src/tools/tidy/src/edition.rs Lines 26 to 35 in f410bc7 |
jyn514
commented
Dec 17, 2021
jyn514
commented
Dec 17, 2021
Oh hmm, those are unit tests, not doctests - I'm not sure how to make them use a different edition :/ maybe they need to be UI tests instead so they're in a separate crate? |
rukai
commented
Dec 17, 2021
ah, replacing them with ui tests makes sense! |
jyn514
commented
Dec 17, 2021
Hmm, this looks related to macro spans? Not sure what the bugs @Mark-Simulacrum referred to were.
|
m-ou-se
commented
Dec 17, 2021
There's no need for that. You can still panic with arbitrary payloads in Rust 2021. You just need to use panic_any instead of the panic (or assert) macro. |
There was a problem hiding this comment.
No need to use format!() to format the argument to a format string. So instead of adding "{}", just remove the format!() macro:
| Err(ref err) => assert!( | |
| err.raw_os_error() == Some($s), | |
| "{}", | |
| format!("`{}` did not have a code of `{}`", err, $s) | |
| ), | |
| Err(ref err) => assert!(err.raw_os_error() == Some($s),"`{}` did not have a code of `{}`", err, $s), |
There was a problem hiding this comment.
There's no need to remove these tests. Just replace panic!() by panic_any().
m-ou-se
commented
Dec 17, 2021
That lint was originally checking that everything is using Rust 2018 rather than 2015. For most of the crates it's been changed to check for 2021 instead. So it's not meant as a lint against upgrading, more a lint against not using 2015. We can change it to accept either 2018 or 2021 for now, or to require 2021 for std specifically as well. |
This comment has been minimized.
This comment has been minimized.
Thanks for the feedback! |
There was a problem hiding this comment.
There's a typo in TODO.
(Maybe just say 'Not all library crate are ..' in the existing comment? We're force to update this anyway when another library crate moves to 2021, so it's not like we can forget anything here.)
m-ou-se
commented
Dec 17, 2021
@bors r+ |
bors
commented
Dec 17, 2021
📌 Commit b656384 has been approved by |
Update stdlib to the 2021 edition progress towards rust-lang#88638 I couldnt find a way to run the 2018 style panic tests against 2018 so I just deleted them, maybe theres a way to do it that I missed though?
Update stdlib to the 2021 edition progress towards rust-lang#88638 I couldnt find a way to run the 2018 style panic tests against 2018 so I just deleted them, maybe theres a way to do it that I missed though?
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#91439 (Mark defaulted `PartialEq`/`PartialOrd` methods as const) - rust-lang#91516 (Improve suggestion to change struct field to &mut) - rust-lang#91896 (Remove `in_band_lifetimes` for `rustc_passes`) - rust-lang#91909 (:arrow_up: rust-analyzer) - rust-lang#91922 (Remove `in_band_lifetimes` from `rustc_mir_dataflow`) - rust-lang#92025 (Revert "socket ancillary data implementation for dragonflybsd.") - rust-lang#92030 (Update stdlib to the 2021 edition) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
progress towards #88638
I couldnt find a way to run the 2018 style panic tests against 2018 so I just deleted them, maybe theres a way to do it that I missed though?