mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add comments suggested by Niko
This commit is contained in:
parent
b2bcb7229a
commit
e3427c3c34
@ -68,9 +68,9 @@ pub trait Emitter {
|
||||
sp: RenderSpan, msg: &str, lvl: Level);
|
||||
}
|
||||
|
||||
/// This structure is used to signify that a task has panicked with a fatal error
|
||||
/// from the diagnostics. You can use this with the `Any` trait to figure out
|
||||
/// how a rustc task died (if so desired).
|
||||
/// Used as a return value to signify a fatal error occurred. (It is also
|
||||
/// used as the argument to panic at the moment, but that will eventually
|
||||
/// not be true.)
|
||||
#[derive(Copy, Clone)]
|
||||
#[must_use]
|
||||
pub struct FatalError;
|
||||
|
@ -23,17 +23,6 @@ use parse::token::InternedString;
|
||||
use parse::token;
|
||||
use ptr::P;
|
||||
|
||||
macro_rules! panictry {
|
||||
($e:expr) => ({
|
||||
use std::result::Result::{Ok, Err};
|
||||
|
||||
match $e {
|
||||
Ok(e) => e,
|
||||
Err(e) => panic!(e),
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
enum State {
|
||||
Asm,
|
||||
Outputs,
|
||||
|
@ -24,17 +24,6 @@ use ptr::P;
|
||||
use std::collections::HashMap;
|
||||
use std::iter::repeat;
|
||||
|
||||
macro_rules! panictry {
|
||||
($e:expr) => ({
|
||||
use std::result::Result::{Ok, Err};
|
||||
|
||||
match $e {
|
||||
Ok(e) => e,
|
||||
Err(e) => { panic!(e); }
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[derive(PartialEq)]
|
||||
enum ArgumentType {
|
||||
Known(String),
|
||||
|
@ -50,13 +50,17 @@ extern crate libc;
|
||||
|
||||
extern crate serialize as rustc_serialize; // used by deriving
|
||||
|
||||
// A variant of 'try!' that panics on Err(FatalError). 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 diagnostic::FatalError;
|
||||
match $e {
|
||||
Ok(e) => e,
|
||||
Err(e) => panic!(e)
|
||||
Err(FatalError) => panic!(FatalError)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user