From 7b40f5139eadf9353f271df9ab53a9354015d028 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sat, 2 Jan 2016 22:49:43 +0100 Subject: [PATCH 1/2] chore(rustup): Update for structured errors rust-lang/rust#30542 --- quasi/src/lib.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/quasi/src/lib.rs b/quasi/src/lib.rs index 36d9829a..ced924f7 100644 --- a/quasi/src/lib.rs +++ b/quasi/src/lib.rs @@ -329,11 +329,20 @@ impl<'a> ExtParseUtils for ExtCtxt<'a> { } } +// A variant of 'try!' that panics on an Err. This is used as a crutch on the +// way towards a non-panic!-prone parser. It should be used for fatal parsing +// errors; eventually we plan to convert all code using panictry to just use +// normal try. macro_rules! panictry { ($e:expr) => ({ + use std::result::Result::{Ok, Err}; + use syntax::errors::FatalError; match $e { Ok(e) => e, - Err(err) => panic!(err) + Err(mut e) => { + e.emit(); + panic!(FatalError); + } } }) } From b50279096a7dd95462c0e5ce24d873d6817d8ed0 Mon Sep 17 00:00:00 2001 From: Piotr Czarnecki Date: Sat, 2 Jan 2016 22:50:03 +0100 Subject: [PATCH 2/2] chore(cargo): Version bump --- quasi/Cargo.toml | 2 +- quasi_codegen/Cargo.toml | 6 +++--- quasi_macros/Cargo.toml | 2 +- quasi_tests/Cargo.toml | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/quasi/Cargo.toml b/quasi/Cargo.toml index c6fc0c67..34ca6066 100644 --- a/quasi/Cargo.toml +++ b/quasi/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi" -version = "0.3.11" +version = "0.3.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" diff --git a/quasi_codegen/Cargo.toml b/quasi_codegen/Cargo.toml index 4f27d57f..d55ba7b6 100644 --- a/quasi_codegen/Cargo.toml +++ b/quasi_codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi_codegen" -version = "0.3.11" +version = "0.3.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" @@ -12,5 +12,5 @@ with-syntex = ["syntex", "syntex_syntax", "aster/with-syntex"] [dependencies] aster = { version = "^0.9.2", default-features = false } -syntex = { version = "^0.24.0", optional = true } -syntex_syntax = { version = "^0.24.0", optional = true } +syntex = { version = "^0.25.0", optional = true } +syntex_syntax = { version = "^0.25.0", optional = true } diff --git a/quasi_macros/Cargo.toml b/quasi_macros/Cargo.toml index 3ace0a1b..78119f46 100644 --- a/quasi_macros/Cargo.toml +++ b/quasi_macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quasi_macros" -version = "0.3.11" +version = "0.3.12" authors = ["Erick Tryzelaar "] license = "MIT/Apache-2.0" description = "A quasi-quoting macro system" diff --git a/quasi_tests/Cargo.toml b/quasi_tests/Cargo.toml index 67964621..5b65d3ec 100644 --- a/quasi_tests/Cargo.toml +++ b/quasi_tests/Cargo.toml @@ -9,10 +9,10 @@ build = "build.rs" [build-dependencies] quasi_codegen = { version = "*", path = "../quasi_codegen" } -syntex = { version = "^0.24.0" } +syntex = { version = "^0.25.0" } [dev-dependencies] aster = { version = "^0.9.2", features = ["with-syntex"] } quasi = { version = "*", path = "../quasi", features = ["with-syntex"] } -syntex = { version = "^0.24.0" } -syntex_syntax = { version = "^0.24.0" } +syntex = { version = "^0.25.0" } +syntex_syntax = { version = "^0.25.0" }