提交 1b3a0300 编写于 作者: L lucy

syntax: Fix span on illegal ABI errors

Fixes #8537
Fixes #14499
上级 ff2bf58e
......@@ -4537,7 +4537,7 @@ fn parse_opt_abi(&mut self) -> Option<abi::Abi> {
Some(abi) => Some(abi),
None => {
self.span_err(
self.span,
self.last_span,
format!("illegal ABI: expected one of [{}], \
found `{}`",
abi::all_names().connect(", "),
......
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub extern
"invalid-abi" //~ ERROR illegal ABI
fn foo() {}
fn main() {}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册