- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
          Use const_error! when possible
          #136844
        
          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
              
            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/testNote 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 | 
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&&strerror messages in SGX and missing/misplaced trailing commas inconst_error!.