diff options
| author | bors <bors@rust-lang.org> | 2020-02-06 15:43:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-06 15:43:00 +0000 |
| commit | 442ae7f04026c215a03b155eaaf9cde8bb5cf02a (patch) | |
| tree | bf7472e8278e4303ee33b50811461f249e019efd /src/librustc_error_codes | |
| parent | 1f8df2508f2772d83011f0f651de86181123e519 (diff) | |
| parent | 1ad674afcf37f1c8fe39317dc65d1aafc37f8694 (diff) | |
Auto merge of #68893 - Dylan-DPC:rollup-3f2421a, r=Dylan-DPC
Rollup of 9 pull requests Successful merges: - #68691 (Remove `RefCell` usage from `ObligationForest`.) - #68751 (Implement `unused_parens` for `const` and `static` items) - #68788 (Towards unified `fn` grammar) - #68837 (Make associated item collection a query) - #68842 (or_patterns: add regression test for #68785) - #68844 (use def_path_str for missing_debug_impls message) - #68845 (stop using BytePos for computing spans in librustc_parse/parser/mod.rs) - #68869 (clean up E0271 explanation) - #68880 (Forbid using `0` as issue number) Failed merges: r? @ghost
Diffstat (limited to 'src/librustc_error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0271.md | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/librustc_error_codes/error_codes/E0271.md b/src/librustc_error_codes/error_codes/E0271.md index 4078598b394..31334069ed8 100644 --- a/src/librustc_error_codes/error_codes/E0271.md +++ b/src/librustc_error_codes/error_codes/E0271.md @@ -1,9 +1,6 @@ -This is because of a type mismatch between the associated type of some -trait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`) -and another type `U` that is required to be equal to `T::Bar`, but is not. -Examples follow. +A type mismatched an associated type of a trait. -Here is a basic example: +Erroneous code example: ```compile_fail,E0271 trait Trait { type AssociatedType; } @@ -17,6 +14,11 @@ impl Trait for i8 { type AssociatedType = &'static str; } foo(3_i8); ``` +This is because of a type mismatch between the associated type of some +trait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`) +and another type `U` that is required to be equal to `T::Bar`, but is not. +Examples follow. + Here is that same example again, with some explanatory comments: ```compile_fail,E0271 |
