Skip to content

Commit

Permalink
Do not point at whole file missing fn main
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
estebank committed Mar 5, 2022
1 parent 92b6955 commit 90da7cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
12 changes: 3 additions & 9 deletions tests/ui/crashes/ice-6250.stderr
@@ -1,14 +1,8 @@
error[E0601]: `main` function not found in crate `ice_6250`
--> $DIR/ice-6250.rs:4:1
--> $DIR/ice-6250.rs:16:2
|
LL | / pub struct Cache {
LL | | data: Vec<i32>,
LL | | }
LL | |
... |
LL | | }
LL | | }
| |_^ consider adding a `main` function to `$DIR/ice-6250.rs`
LL | }
| ^ consider adding a `main` function to `$DIR/ice-6250.rs`

error[E0308]: mismatched types
--> $DIR/ice-6250.rs:12:14
Expand Down
8 changes: 3 additions & 5 deletions tests/ui/crashes/ice-6251.stderr
@@ -1,10 +1,8 @@
error[E0601]: `main` function not found in crate `ice_6251`
--> $DIR/ice-6251.rs:4:1
--> $DIR/ice-6251.rs:6:2
|
LL | / fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
LL | | std::iter::empty()
LL | | }
| |_^ consider adding a `main` function to `$DIR/ice-6251.rs`
LL | }
| ^ consider adding a `main` function to `$DIR/ice-6251.rs`

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

0 comments on commit 90da7cd

Please sign in to comment.