-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add error explanation for E0328. #38108
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
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @GuillaumeGomez (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
The Unsize trait should not be implemented directly. All implementations of | ||
Unsize are provided automatically by the compiler. | ||
|
||
Here's an example of this error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please replace with "Erroneous code example". We try to keep a standard.
conversion from a sized to an unsized type with the [DST coercion system] | ||
(https://github.com/rust-lang/rfcs/blob/master/text/0982-dst-coercion.md), use | ||
[`CoerceUnsized`](https://doc.rust-lang.org/std/ops/trait.CoerceUnsized.html) | ||
instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what you said, it seems possible to do it. Could you add an example showing how please?
Don't worry for the build. Travis said it's okay so don't bother with it (even if you're failure is strange :-/ ). |
@linclark: Are you still working on it? |
Sorry for the delay, I had to travel for work and am just getting things back in order from that. I will make the changes in the next couple of days. |
No problem, take your time. It was just to check if it wasn't a dead PR. |
@GuillaumeGomez Ok, this has been updated with an example of how to fix it. Note, I tested that this compiles, but I've never implemented |
Hum... Your example doesn't show much but I'm afraid that demonstrating it might take a lot of place. So I wonder if we should just keep the current example or make it bigger and more complete... What do you think about it @rust-lang/docs? |
cc @rust-lang/docs |
Ok, since no one seems interested, I'll r+ it and it'll updated in the future if needed. Thanks for your work! @bors: r+ rollup |
📌 Commit ac28aba has been approved by |
⌛ Testing commit ac28aba with merge 3872c46... |
💔 Test failed - status-travis |
@bors: retry |
Add error explanation for E0328. This PR adds an explanation for an error in the list in #32777. I haven't used this feature myself, so I was piecing it together from the docs. Please let me know if any changes in wording should be made. One problem: When I followed the instructions in CONTRIBUTING.md, it said to run `make check-stage1` before posting the PR. This reported failures, but they seemed to be intermittent. I got different numbers of failures on each run. Here's the output for the last run ``` failures: ---- [run-make] run-make/rustc-macro-dep-files stdout ---- error: make failed status: exit code: 2 command: "make" stdout: ------------------------------------------ DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin foo.rs DYLD_LIBRARY_PATH="/Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin:/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib:" '/Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/bin/rustc' --out-dir /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin -L /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin bar.rs --emit dep-info ------------------------------------------ stderr: ------------------------------------------ dyld: lazy symbol binding failed: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib dyld: Symbol not found: __ZN4core3fmt5write17h2f7663117dd4fb40E Referenced from: /Users/lclark/Repos/rust/x86_64-apple-darwin/test/run-make/rustc-macro-dep-files.stage1-x86_64-apple-darwin/libfoo.dylib Expected in: /Users/lclark/Repos/rust/x86_64-apple-darwin/stage1/lib/libstd-fdb5dc8c.dylib make[1]: *** [all] Trace/BPT trap: 5 ------------------------------------------ thread '[run-make] run-make/rustc-macro-dep-files' panicked at 'explicit panic', /Users/lclark/Repos/rust/src/tools/compiletest/src/runtest.rs:2407 note: Run with `RUST_BACKTRACE=1` for a backtrace. failures: [run-make] run-make/rustc-macro-dep-files test result: FAILED. 136 passed; 1 failed; 0 ignored; 0 measured thread 'main' panicked at 'Some tests failed', /Users/lclark/Repos/rust/src/tools/compiletest/src/main.rs:302 make: *** [tmp/check-stage1-T-x86_64-apple-darwin-H-x86_64-apple-darwin-rmake.ok] Error 101 ``` r? @GuillaumeGomez
☀️ Test successful - status-appveyor, status-travis |
This PR adds an explanation for an error in the list in #32777.
I haven't used this feature myself, so I was piecing it together from the docs. Please let me know if any changes in wording should be made.
One problem: When I followed the instructions in CONTRIBUTING.md, it said to run
make check-stage1
before posting the PR. This reported failures, but they seemed to be intermittent. I got different numbers of failures on each run. Here's the output for the last runr? @GuillaumeGomez