Skip to content

Commit 90da7cd

Browse files
committed
Do not point at whole file missing fn main
Only point at the end of the crate. We could try making it point at the beginning of the crate, but that is confused with `DUMMY_SP`, causing the output to be *worse*. This change will make it so that VSCode will *not* underline the whole file when `main` is missing, so other errors will be visible.
1 parent 92b6955 commit 90da7cd

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

tests/ui/crashes/ice-6250.stderr

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
error[E0601]: `main` function not found in crate `ice_6250`
2-
--> $DIR/ice-6250.rs:4:1
2+
--> $DIR/ice-6250.rs:16:2
33
|
4-
LL | / pub struct Cache {
5-
LL | | data: Vec<i32>,
6-
LL | | }
7-
LL | |
8-
... |
9-
LL | | }
10-
LL | | }
11-
| |_^ consider adding a `main` function to `$DIR/ice-6250.rs`
4+
LL | }
5+
| ^ consider adding a `main` function to `$DIR/ice-6250.rs`
126

137
error[E0308]: mismatched types
148
--> $DIR/ice-6250.rs:12:14

tests/ui/crashes/ice-6251.stderr

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
error[E0601]: `main` function not found in crate `ice_6251`
2-
--> $DIR/ice-6251.rs:4:1
2+
--> $DIR/ice-6251.rs:6:2
33
|
4-
LL | / fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
5-
LL | | std::iter::empty()
6-
LL | | }
7-
| |_^ consider adding a `main` function to `$DIR/ice-6251.rs`
4+
LL | }
5+
| ^ consider adding a `main` function to `$DIR/ice-6251.rs`
86

97
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
108
--> $DIR/ice-6251.rs:4:45

0 commit comments

Comments
 (0)