TAIT: item does not constrain
after diverging expression
#141779
Labels
A-type-system
Area: Type system
C-bug
Category: This is a bug.
F-type_alias_impl_trait
`#[feature(type_alias_impl_trait)]`
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: This code should compile.
Instead, this happened: An error is generated.
This happens when the function’s body contains an an unconditional diverging expression (such as
loop {}
orpanic!()
). If the diverging expression is wrapped inif true { ... }
, the code compiles fine.Godbolt link: https://godbolt.org/z/T65dMvG6o
Note that the same code compiles fine with
-Z next-solver
: https://godbolt.org/z/nsqT36bWEMeta
rustc --version --verbose
:Backtrace
The text was updated successfully, but these errors were encountered: