Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upEncountered error `Unimplemented` selecting `Binder(<[closure ...] as Fn()>)` during trans #34349
Comments
This comment has been minimized.
This comment has been minimized.
|
Looks like a regression; 1.9 outputs the correct "trait bound is not satisfied" error. |
arielb1
changed the title
Encountered error `Unimplemented` selecting `Binder(...)` during trans
Encountered error `Unimplemented` selecting `Binder(<[closure ...] as Fn()>)` during trans
Jun 19, 2016
This comment has been minimized.
This comment has been minimized.
|
cc @soltanmm |
eddyb
assigned
arielb1
Jun 23, 2016
pnkfelix
added
the
P-medium
label
Jun 23, 2016
This comment has been minimized.
This comment has been minimized.
|
assigning P-medium to keep it out of brson's sight |
pnkfelix
removed
the
I-nominated
label
Jun 23, 2016
arielb1
added
regression-from-stable-to-beta
and removed
regression-from-stable-to-nightly
labels
Jul 7, 2016
This comment has been minimized.
This comment has been minimized.
|
1.11 is now beta |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
The issue is that upvar inference mutates the |
pnkfelix
assigned
nikomatsakis
Jul 21, 2016
This comment has been minimized.
This comment has been minimized.
|
@arielb1 so I looked into this some. Is the problem related to caching? That is, we solve the trait once with |
This comment has been minimized.
This comment has been minimized.
|
Because basically I think things are largely working as they are supposed to -- and an error would be expected, except that I think a cache is kicking in. Disabling caching for these sorts of predicates would probably fix the problem (I'll try it), though of course it'd be nice in a way if we could surface the closure kind up into the key (not sure how that would work though). |
This comment has been minimized.
This comment has been minimized.
|
OK, I have a simple patch that fixes this. It moves the computation of the closure-kind into a temporary table; the final results are copied into the main table only when done. The result is that the |
This comment has been minimized.
This comment has been minimized.
|
Doing final testing now, hopefully have a PR up soon. |
nikomatsakis
added a commit
to nikomatsakis/rust
that referenced
this issue
Jul 22, 2016
nikomatsakis
added a commit
to nikomatsakis/rust
that referenced
this issue
Jul 22, 2016
nikomatsakis
referenced this issue
Jul 23, 2016
Merged
Avoid writing a temporary closure kind #34986
This comment has been minimized.
This comment has been minimized.
|
Last time I checked the problem wasn't caching, but that the "[closure ...]: Fn" obligation, left over from type-checking, was incorrectly marked as resolved. |
This comment has been minimized.
This comment has been minimized.
That is what I meant by caching, basically. |
KarboniteKream commentedJun 18, 2016
I was going over the examples on Rust by Example (section 8.2.2) when I encountered the following error:
Encountered error 'Unimplemented' selecting 'Binder(<[closure@bug.rs:11:17: 14:6 farewell:&mut std::string::String] as std::ops::Fn<()>>)' during trans.In the
apply()function, if I replaceFn()withFnMut()orFnOnce(), the code works (withFnMut()it fails of course), but if I keepFn(), the compiler panics.If I remove the
inc()call, the compiler also doesn't panic.Source code
Stack trace
Version
rustc 1.11.0-nightly (5c2a5d4 2016-06-11)
binary: rustc
commit-hash: 5c2a5d4
commit-date: 2016-06-11
host: x86_64-pc-windows-gnu
release: 1.11.0-nightly
The same problem occurs on Linux, also Nightly.