-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Type parameters that appear in a fn type should not require a Send bound #2992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Is this still live? Can you reproduce? |
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:
|
The reason this test case fails is that you have captured |
@graydon it is still live. |
non-critical for 0.6, de-milestoning |
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. |
That test case does not demonstrate the issue. I can make up a test case that does. |
Here is a test case:
This test case should compile, but it yields an error reporting that a |
Current error message:
|
Triage: still an issue, but fn enclose<A: Clone>(a: A) -> @fn() -> A {
|| a.clone()
}
fn main() {}
|
Regression test Closes rust-lang#2992
Updated terminology of title. The truth is I am a bit nervous about this change -- maybe it's better to stay conservative. |
In particular we have to think carefully about variance. That said, requiring |
This is an updated test case (since managed closures are gone): fn enclose<A: Clone>(a: A) -> proc() -> A {
proc() a.clone()
}
fn main() {} |
Closing, this was fixed when the default bounds were removed from procedures. It is no longer required to have the |
yay, 🍰 |
Refactors the `contracts` module into several smaller modules grouped by task. The previous modules was very long and interleaved a lot of logic for various parts of the contracts state machine. This refactoring groups functions by specificity, task correlation and reusability. All code changes here are exclusively moves with no changes to functionality. The split is as follows: - `mod.rs` contains definitions of the data structures used to handle contracts, the entry point for contract handling, as well as a documentation overview. - `bootstrap.rs` is the logic that initialized the central data structures, such as the handler and the functions state - `check.rs` is all the logic required to create the function that checks a contract. - `replace.rs` is all the logic required to create a function that abstracts via contract - `shared.rs` are Kani/contract-specific helper functions that are used in more than one of `bootstrap`, `check` or `replace` - `helpers.rs` are Kani/contract-independent helper functions I was going to make the `old` PR but I shudder at the though of appending more logic to the extremely long `contracts.rs` file so I figured I'd split the logic real quick before adding more. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. Co-authored-by: Felipe R. Monteiro <[email protected]>
For ifaces, we enforce three criteria to ensure that regions do not escape. For fn types, we have a more simplistic requirement. This should be fixed.
Related: #2991
The text was updated successfully, but these errors were encountered: