File tree 1 file changed +4
-10
lines changed
src/librustc_error_codes/error_codes
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -5,14 +5,11 @@ Erroneous code examples:
5
5
``` compile_fail,E0759
6
6
use std::fmt::Debug;
7
7
8
- fn foo(x: &i32) -> impl Debug {
8
+ fn foo(x: &i32) -> impl Debug { // error!
9
9
x
10
10
}
11
- ```
12
11
13
- ``` compile_fail,E0759
14
- # use std::fmt::Debug;
15
- fn bar(x: &i32) -> Box<dyn Debug> {
12
+ fn bar(x: &i32) -> Box<dyn Debug> { // error!
16
13
Box::new(x)
17
14
}
18
15
```
@@ -21,14 +18,11 @@ These examples have the same semantics as the following:
21
18
22
19
``` compile_fail,E0759
23
20
# use std::fmt::Debug;
24
- fn foo(x: &i32) -> impl Debug + 'static {
21
+ fn foo(x: &i32) -> impl Debug + 'static { // ok!
25
22
x
26
23
}
27
- ```
28
24
29
- ``` compile_fail,E0759
30
- # use std::fmt::Debug;
31
- fn bar(x: &i32) -> Box<dyn Debug + 'static> {
25
+ fn bar(x: &i32) -> Box<dyn Debug + 'static> { // ok!
32
26
Box::new(x)
33
27
}
34
28
```
You can’t perform that action at this time.
0 commit comments