Rollup merge of #99360 - compiler-errors:issue-99331, r=fee1-dead
Do not ICE when we have `-Zunpretty=expanded` with invalid ABI Fixes #99331
This commit is contained in:
commit
f3a458f735
5 changed files with 33 additions and 6 deletions
|
@ -274,10 +274,12 @@ impl<'a> PostExpansionVisitor<'a> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
abi => {
|
abi => {
|
||||||
self.sess.parse_sess.span_diagnostic.delay_span_bug(
|
if self.sess.opts.pretty.map_or(true, |ppm| ppm.needs_hir()) {
|
||||||
span,
|
self.sess.parse_sess.span_diagnostic.delay_span_bug(
|
||||||
&format!("unrecognized ABI not caught in lowering: {}", abi),
|
span,
|
||||||
);
|
&format!("unrecognized ABI not caught in lowering: {}", abi),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2707,6 +2707,14 @@ impl PpMode {
|
||||||
| MirCFG => true,
|
| MirCFG => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
pub fn needs_hir(&self) -> bool {
|
||||||
|
use PpMode::*;
|
||||||
|
match *self {
|
||||||
|
Source(_) | AstTree(_) => false,
|
||||||
|
|
||||||
|
Hir(_) | HirTree | ThirTree | Mir | MirCFG => true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn needs_analysis(&self) -> bool {
|
pub fn needs_analysis(&self) -> bool {
|
||||||
use PpMode::*;
|
use PpMode::*;
|
||||||
|
|
13
src/test/ui/codemap_tests/unicode.expanded.stdout
Normal file
13
src/test/ui/codemap_tests/unicode.expanded.stdout
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#![feature(prelude_import)]
|
||||||
|
#![no_std]
|
||||||
|
#[prelude_import]
|
||||||
|
use ::std::prelude::rust_2015::*;
|
||||||
|
#[macro_use]
|
||||||
|
extern crate std;
|
||||||
|
// revisions: normal expanded
|
||||||
|
//[expanded] check-pass
|
||||||
|
//[expanded]compile-flags: -Zunpretty=expanded
|
||||||
|
|
||||||
|
extern "路濫狼á́́" fn foo() {}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -1,5 +1,5 @@
|
||||||
error[E0703]: invalid ABI: found `路濫狼á́́`
|
error[E0703]: invalid ABI: found `路濫狼á́́`
|
||||||
--> $DIR/unicode.rs:1:8
|
--> $DIR/unicode.rs:5:8
|
||||||
|
|
|
|
||||||
LL | extern "路濫狼á́́" fn foo() {}
|
LL | extern "路濫狼á́́" fn foo() {}
|
||||||
| ^^^^^^^^^ invalid ABI
|
| ^^^^^^^^^ invalid ABI
|
|
@ -1,3 +1,7 @@
|
||||||
extern "路濫狼á́́" fn foo() {} //~ ERROR invalid ABI
|
// revisions: normal expanded
|
||||||
|
//[expanded] check-pass
|
||||||
|
//[expanded]compile-flags: -Zunpretty=expanded
|
||||||
|
|
||||||
|
extern "路濫狼á́́" fn foo() {} //[normal]~ ERROR invalid ABI
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue