mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add backticks to main
not found errors.
This commit is contained in:
parent
b08e6d305f
commit
2f1b34cc15
@ -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 \
|
||||
|
@ -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
|
||||
|
@ -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)]
|
||||
|
@ -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
|
||||
|
@ -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() { }
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user