rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.77k stars 12.76k forks source link

Implement `From<&NonZero<T>> for &T` #133255

Open Alphare opened 2 days ago

Alphare commented 2 days ago

This is my first contribution because I basically stumbled upon this not being implemented and figured it would be a quick fix, sorry if I'm missing anything. I see that all other impls in this file have feature annotations, I'm not sure if this would need one.

rustbot commented 2 days ago

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jhpratt (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

rust-log-analyzer commented 2 days ago

The job x86_64-gnu-llvm-18 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot) ```plain #16 exporting to docker image format #16 sending tarball 29.0s done #16 DONE 31.7s ##[endgroup] Setting extra environment values for docker: --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/ [CI_JOB_NAME=x86_64-gnu-llvm-18] debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured. --- sccache: Starting the server... ##[group]Configure the build configure: processing command line configure: configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling'] configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config configure: llvm.link-shared := True configure: rust.randomize-layout := True configure: rust.thin-lto-import-instr-limit := 10 --- Compiling compiler_builtins v0.1.138 error: implementation has missing stability attribute --> core/src/num/nonzero.rs:290:1 | 290 | / impl From<&NonZero> for &T 291 | | where 292 | | T: ZeroablePrimitive, 293 | | { 299 | | } 300 | | } | |_^ ```
jhpratt commented 2 days ago

Trait implementations require a stability attribute, which is why CI is failing. Unfortunately, they also cannot be unstable. For that reason, I'll have the team take a look at it as it will require FCP.

@rustbot label +I-libs-api-nominated