tweak error message
This commit is contained in:
parent
06dbd06e4d
commit
9127e27cec
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user