diff options
| author | Phil Dawes <phil@phildawes.net> | 2015-03-28 21:58:51 +0000 |
|---|---|---|
| committer | Phil Dawes <phil@phildawes.net> | 2015-04-05 09:52:50 +0100 |
| commit | b2bcb7229a4bce0c9459807552d071eb2b2c9a0e (patch) | |
| tree | f08ef63bff0abde2d9bcce4eb751681df21b9b98 /src/librustc/session | |
| parent | f73f3233f10e506ec41c17126e66953ed6996feb (diff) | |
| download | rust-b2bcb7229a4bce0c9459807552d071eb2b2c9a0e.tar.gz rust-b2bcb7229a4bce0c9459807552d071eb2b2c9a0e.zip | |
Work towards a non-panicing parser (libsyntax)
- Functions in parser.rs return PResult<> rather than panicing - Other functions in libsyntax call panic! explicitly for now if they rely on panicing behaviour. - 'panictry!' macro added as scaffolding while converting panicing functions. (This does the same as 'unwrap()' but is easier to grep for and turn into try!()) - Leaves panicing wrappers for the following functions so that the quote_* macros behave the same: - parse_expr, parse_item, parse_pat, parse_arm, parse_ty, parse_stmt
Diffstat (limited to 'src/librustc/session')
| -rw-r--r-- | src/librustc/session/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 3e3e5e17963..452840310aa 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -68,13 +68,13 @@ impl Session { if self.opts.treat_err_as_bug { self.span_bug(sp, msg); } - self.diagnostic().span_fatal(sp, msg) + panic!(self.diagnostic().span_fatal(sp, msg)) } pub fn span_fatal_with_code(&self, sp: Span, msg: &str, code: &str) -> ! { if self.opts.treat_err_as_bug { self.span_bug(sp, msg); } - self.diagnostic().span_fatal_with_code(sp, msg, code) + panic!(self.diagnostic().span_fatal_with_code(sp, msg, code)) } pub fn fatal(&self, msg: &str) -> ! { if self.opts.treat_err_as_bug { |
