tweak error message

This commit is contained in:
Bastian Kauschke 2020-08-04 21:36:21 +02:00
parent 06dbd06e4d
commit 9127e27cec
5 changed files with 10 additions and 10 deletions

View File

@ -285,9 +285,9 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: LocalDefId) {
tcx.sess,
span,
E0752,
"start is not allowed to be `async`"
"`start` is not allowed to be `async`"
)
.span_label(span, "start is not allowed to be `async`")
.span_label(span, "`start` is not allowed to be `async`")
.emit();
error = true;
}
@ -297,11 +297,11 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: LocalDefId) {
tcx.sess
.struct_span_err(
attr.span,
"start is not allowed to be `#[track_caller]`",
"`start` is not allowed to be `#[track_caller]`",
)
.span_label(
start_span,
"start is not allowed to be `#[track_caller]`",
"`start` is not allowed to be `#[track_caller]`",
)
.emit();
error = true;

View File

@ -4,6 +4,6 @@
#[start]
pub async fn start(_: isize, _: *const *const u8) -> isize {
//~^ ERROR start is not allowed to be `async`
//~^ ERROR `start` is not allowed to be `async`
0
}

View File

@ -1,8 +1,8 @@
error[E0752]: start is not allowed to be `async`
error[E0752]: `start` is not allowed to be `async`
--> $DIR/issue-68523-start.rs:6:1
|
LL | pub async fn start(_: isize, _: *const *const u8) -> isize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ start is not allowed to be `async`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `start` is not allowed to be `async`
error: aborting due to previous error

View File

@ -1,7 +1,7 @@
#![feature(start)]
#[start]
#[track_caller] //~ ERROR start is not allowed to be `#[track_caller]`
#[track_caller] //~ ERROR `start` is not allowed to be `#[track_caller]`
fn start(_argc: isize, _argv: *const *const u8) -> isize {
panic!("{}: oh no", std::panic::Location::caller());
}

View File

@ -1,4 +1,4 @@
error: start is not allowed to be `#[track_caller]`
error: `start` is not allowed to be `#[track_caller]`
--> $DIR/error-with-start.rs:4:1
|
LL | #[track_caller]
@ -6,7 +6,7 @@ LL | #[track_caller]
LL | / fn start(_argc: isize, _argv: *const *const u8) -> isize {
LL | | panic!("{}: oh no", std::panic::Location::caller());
LL | | }
| |_- start is not allowed to be `#[track_caller]`
| |_- `start` is not allowed to be `#[track_caller]`
error: aborting due to previous error