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
Type parameters that appear in a fn type should not require a Send bound #2992
The reason this test case fails is that you have captured self, which is an & pointer. It is correct to complain. You would need to write: let self1 = *self outside the closure and then match self1 inside.
nmatsakis says that this is not addressed by the new borrowck. I attempted to update the test case to no avail, considering that I'm not even sure what it's supposed to demonstrate.
foo.rs:2:14: 2:15 error: cannot capture variable of type `T`, which does not fulfill `'static`, in a bounded closure
foo.rs:2 || copy a
^
foo.rs:2:14: 2:15 note: this closure's environment must satisfy `'static`
foo.rs:2 || copy a
^
error: aborting due to previous error
2992.rs:2:5: 2:6 error: cannot capture variable of type `A`, which does not fulfill `'static`, in a bounded closure
2992.rs:2 || a.clone()
^
2992.rs:2:5: 2:6 note: this closure's environment must satisfy `'static`
2992.rs:2 || a.clone()
^
error: aborting due to previous error
Activity
graydon commentedon Dec 18, 2012
Is this still live? Can you reproduce?
jesse99 commentedon Dec 22, 2012
This is still required in 0.5. But note that adding Durable (or keeping the old Owned) doesn't always clue the compiler in. Here is a test case:
nikomatsakis commentedon Jan 3, 2013
The reason this test case fails is that you have captured
self, which is an&pointer. It is correct to complain. You would need to write:let self1 = *selfoutside the closure and thenmatch self1inside.nikomatsakis commentedon Jan 3, 2013
@graydon it is still live.
graydon commentedon Mar 22, 2013
non-critical for 0.6, de-milestoning
bstrie commentedon May 13, 2013
nmatsakis says that this is not addressed by the new borrowck. I attempted to update the test case to no avail, considering that I'm not even sure what it's supposed to demonstrate.
nikomatsakis commentedon May 14, 2013
That test case does not demonstrate the issue. I can make up a test case that does.
nikomatsakis commentedon May 14, 2013
Here is a test case:
This test case should compile, but it yields an error reporting that a
'staticbound is required.emberian commentedon Jul 12, 2013
Current error message:
huonw commentedon Sep 20, 2013
Triage: still an issue, but
copy's gone:Types appearing in fn types shouldn't require an owned bound
nikomatsakis commentedon Mar 10, 2014
Updated terminology of title. The truth is I am a bit nervous about this change -- maybe it's better to stay conservative.
nikomatsakis commentedon Mar 10, 2014
In particular we have to think carefully about variance. That said, requiring
Sendis definitely bogus, the right thing is'staticflaper87 commentedon Mar 10, 2014
This is an updated test case (since managed closures are gone):
alexcrichton commentedon Apr 2, 2014
Closing, this was fixed when the default bounds were removed from procedures. It is no longer required to have the
Sendbound.flaper87 commentedon Apr 2, 2014
yay, 🍰
Auto merge of rust-lang#2992 - RalfJung:ci, r=RalfJung
Refactoring contracts macro logic into separate modules (rust-lang#2992)
Merge pull request rust-lang#2992 from jyn514/videos