diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-06-07 01:06:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-07 01:06:55 +0200 |
| commit | 487200b4380b478a5052ab5bc14a63d03bd89b92 (patch) | |
| tree | 66314bbf9882c29571d0cb590d532e28f47f3be3 /compiler | |
| parent | d7d2548eb0b9e97976510410bf3d667dca44abc1 (diff) | |
| parent | 31eee595cf317d5a328356232016c8504dad9292 (diff) | |
| download | rust-487200b4380b478a5052ab5bc14a63d03bd89b92.tar.gz rust-487200b4380b478a5052ab5bc14a63d03bd89b92.zip | |
Rollup merge of #86077 - FabianWolff:issue-86061, r=GuillaumeGomez
Fix corrected example in E0759.md This pull request fixes #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``
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0759.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0759.md b/compiler/rustc_error_codes/src/error_codes/E0759.md index 2fe5ada257f..6b16a7d415a 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0759.md +++ b/compiler/rustc_error_codes/src/error_codes/E0759.md @@ -16,13 +16,13 @@ fn bar(x: &i32) -> Box<dyn Debug> { // error! Add `'static` requirement to fix them: -```compile_fail,E0759 +``` # use std::fmt::Debug; -fn foo(x: &i32) -> impl Debug + 'static { // ok! +fn foo(x: &'static i32) -> impl Debug + 'static { // ok! x } -fn bar(x: &i32) -> Box<dyn Debug + 'static> { // ok! +fn bar(x: &'static i32) -> Box<dyn Debug + 'static> { // ok! Box::new(x) } ``` |
