You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Duplicate definition of type for rustc::mir::Constant #56137
These types aren't always equal. e.g. the lifetimes often differ, and I think around impl trait some inconsistencies can happen, too. we should probably document this much better and/or figure out whether we need the duplication
@RalfJung All of that is fine. ty::Const is "unusual" because it's one of the 3 "entities" (Ty and ty::Region have the same treatment).
I'm already fixing this. MIR construction is just wrong and likely has been since forever.
MIRI kept papering over this issue by not using the ty field of ty::Const.
Activity
oli-obk commentedon Nov 21, 2018
These types aren't always equal. e.g. the lifetimes often differ, and I think around impl trait some inconsistencies can happen, too. we should probably document this much better and/or figure out whether we need the duplication
eddyb commentedon Aug 12, 2019
Looks like #61041 is blocked on fixing this.
EDIT: to expand on that, this example:
Has this for the
char::ZEROin the MIR ofONE:Note the
<Self as Zero>::Reprinliteral.ty, which is clearly wrong forONE(appears to be unsubstituted), whiletyis correct.RalfJung commentedon Aug 12, 2019
RalfJung commentedon Aug 12, 2019
eddyb commentedon Aug 12, 2019
@RalfJung All of that is fine.
ty::Constis "unusual" because it's one of the 3 "entities" (Tyandty::Regionhave the same treatment).I'm already fixing this. MIR construction is just wrong and likely has been since forever.
MIRI kept papering over this issue by not using the
tyfield ofty::Const.eddyb commentedon Aug 12, 2019
Huh, looks like the bug is pretty recent: 5cd2806#diff-c599d3d6879ad974960a24abd4e4bdb6R953
It was introduced in #59178, after this issue - had we removed the duplication earlier, the bug would've been prevented, heh.
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk
Rollup merge of rust-lang#63495 - eddyb:mir-constant-ty, r=oli-obk