diff options
| author | bors <bors@rust-lang.org> | 2020-01-20 05:56:53 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-01-20 05:56:53 +0000 |
| commit | 900811e43047fc5593f39b0363373530b02c87e0 (patch) | |
| tree | 34bc5482693fb417276dbcb216eb14f82ad952a6 /src/librustc_error_codes/error_codes | |
| parent | 29b854fb741809c29764e33fc17c32ba9c6523ba (diff) | |
| parent | 0259c103853afe4b641a1a3f36ca7daa92c2b0e2 (diff) | |
| download | rust-900811e43047fc5593f39b0363373530b02c87e0.tar.gz rust-900811e43047fc5593f39b0363373530b02c87e0.zip | |
Auto merge of #68380 - Dylan-DPC:rollup-a7moqmr, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #68326 (rustdoc: Catch fatal errors when syntax highlighting) - #68335 (Remove real_drop_in_place) - #68353 (Remove `rustc_error_codes` deps except in `rustc_driver`) - #68357 (rustdoc: Fix handling of compile errors when running `rustdoc --test`) - #68365 (Clean up error codes) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0201.md | 6 | ||||
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0204.md | 17 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/librustc_error_codes/error_codes/E0201.md b/src/librustc_error_codes/error_codes/E0201.md index bdbf02f0033..0e1a7b7b7de 100644 --- a/src/librustc_error_codes/error_codes/E0201.md +++ b/src/librustc_error_codes/error_codes/E0201.md @@ -1,7 +1,7 @@ -It is an error to define two associated items (like methods, associated types, -associated functions, etc.) with the same identifier. +Two associated items (like methods, associated types, associated functions, +etc.) were defined with the same identifier. -For example: +Erroneous code example: ```compile_fail,E0201 struct Foo(u8); diff --git a/src/librustc_error_codes/error_codes/E0204.md b/src/librustc_error_codes/error_codes/E0204.md index 31569011135..96e44758be4 100644 --- a/src/librustc_error_codes/error_codes/E0204.md +++ b/src/librustc_error_codes/error_codes/E0204.md @@ -1,21 +1,24 @@ -An attempt to implement the `Copy` trait for a struct failed because one of the -fields does not implement `Copy`. To fix this, you must implement `Copy` for the -mentioned field. Note that this may not be possible, as in the example of +The `Copy` trait was implemented on a type which contains a field that doesn't +implement the `Copy` trait. + +Erroneous code example: ```compile_fail,E0204 struct Foo { - foo : Vec<u32>, + foo: Vec<u32>, } -impl Copy for Foo { } +impl Copy for Foo { } // error! ``` -This fails because `Vec<T>` does not implement `Copy` for any `T`. +The `Copy` trait is implemented by default only on primitive types. If your +type only contains primitive types, you'll be able to implement `Copy` on it. +Otherwise, it won't be possible. Here's another example that will fail: ```compile_fail,E0204 -#[derive(Copy)] +#[derive(Copy)] // error! struct Foo<'a> { ty: &'a mut bool, } |
