-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Use const_error!
when possible
#136844
Use const_error!
when possible
#136844
Conversation
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
I have checked a target for each of the platforms modified: x check library/std --target=x86_64-unknown-hermit
x check library/std --target=aarch64-kmc-solid_asp3
x check library/std --target=aarch64-unknown-teeos
x check library/std --target=x86_64-unknown-uefi
x check library/std --target=x86_64-unknown-linux-gnu
x check library/std --target=wasm32-wasip1
x check library/std --target=x86_64-pc-windows-gnu
x check library/std --target=riscv32imac-unknown-xous-elf
x check library/test Note that TEEOS currently fails to build. I fixed that separately in #136769 commit Fix unsafe_op_in_unsafe_fn for TEEOS. |
7211f5a
to
9e390b2
Compare
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.
Thanks!
@bors r+ rollup |
…sDenton Use `const_error!` when possible Replace usages of `io::Error::new(io::ErrorKind::Variant, "constant string")` with `io::const_error!(io::ErrorKind::Variant, "constant string")` to avoid allocations when possible. Additionally, fix `&&str` error messages in SGX and missing/misplaced trailing commas in `const_error!`.
…kingjubilee Rollup of 12 pull requests Successful merges: - rust-lang#136671 (Overhaul `rustc_middle::limits`) - rust-lang#136817 (Pattern Migration 2024: clean up and comment) - rust-lang#136844 (Use `const_error!` when possible) - rust-lang#136953 (rustc_target: import TargetMetadata) - rust-lang#137095 (Replace some u64 hashes with Hash64) - rust-lang#137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - rust-lang#137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - rust-lang#137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - rust-lang#137125 (Re-add missing empty lines in the releases notes) - rust-lang#137140 (Fix const items not being allowed to be called `r#move` or `r#static`) - rust-lang#137145 (use add-core-stubs / minicore for a few more tests) - rust-lang#137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#136466 (Start removing `rustc_middle::hir::map::Map`) - rust-lang#136671 (Overhaul `rustc_middle::limits`) - rust-lang#136817 (Pattern Migration 2024: clean up and comment) - rust-lang#136844 (Use `const_error!` when possible) - rust-lang#137080 (bootstrap: add more tracing to compiler/std/llvm flows) - rust-lang#137101 (`invalid_from_utf8[_unchecked]`: also lint inherent methods) - rust-lang#137140 (Fix const items not being allowed to be called `r#move` or `r#static`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136844 - thaliaarchi:const-io-error, r=ChrisDenton Use `const_error!` when possible Replace usages of `io::Error::new(io::ErrorKind::Variant, "constant string")` with `io::const_error!(io::ErrorKind::Variant, "constant string")` to avoid allocations when possible. Additionally, fix `&&str` error messages in SGX and missing/misplaced trailing commas in `const_error!`.
Replace usages of
io::Error::new(io::ErrorKind::Variant, "constant string")
withio::const_error!(io::ErrorKind::Variant, "constant string")
to avoid allocations when possible. Additionally, fix&&str
error messages in SGX and missing/misplaced trailing commas inconst_error!
.