Skip to content

Commit d7ee065

Browse files
committed
chore(rustup): Update for structured errors rust-lang/rust#30542
1 parent 76f62e7 commit d7ee065

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

quasi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "quasi"
3-
version = "0.3.11"
3+
version = "0.3.12"
44
authors = ["Erick Tryzelaar <[email protected]>"]
55
license = "MIT/Apache-2.0"
66
description = "A quasi-quoting macro system"

quasi/src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,20 @@ impl<'a> ExtParseUtils for ExtCtxt<'a> {
329329
}
330330
}
331331

332+
// A variant of 'try!' that panics on an Err. This is used as a crutch on the
333+
// way towards a non-panic!-prone parser. It should be used for fatal parsing
334+
// errors; eventually we plan to convert all code using panictry to just use
335+
// normal try.
332336
macro_rules! panictry {
333337
($e:expr) => ({
338+
use std::result::Result::{Ok, Err};
339+
use syntax::errors::FatalError;
334340
match $e {
335341
Ok(e) => e,
336-
Err(err) => panic!(err)
342+
Err(mut e) => {
343+
e.emit();
344+
panic!(FatalError);
345+
}
337346
}
338347
})
339348
}

0 commit comments

Comments
 (0)