Skip to content

Commit

Permalink
tweak error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed Aug 4, 2020
1 parent 06dbd06 commit 9127e27
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/librustc_typeck/lib.rs
Expand Up @@ -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;
}
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/async-await/issue-68523-start.rs
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions src/test/ui/async-await/issue-68523-start.stderr
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/rfc-2091-track-caller/error-with-start.rs
@@ -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());
}
4 changes: 2 additions & 2 deletions src/test/ui/rfc-2091-track-caller/error-with-start.stderr
@@ -1,12 +1,12 @@
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]
| ^^^^^^^^^^^^^^^
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

0 comments on commit 9127e27

Please sign in to comment.