Skip to content

Commit 9540901

Browse files
nikomatsakisgaurikholkar
authored andcommitted
remove fn main() { } from extended errors
1 parent aebc4e0 commit 9540901

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/librustc/diagnostics.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,8 +1963,6 @@ fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 { // explicit lifetime required
19631963
// in the type of `y`
19641964
if x > y { x } else { y }
19651965
}
1966-
1967-
fn main () { }
19681966
```
19691967
19701968
Here, the function is returning data borrowed from either x or y, but the
@@ -1975,16 +1973,14 @@ the signature match the body by changing the type of y to &'a i32, like so:
19751973
fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
19761974
if x > y { x } else { y }
19771975
}
1978-
1979-
fn main () { }
19801976
```
1977+
19811978
Alternatively, you could change the body not to return data from y:
1979+
19821980
```
19831981
fn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {
19841982
x
19851983
}
1986-
1987-
fn main () { }
19881984
```
19891985
"##,
19901986

0 commit comments

Comments
 (0)