Skip to content

Commit 9127e27

Browse files
committed
tweak error message
1 parent 06dbd06 commit 9127e27

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/librustc_typeck/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: LocalDefId) {
285285
tcx.sess,
286286
span,
287287
E0752,
288-
"start is not allowed to be `async`"
288+
"`start` is not allowed to be `async`"
289289
)
290-
.span_label(span, "start is not allowed to be `async`")
290+
.span_label(span, "`start` is not allowed to be `async`")
291291
.emit();
292292
error = true;
293293
}
@@ -297,11 +297,11 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: LocalDefId) {
297297
tcx.sess
298298
.struct_span_err(
299299
attr.span,
300-
"start is not allowed to be `#[track_caller]`",
300+
"`start` is not allowed to be `#[track_caller]`",
301301
)
302302
.span_label(
303303
start_span,
304-
"start is not allowed to be `#[track_caller]`",
304+
"`start` is not allowed to be `#[track_caller]`",
305305
)
306306
.emit();
307307
error = true;

src/test/ui/async-await/issue-68523-start.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

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

src/test/ui/async-await/issue-68523-start.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
error[E0752]: start is not allowed to be `async`
1+
error[E0752]: `start` is not allowed to be `async`
22
--> $DIR/issue-68523-start.rs:6:1
33
|
44
LL | pub async fn start(_: isize, _: *const *const u8) -> isize {
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ start is not allowed to be `async`
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `start` is not allowed to be `async`
66

77
error: aborting due to previous error
88

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#![feature(start)]
22

33
#[start]
4-
#[track_caller] //~ ERROR start is not allowed to be `#[track_caller]`
4+
#[track_caller] //~ ERROR `start` is not allowed to be `#[track_caller]`
55
fn start(_argc: isize, _argv: *const *const u8) -> isize {
66
panic!("{}: oh no", std::panic::Location::caller());
77
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
error: start is not allowed to be `#[track_caller]`
1+
error: `start` is not allowed to be `#[track_caller]`
22
--> $DIR/error-with-start.rs:4:1
33
|
44
LL | #[track_caller]
55
| ^^^^^^^^^^^^^^^
66
LL | / fn start(_argc: isize, _argv: *const *const u8) -> isize {
77
LL | | panic!("{}: oh no", std::panic::Location::caller());
88
LL | | }
9-
| |_- start is not allowed to be `#[track_caller]`
9+
| |_- `start` is not allowed to be `#[track_caller]`
1010

1111
error: aborting due to previous error
1212

0 commit comments

Comments
 (0)