Skip to content

Commit 29b0908

Browse files
committed
Rollup merge of #32376 - cyplo:cyplo_fix_E0368_documentation, r=steveklabnik
Documentation fix for E0368 Made the 'good' example compile. I got to the [E0368 error page](https://doc.rust-lang.org/error-index.html#E0368) by following the link in the output of the compiler. My understanding is that the first example is 'bad' and the second one is 'good'. Following that logic, I pasted the second example into the file and to my surprise it did not compile. This commit fixes the example to make it paste-able. On the other hand the docstring contained `compile_fail` flag, which might indicate that this was intentional. I am also assuming here that the `Rust Compiler Error Index` page is generated from the file I changed. Please let me know what do you think. Thanks a lot !
2 parents 078b288 + 903bcb8 commit 29b0908

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_typeck/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,8 @@ x <<= 2;
31673167
To fix this error, please check that this type implements this binary
31683168
operation. Example:
31693169
3170-
```compile_fail
3171-
let x = 12u32; // the `u32` type does implement the `ShlAssign` trait
3170+
```
3171+
let mut x = 12u32; // the `u32` type does implement the `ShlAssign` trait
31723172
31733173
x <<= 2; // ok!
31743174
```

0 commit comments

Comments
 (0)