diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-19 14:22:52 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-08-19 14:22:52 +0200 |
| commit | 46f2b410e0871587dde5e4375d23ebe332ec1176 (patch) | |
| tree | 1fde4a57a3f672ca02009273d87f90218af80ddd /src/librustc_error_codes/error_codes | |
| parent | 441fd2255763c2aeea616aeac61b2c795a4c5330 (diff) | |
| download | rust-46f2b410e0871587dde5e4375d23ebe332ec1176.tar.gz rust-46f2b410e0871587dde5e4375d23ebe332ec1176.zip | |
Clean up E0759 explanation
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0759.md | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/librustc_error_codes/error_codes/E0759.md b/src/librustc_error_codes/error_codes/E0759.md index a74759bdf63..2daaeba82f0 100644 --- a/src/librustc_error_codes/error_codes/E0759.md +++ b/src/librustc_error_codes/error_codes/E0759.md @@ -5,14 +5,11 @@ Erroneous code examples: ```compile_fail,E0759 use std::fmt::Debug; -fn foo(x: &i32) -> impl Debug { +fn foo(x: &i32) -> impl Debug { // error! x } -``` -```compile_fail,E0759 -# use std::fmt::Debug; -fn bar(x: &i32) -> Box<dyn Debug> { +fn bar(x: &i32) -> Box<dyn Debug> { // error! Box::new(x) } ``` @@ -21,14 +18,11 @@ These examples have the same semantics as the following: ```compile_fail,E0759 # use std::fmt::Debug; -fn foo(x: &i32) -> impl Debug + 'static { +fn foo(x: &i32) -> impl Debug + 'static { // ok! x } -``` -```compile_fail,E0759 -# use std::fmt::Debug; -fn bar(x: &i32) -> Box<dyn Debug + 'static> { +fn bar(x: &i32) -> Box<dyn Debug + 'static> { // ok! Box::new(x) } ``` |
