about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Kuber <esteban@kuber.com.ar>2022-01-21 00:15:39 +0000
committerEsteban Kuber <esteban@kuber.com.ar>2022-03-05 02:42:55 +0000
commit90da7cdd41e1952e30981ad1047c1e493458e92d (patch)
treee5c3ed29568a358efe3c989dc0bf86121fb11883
parent92b6955b12a11d8c1e60fc08e8245d5d55f3a4fb (diff)
downloadrust-90da7cdd41e1952e30981ad1047c1e493458e92d.tar.gz
rust-90da7cdd41e1952e30981ad1047c1e493458e92d.zip
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.
-rw-r--r--tests/ui/crashes/ice-6250.stderr12
-rw-r--r--tests/ui/crashes/ice-6251.stderr8
2 files changed, 6 insertions, 14 deletions
diff --git a/tests/ui/crashes/ice-6250.stderr b/tests/ui/crashes/ice-6250.stderr
index 7ffbd7a64b3..878897c410c 100644
--- a/tests/ui/crashes/ice-6250.stderr
+++ b/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
diff --git a/tests/ui/crashes/ice-6251.stderr b/tests/ui/crashes/ice-6251.stderr
index 14c71e884b6..77a3c2ba4ad 100644
--- a/tests/ui/crashes/ice-6251.stderr
+++ b/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