about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-08-19 14:22:52 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-08-19 14:22:52 +0200
commit46f2b410e0871587dde5e4375d23ebe332ec1176 (patch)
tree1fde4a57a3f672ca02009273d87f90218af80ddd /src/librustc_error_codes/error_codes
parent441fd2255763c2aeea616aeac61b2c795a4c5330 (diff)
downloadrust-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.md14
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)
 }
 ```