diff options
| author | Eric Huss <eric@huss.org> | 2018-03-13 11:22:43 -0700 |
|---|---|---|
| committer | Eric Huss <eric@huss.org> | 2018-03-14 12:23:29 -0700 |
| commit | 2f1b34cc15d9ce8daecfb7855957a36e6e10f2e5 (patch) | |
| tree | c8a1b683eb3572c811c667030263583eee74ab60 | |
| parent | b08e6d305f8366c8fa7e08d829bb0c6939124759 (diff) | |
| download | rust-2f1b34cc15d9ce8daecfb7855957a36e6e10f2e5.tar.gz rust-2f1b34cc15d9ce8daecfb7855957a36e6e10f2e5.zip | |
Add backticks to `main` not found errors.
| -rw-r--r-- | src/librustc/middle/entry.rs | 4 | ||||
| -rw-r--r-- | src/test/compile-fail/cfg-attr-cfg-2.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/cfg-in-crate-1.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/elided-test.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/missing-main.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/error-codes/E0601.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-bench.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-test.rs | 2 | ||||
| -rw-r--r-- | src/test/ui/feature-gate/issue-43106-gating-of-test.stderr | 4 | ||||
| -rw-r--r-- | src/test/ui/main-wrong-location.stderr | 2 |
11 files changed, 15 insertions, 15 deletions
diff --git a/src/librustc/middle/entry.rs b/src/librustc/middle/entry.rs index 8193aad7627..37d79f408f3 100644 --- a/src/librustc/middle/entry.rs +++ b/src/librustc/middle/entry.rs @@ -165,7 +165,7 @@ fn configure_main(this: &mut EntryContext, crate_name: &str) { } else { // No main function let mut err = struct_err!(this.session, E0601, - "main function not found in crate {}", crate_name); + "`main` function not found in crate `{}`", crate_name); if !this.non_main_fns.is_empty() { // There were some functions named 'main' though. Try to give the user a hint. err.note("the main function must be defined at the crate level \ @@ -179,7 +179,7 @@ fn configure_main(this: &mut EntryContext, crate_name: &str) { this.session.abort_if_errors(); } else { if let Some(ref filename) = this.session.local_crate_source_file { - err.note(&format!("consider adding a main function to {}", filename.display())); + err.note(&format!("consider adding a `main` function to `{}`", filename.display())); } if this.session.teach(&err.get_code().unwrap()) { err.note("If you don't know the basics of Rust, you can go look to the Rust Book \ diff --git a/src/test/compile-fail/cfg-attr-cfg-2.rs b/src/test/compile-fail/cfg-attr-cfg-2.rs index b71a3be5dce..58a62d45ea5 100644 --- a/src/test/compile-fail/cfg-attr-cfg-2.rs +++ b/src/test/compile-fail/cfg-attr-cfg-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. // -// error-pattern: main function not found +// error-pattern: `main` function not found // compile-flags: --cfg foo // main is conditionally compiled, but the conditional compilation diff --git a/src/test/compile-fail/cfg-in-crate-1.rs b/src/test/compile-fail/cfg-in-crate-1.rs index 94ae8d89b4f..bbccf2bcd0f 100644 --- a/src/test/compile-fail/cfg-in-crate-1.rs +++ b/src/test/compile-fail/cfg-in-crate-1.rs @@ -8,6 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:main function not found +// error-pattern: `main` function not found #![cfg(bar)] diff --git a/src/test/compile-fail/elided-test.rs b/src/test/compile-fail/elided-test.rs index b62214b12f9..0cdd0010a74 100644 --- a/src/test/compile-fail/elided-test.rs +++ b/src/test/compile-fail/elided-test.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: main function not found +// error-pattern: `main` function not found // Since we're not compiling a test runner this function should be elided // and the build will fail because main doesn't exist diff --git a/src/test/compile-fail/missing-main.rs b/src/test/compile-fail/missing-main.rs index 4bfdaf69480..2788a5c2d58 100644 --- a/src/test/compile-fail/missing-main.rs +++ b/src/test/compile-fail/missing-main.rs @@ -8,5 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern:main function not found +// error-pattern: `main` function not found fn mian() { } diff --git a/src/test/ui/error-codes/E0601.stderr b/src/test/ui/error-codes/E0601.stderr index eff0a329902..6fe05d2dc8e 100644 --- a/src/test/ui/error-codes/E0601.stderr +++ b/src/test/ui/error-codes/E0601.stderr @@ -1,6 +1,6 @@ -error[E0601]: main function not found in crate E0601 +error[E0601]: `main` function not found in crate `E0601` | - = note: consider adding a main function to $DIR/E0601.rs + = note: consider adding a `main` function to `$DIR/E0601.rs` error: aborting due to previous error diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-bench.rs b/src/test/ui/feature-gate/issue-43106-gating-of-bench.rs index a34f98f0355..6c226799338 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-bench.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-bench.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: main function not found +// error-pattern: `main` function not found // At time of authorship, a crate-level #![bench] with no `--test` // will cause compilation to error unconditionally with "main function diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr index 32ee8026197..503ef020d96 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-bench.stderr @@ -1,6 +1,6 @@ -error[E0601]: main function not found in crate issue_43106_gating_of_bench +error[E0601]: `main` function not found in crate `issue_43106_gating_of_bench` | - = note: consider adding a main function to $DIR/issue-43106-gating-of-bench.rs + = note: consider adding a `main` function to `$DIR/issue-43106-gating-of-bench.rs` error: aborting due to previous error diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-test.rs b/src/test/ui/feature-gate/issue-43106-gating-of-test.rs index adcbfe77280..06632396249 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-test.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-test.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: main function not found +// error-pattern: `main` function not found // At time of authorship, crate-level #[test] attribute with no // `--test` signals unconditional error complaining of missing main diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr b/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr index b86dd834d9a..2ab35be43c5 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr +++ b/src/test/ui/feature-gate/issue-43106-gating-of-test.stderr @@ -1,6 +1,6 @@ -error[E0601]: main function not found in crate issue_43106_gating_of_test +error[E0601]: `main` function not found in crate `issue_43106_gating_of_test` | - = note: consider adding a main function to $DIR/issue-43106-gating-of-test.rs + = note: consider adding a `main` function to `$DIR/issue-43106-gating-of-test.rs` error: aborting due to previous error diff --git a/src/test/ui/main-wrong-location.stderr b/src/test/ui/main-wrong-location.stderr index c5affade5e2..a5ef92f14bb 100644 --- a/src/test/ui/main-wrong-location.stderr +++ b/src/test/ui/main-wrong-location.stderr @@ -1,4 +1,4 @@ -error[E0601]: main function not found in crate main_wrong_location +error[E0601]: `main` function not found in crate `main_wrong_location` | = note: the main function must be defined at the crate level but you have one or more functions named 'main' that are not defined at the crate level. Either move the definition or attach the `#[main]` attribute to override this behavior. note: here is a function named 'main' |
