Skip to content

Commit 31eee59

Browse files
committed
Fix corrected example in E0759.md
1 parent f57d5ba commit 31eee59

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)