about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-07 06:18:47 +0200
committerMazdak Farrokhzad <twingoow@gmail.com>2019-10-07 06:18:47 +0200
commit9c6582a2c0c5a527e3fc3ce581244d85b3b71761 (patch)
treecf6964ee37e1efba89a8656fda4fde8125e01b18 /src/libsyntax/parse/parser
parenta7ba754b6c021bc6244cde8c52d3d0b352082560 (diff)
downloadrust-9c6582a2c0c5a527e3fc3ce581244d85b3b71761.tar.gz
rust-9c6582a2c0c5a527e3fc3ce581244d85b3b71761.zip
syntax: use `parse_extern_abi` more.
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/ty.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs
index c9446a880b0..018b5951e6e 100644
--- a/src/libsyntax/parse/parser/ty.rs
+++ b/src/libsyntax/parse/parser/ty.rs
@@ -9,8 +9,6 @@ use crate::parse::token::{self, Token};
 use crate::source_map::Span;
 use crate::symbol::{kw};
 
-use rustc_target::spec::abi::Abi;
-
 use errors::{Applicability, pluralise};
 
 /// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT<u8, u8>`,
@@ -281,12 +279,7 @@ impl<'a> Parser<'a> {
         */
 
         let unsafety = self.parse_unsafety();
-        let abi = if self.eat_keyword(kw::Extern) {
-            self.parse_opt_abi()?.unwrap_or(Abi::C)
-        } else {
-            Abi::Rust
-        };
-
+        let abi = self.parse_extern_abi()?;
         self.expect_keyword(kw::Fn)?;
         let cfg = super::ParamCfg {
             is_self_allowed: false,