Uh oh!
There was an error while loading. Please reload this page.
Remove an unnecessary unwrap in rustc_codegen_gcc - #149449
Conversation
rustbot
commented
Nov 29, 2025
Some changes occurred in compiler/rustc_codegen_gcc |
workingjubilee
commented
Nov 29, 2025
Yeah, it should be fine. @bors r+ |
bors
commented
Nov 29, 2025
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #149449 - AudaciousAxiom:refactor/rustc-codegen-gcc-remove-unnecessary-unwrap, r=workingjubilee Remove an unnecessary `unwrap` in `rustc_codegen_gcc` This should hopefully unblock #149425 (I couldn't find an in-flight PR that was already doing this). I've tested locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however). I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
| if let Some(location) = bx.location { | ||
| #[cfg(feature = "master")] | ||
| rvalue.set_location(bx.location.unwrap()); | ||
| rvalue.set_location(location); | ||
| } |
There was a problem hiding this comment.
It's probably going to cause some clippy failures on our side, though.
Better would have been:
| ifletSome(location) = bx.location{ | |
| #[cfg(feature = "master")] | |
| rvalue.set_location(bx.location.unwrap()); | |
| rvalue.set_location(location); | |
| } | |
| #[cfg(feature = "master")] | |
| ifletSome(location) = bx.location{ | |
| rvalue.set_location(location); | |
| } |
There was a problem hiding this comment.
Hm. It seems unlikely that it would do so, @antoyo, given it fixes a clippy lint? But I will try to pay closer attention to the cfg on any PRs in this area.
There was a problem hiding this comment.
I suppose it might seem weird as an "empty" conditional?
There was a problem hiding this comment.
When the feature master is disabled, the variable location is unused. That might even be a compiler warning instead of a clippy warning.
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc `@antoyo` r? `@Kobzol`
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ``@antoyo`` r? ``@Kobzol``
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ```@antoyo``` r? ```@Kobzol```
…bzol Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144000 (Add `DefId::parent()` accessor for `rustc_public`) - rust-lang/rust#149409 (Test the coexistence of 'stack-protector' and 'safe-stack') - rust-lang/rust#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`) r? `@ghost` `@rustbot` modify labels: rollup
…gen-gcc-remove-unnecessary-unwrap, r=workingjubilee Remove an unnecessary `unwrap` in `rustc_codegen_gcc` This should hopefully unblock rust-lang#149425 (I couldn't find an in-flight PR that was already doing this). I've tested locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however). I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
Rollup of 3 pull requests Successful merges: - rust-lang#144000 (Add `DefId::parent()` accessor for `rustc_public`) - rust-lang#149409 (Test the coexistence of 'stack-protector' and 'safe-stack') - rust-lang#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #149458 - GuillaumeGomez:clippy-cg_gcc, r=kobzol Run clippy on cg_gcc in CI This is to prevent [this issue](#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang/rust#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang/rust#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144000 (Add `DefId::parent()` accessor for `rustc_public`) - rust-lang/rust#149409 (Test the coexistence of 'stack-protector' and 'safe-stack') - rust-lang/rust#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`) r? `@ghost` `@rustbot` modify labels: rollup
Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang/rust#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Run clippy on cg_gcc in CI This is to prevent [this issue](rust-lang/rust#149449 (comment)): in cg_gcc repository, we run clippy on our code but not in here, which can create issues. cc ````@antoyo```` r? ````@Kobzol````
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144000 (Add `DefId::parent()` accessor for `rustc_public`) - rust-lang/rust#149409 (Test the coexistence of 'stack-protector' and 'safe-stack') - rust-lang/rust#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 3 pull requests Successful merges: - rust-lang/rust#144000 (Add `DefId::parent()` accessor for `rustc_public`) - rust-lang/rust#149409 (Test the coexistence of 'stack-protector' and 'safe-stack') - rust-lang/rust#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`) r? `@ghost` `@rustbot` modify labels: rollup
This should hopefully unblock #149425 (I couldn't find an in-flight PR that was already doing this).
I've tested locally with the
masterversion of Clippy thatrustc_codegen_gccpasses the lints (the syncing PR could still fail for other reasons however).I understand that
rustc_codegen_gccis normally developed outside of this repo but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.r? @matthiaskrgr