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
NLL may be mishandling _ within type-ascription expression form #57731
Right now, as written, this compiles without error. (Note that fn coupled_types_rhs is not included; that function will error with and without NLL.)
If you remove the nll in the feature declaration, the code for fn coupled_wilds_rhs is rejected.
This is an indication that either:
NLL has a bug in how it is handling _ in the type-ascription expression form EXPR: TYPE, or
there exists some argument that fn coupled_wilds_rhs should be accepted (and that NLL is correct in accepting it), but I do not see how such an argument exists that would not also imply that we should be seeing the same behavior in fn coupled_types_rhs.
Activity
matthewjasper commentedon Jan 18, 2019
I had a brief look, the annotation is dropped before we get to NLL. Probably here:
rust/src/librustc_typeck/check/mod.rs
Lines 2442 to 2446 in f613dc1
matthewjasper commentedon Jan 21, 2019
This also applies to casts, so it is visble on stable:
pnkfelix commentedon Jan 25, 2019
type ascription is feature-gated though, no?
pnkfelix commentedon Jan 25, 2019
(or did you mean to use
as, as in((s, _x),) as (PairCoupledTypes<_>,), in your example?)matthewjasper commentedon Jan 25, 2019
Yes, it should be
asin the example.Auto merge of #57714 - matthewjasper:wellformed-unreachable, r=pnkfelix