Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,9 @@ fn set_rvalue_location<'a, 'gcc, 'tcx>(
bx: &mut Builder<'a, 'gcc, 'tcx>,
rvalue: RValue<'gcc>,
) -> RValue<'gcc> {
if bx.location.is_some() {
if let Some(location) = bx.location {
#[cfg(feature = "master")]
rvalue.set_location(bx.location.unwrap());
rvalue.set_location(location);
}
Comment on lines +506 to 509
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably going to cause some clippy failures on our side, though.
Better would have been:

Suggested change
if let Some(location) = bx.location {
#[cfg(feature = "master")]
rvalue.set_location(bx.location.unwrap());
rvalue.set_location(location);
}
#[cfg(feature = "master")]
if let Some(location) = bx.location {
rvalue.set_location(location);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@workingjubilee workingjubilee Nov 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it might seem weird as an "empty" conditional?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the feature master is disabled, the variable location is unused. That might even be a compiler warning instead of a clippy warning.

rvalue
}
Expand Down
Loading