Add backticks to main not found errors.

This commit is contained in:
Eric Huss 2018-03-13 11:22:43 -07:00
parent b08e6d305f
commit 2f1b34cc15
11 changed files with 15 additions and 15 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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)]

View File

@ -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

View File

@ -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() { }

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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'