-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
tuple elements are not considered a coercion site #112856
Copy link
Copy link
Closed
Labels
A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
A-coercionsArea: implicit and explicit `expr as Type` coercionsArea: implicit and explicit `expr as Type` coercionsC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Playground
I tried this code:
I expected to see this happen:
Code compiles, runs, and panics.
ahas type((), ()).Instead, this happened:
The following changes have no effect:
let a =.trueto some runtime-only condition.if-elsewithmatch.todo!()and()inside of the tuple.todo!()withloop{}orstd::process::exit(0).todo!()with a call to a function returningstd::convert::Infallible(though this makes the warning about the unreachable code go away).u8or any other "normal" type instead of().The following changes make the error go away.
Meta
rustc --version --verbose:Same on nightly and beta.
Must be related to #35121.