about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorTyler Mandry <tmandry@gmail.com>2019-11-01 11:20:24 -0700
committerGitHub <noreply@github.com>2019-11-01 11:20:24 -0700
commit1ea66850af013e03295c1ad5e46802dfea4a53bd (patch)
treede8ed72e3ebde10d8027b566086eacca32671f4a /src/libsyntax/parse/parser
parent959a5638031875cda1603a8fd92518753016d51d (diff)
parentfcbf77ef161435705fb47f63bad5e9d9e54a6980 (diff)
downloadrust-1ea66850af013e03295c1ad5e46802dfea4a53bd.tar.gz
rust-1ea66850af013e03295c1ad5e46802dfea4a53bd.zip
Rollup merge of #65995 - GuillaumeGomez:add-err-code-E0743, r=estebank
Add error code E0743 for "C-variadic has been used on a non-foreign function"

Fixes https://github.com/rust-lang/rust/issues/65967
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/ty.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs
index 86c94b680b2..e8f718a2483 100644
--- a/src/libsyntax/parse/parser/ty.rs
+++ b/src/libsyntax/parse/parser/ty.rs
@@ -197,8 +197,11 @@ impl<'a> Parser<'a> {
                 self.eat(&token::DotDotDot);
                 TyKind::CVarArgs
             } else {
-                return Err(self.fatal(
-                    "only foreign functions are allowed to be C-variadic"
+                return Err(struct_span_fatal!(
+                    self.sess.span_diagnostic,
+                    self.token.span,
+                    E0743,
+                    "only foreign functions are allowed to be C-variadic",
                 ));
             }
         } else {