Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 487200b

Browse files
authoredJun 6, 2021
Rollup merge of rust-lang#86077 - FabianWolff:issue-86061, r=GuillaumeGomez
Fix corrected example in E0759.md This pull request fixes rust-lang#86061, which was probably caused by a copy-paste error, where the supposedly corrected code example was also marked with `compile_fail`. Thus, the fact that the "correct" example actually _isn't_ correct was not caught by the doc-tests. This pull request removes the incorrect `compile_fail` annotation and fixes the example. r? ``@GuillaumeGomez``
2 parents d7d2548 + 31eee59 commit 487200b

File tree

1 file changed

+3
-3
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+3
-3
lines changed
 

‎compiler/rustc_error_codes/src/error_codes/E0759.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ fn bar(x: &i32) -> Box<dyn Debug> { // error!
1616

1717
Add `'static` requirement to fix them:
1818

19-
```compile_fail,E0759
19+
```
2020
# use std::fmt::Debug;
21-
fn foo(x: &i32) -> impl Debug + 'static { // ok!
21+
fn foo(x: &'static i32) -> impl Debug + 'static { // ok!
2222
x
2323
}
2424
25-
fn bar(x: &i32) -> Box<dyn Debug + 'static> { // ok!
25+
fn bar(x: &'static i32) -> Box<dyn Debug + 'static> { // ok!
2626
Box::new(x)
2727
}
2828
```

0 commit comments

Comments
 (0)