Skip to content

We should use a () constant instead of Rvalue::Aggregate(box AggregateKind::Tuple, vec![]). #70886

Closed
@eddyb

Description

@eddyb

This should be changed to return a () Operand::Const (not Rvalue::Use of that operand):

crate fn unit_rvalue(&mut self) -> Rvalue<'tcx> {
Rvalue::Aggregate(box AggregateKind::Tuple, vec![])
}

These two other places should switch to a () Rvalue::Use(Operand::Const(...)):

Rvalue::Aggregate(box AggregateKind::Tuple, vec![]),
let unit = Rvalue::Aggregate(box AggregateKind::Tuple, vec![]);

This issue has been assigned to @lcnr via this comment.

Metadata

Metadata

Assignees

Labels

A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlC-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions