-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Say why non-implicitly-copyable things are that way #2634
Comments
I partially did this to solve #2942. Now reporting these things is as simple as writing |
Error messages could still stand to be improved as of right now. |
This is still relevant because there are at least two reasons for types moving instead of copying, a destructor or |
Bug triage, email from 2013 sep 16. As prep work for this bug, I attempted to write a program demonstrating the cross-product of:
I've added what I've accumulated so far to the bug description. |
see also #9098 as a semi-related issue (at least, if our mental with respect to implicit copy-ability changes, then these error messages will probably change accordingly). |
We will likely start requiring an opt-in to builtin bounds (see http://smallcultfollowing.com/babysteps/blog/2014/02/28/rust-rfc-opt-in-builtin-traits/), in which case this issue may become moot |
Partial dup of #12201 |
|
./miri updates: toolchain, rustc-push, rustc-pull This merges the `./rustup-toolchain` script into `./miri` as `./miri toolchain`, and adds two new commands for josh-based syncing. r? `@rust-lang/miri`
./miri updates: toolchain, rustc-push, rustc-pull This merges the `./rustup-toolchain` script into `./miri` as `./miri toolchain`, and adds two new commands for josh-based syncing. r? `@rust-lang/miri`
Deprecate kani::slice::any_slice in Kani 0.38.0 (and the related AnySlice struct), and remove it in a later version. Motivation: The Kani library's `slice::any_slice` API is doing more harm than benefit: it is meant to provide a convenient way for users to generate non-deterministic slices, but its current implementation aims to avoid any unsoundness by making sure that for the non-deterministic slice returned by the API, accessing memory beyond the slice length is flagged as an out-of-bounds access (see rust-lang#1009 for details). However, in practical scenarios, using it ends up causing memory to blowup for CBMC. Given that users may not care about this type of unsoundness, which is only possible through using a pointer dereference inside an unsafe block (see discussion in rust-lang#2634). Thus, we should leave it to the user to decide the suitable method for generating slices that fits their verification needs. For example, they can use Kani's alternative API, `any_slice_of_array` that extracts a slice of a non-deterministic start and end from a given array.
Updated Bug Report
We do not provide enough user feedback explaining why a type is non-copyable. The error messages just say "error: copying a value of non-copyable type
Type
"Things have gotten a bit better since this bug was filed, in part because our story has changed somewhat (we no longer implicitly copy vectors/strings; we no longer have
@fn
), but we still do not have great user feedback, particularly with respect to explaining how a type ended up being put into the "non-copyable" bucket.Sample Code Enumerating Non-copyable Cases
Original Bug Report follows
I think the error messages would be clearer if they were along these lines:
The text was updated successfully, but these errors were encountered: