mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Fallout in libsyntax
This commit is contained in:
parent
d9530c01a7
commit
49b76a087b
@ -15,7 +15,7 @@ pub use self::AbiArchitecture::*;
|
|||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
|
||||||
#[derive(Copy, PartialEq, Eq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum Os {
|
pub enum Os {
|
||||||
OsWindows,
|
OsWindows,
|
||||||
OsMacos,
|
OsMacos,
|
||||||
@ -49,7 +49,7 @@ pub enum Abi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(non_camel_case_types)]
|
#[allow(non_camel_case_types)]
|
||||||
#[derive(Copy, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||||
pub enum Architecture {
|
pub enum Architecture {
|
||||||
X86,
|
X86,
|
||||||
X86_64,
|
X86_64,
|
||||||
@ -58,7 +58,7 @@ pub enum Architecture {
|
|||||||
Mipsel
|
Mipsel
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct AbiData {
|
pub struct AbiData {
|
||||||
abi: Abi,
|
abi: Abi,
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ pub struct AbiData {
|
|||||||
name: &'static str,
|
name: &'static str,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum AbiArchitecture {
|
pub enum AbiArchitecture {
|
||||||
/// Not a real ABI (e.g., intrinsic)
|
/// Not a real ABI (e.g., intrinsic)
|
||||||
RustArch,
|
RustArch,
|
||||||
|
@ -40,7 +40,7 @@ use visit;
|
|||||||
/// - The default implementation for a trait method.
|
/// - The default implementation for a trait method.
|
||||||
///
|
///
|
||||||
/// To construct one, use the `Code::from_node` function.
|
/// To construct one, use the `Code::from_node` function.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct FnLikeNode<'a> { node: ast_map::Node<'a> }
|
pub struct FnLikeNode<'a> { node: ast_map::Node<'a> }
|
||||||
|
|
||||||
/// MaybeFnLike wraps a method that indicates if an object
|
/// MaybeFnLike wraps a method that indicates if an object
|
||||||
@ -80,7 +80,7 @@ impl MaybeFnLike for ast::Expr {
|
|||||||
/// Carries either an FnLikeNode or a Block, as these are the two
|
/// Carries either an FnLikeNode or a Block, as these are the two
|
||||||
/// constructs that correspond to "code" (as in, something from which
|
/// constructs that correspond to "code" (as in, something from which
|
||||||
/// we can construct a control-flow graph).
|
/// we can construct a control-flow graph).
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum Code<'a> {
|
pub enum Code<'a> {
|
||||||
FnLikeCode(FnLikeNode<'a>),
|
FnLikeCode(FnLikeNode<'a>),
|
||||||
BlockCode(&'a Block),
|
BlockCode(&'a Block),
|
||||||
|
@ -90,7 +90,7 @@ pub fn path_to_string<PI: Iterator<Item=PathElem>>(path: PI) -> String {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Debug)]
|
#[derive(Copy, Clone, Debug)]
|
||||||
pub enum Node<'ast> {
|
pub enum Node<'ast> {
|
||||||
NodeItem(&'ast Item),
|
NodeItem(&'ast Item),
|
||||||
NodeForeignItem(&'ast ForeignItem),
|
NodeForeignItem(&'ast ForeignItem),
|
||||||
|
@ -291,7 +291,7 @@ pub fn empty_generics() -> Generics {
|
|||||||
// ______________________________________________________________________
|
// ______________________________________________________________________
|
||||||
// Enumerating the IDs which appear in an AST
|
// Enumerating the IDs which appear in an AST
|
||||||
|
|
||||||
#[derive(RustcEncodable, RustcDecodable, Debug, Copy)]
|
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug)]
|
||||||
pub struct IdRange {
|
pub struct IdRange {
|
||||||
pub min: NodeId,
|
pub min: NodeId,
|
||||||
pub max: NodeId,
|
pub max: NodeId,
|
||||||
|
@ -282,7 +282,7 @@ pub fn find_crate_name(attrs: &[Attribute]) -> Option<InternedString> {
|
|||||||
first_attr_value_str_by_name(attrs, "crate_name")
|
first_attr_value_str_by_name(attrs, "crate_name")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum InlineAttr {
|
pub enum InlineAttr {
|
||||||
None,
|
None,
|
||||||
Hint,
|
Hint,
|
||||||
@ -571,7 +571,7 @@ fn int_type_of_word(s: &str) -> Option<IntType> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy)]
|
#[derive(PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
|
||||||
pub enum ReprAttr {
|
pub enum ReprAttr {
|
||||||
ReprAny,
|
ReprAny,
|
||||||
ReprInt(Span, IntType),
|
ReprInt(Span, IntType),
|
||||||
@ -590,7 +590,7 @@ impl ReprAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Eq, Hash, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy)]
|
#[derive(Eq, Hash, PartialEq, Debug, RustcEncodable, RustcDecodable, Copy, Clone)]
|
||||||
pub enum IntType {
|
pub enum IntType {
|
||||||
SignedInt(ast::IntTy),
|
SignedInt(ast::IntTy),
|
||||||
UnsignedInt(ast::UintTy)
|
UnsignedInt(ast::UintTy)
|
||||||
|
@ -47,7 +47,7 @@ pub struct BytePos(pub u32);
|
|||||||
/// A character offset. Because of multibyte utf8 characters, a byte offset
|
/// A character offset. Because of multibyte utf8 characters, a byte offset
|
||||||
/// is not equivalent to a character offset. The CodeMap will convert BytePos
|
/// is not equivalent to a character offset. The CodeMap will convert BytePos
|
||||||
/// values to CharPos values as necessary.
|
/// values to CharPos values as necessary.
|
||||||
#[derive(Copy, PartialEq, Hash, PartialOrd, Debug)]
|
#[derive(Copy, Clone, PartialEq, Hash, PartialOrd, Debug)]
|
||||||
pub struct CharPos(pub usize);
|
pub struct CharPos(pub usize);
|
||||||
|
|
||||||
// FIXME: Lots of boilerplate in these impls, but so far my attempts to fix
|
// FIXME: Lots of boilerplate in these impls, but so far my attempts to fix
|
||||||
@ -305,7 +305,7 @@ pub struct FileLines {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Identifies an offset of a multi-byte character in a FileMap
|
/// Identifies an offset of a multi-byte character in a FileMap
|
||||||
#[derive(Copy, RustcEncodable, RustcDecodable, Eq, PartialEq)]
|
#[derive(Copy, Clone, RustcEncodable, RustcDecodable, Eq, PartialEq)]
|
||||||
pub struct MultiByteChar {
|
pub struct MultiByteChar {
|
||||||
/// The absolute offset of the character in the CodeMap
|
/// The absolute offset of the character in the CodeMap
|
||||||
pub pos: BytePos,
|
pub pos: BytePos,
|
||||||
|
@ -71,12 +71,12 @@ pub trait Emitter {
|
|||||||
/// This structure is used to signify that a task has panicked with a fatal error
|
/// 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
|
/// from the diagnostics. You can use this with the `Any` trait to figure out
|
||||||
/// how a rustc task died (if so desired).
|
/// how a rustc task died (if so desired).
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct FatalError;
|
pub struct FatalError;
|
||||||
|
|
||||||
/// Signifies that the compiler died with an explicit call to `.bug`
|
/// Signifies that the compiler died with an explicit call to `.bug`
|
||||||
/// or `.span_bug` rather than a failed assertion, etc.
|
/// or `.span_bug` rather than a failed assertion, etc.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct ExplicitBug;
|
pub struct ExplicitBug;
|
||||||
|
|
||||||
/// A span-handler is like a handler but also
|
/// A span-handler is like a handler but also
|
||||||
|
@ -318,7 +318,7 @@ impl MacResult for MacEager {
|
|||||||
|
|
||||||
/// Fill-in macro expansion result, to allow compilation to continue
|
/// Fill-in macro expansion result, to allow compilation to continue
|
||||||
/// after hitting errors.
|
/// after hitting errors.
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct DummyResult {
|
pub struct DummyResult {
|
||||||
expr_only: bool,
|
expr_only: bool,
|
||||||
span: Span
|
span: Span
|
||||||
|
@ -84,7 +84,7 @@ pub fn expand_deriving_ord<F>(cx: &mut ExtCtxt,
|
|||||||
trait_def.expand(cx, mitem, item, push)
|
trait_def.expand(cx, mitem, item, push)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum OrderingOp {
|
pub enum OrderingOp {
|
||||||
PartialCmpOp, LtOp, LeOp, GtOp, GeOp,
|
PartialCmpOp, LtOp, LeOp, GtOp, GeOp,
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ pub struct SCTable {
|
|||||||
rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
|
rename_memo: RefCell<HashMap<(SyntaxContext,Ident,Name),SyntaxContext>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]
|
#[derive(PartialEq, RustcEncodable, RustcDecodable, Hash, Debug, Copy, Clone)]
|
||||||
pub enum SyntaxContext_ {
|
pub enum SyntaxContext_ {
|
||||||
EmptyCtxt,
|
EmptyCtxt,
|
||||||
Mark (Mrk,SyntaxContext),
|
Mark (Mrk,SyntaxContext),
|
||||||
|
@ -286,7 +286,7 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
|
|||||||
("recursion_limit", CrateLevel),
|
("recursion_limit", CrateLevel),
|
||||||
];
|
];
|
||||||
|
|
||||||
#[derive(PartialEq, Copy, Debug)]
|
#[derive(PartialEq, Copy, Clone, Debug)]
|
||||||
pub enum AttributeType {
|
pub enum AttributeType {
|
||||||
/// Normal, builtin attribute that is consumed
|
/// Normal, builtin attribute that is consumed
|
||||||
/// by the compiler before the unused_attribute check
|
/// by the compiler before the unused_attribute check
|
||||||
|
@ -20,7 +20,7 @@ use parse::token;
|
|||||||
use ptr::P;
|
use ptr::P;
|
||||||
|
|
||||||
/// The specific types of unsupported syntax
|
/// The specific types of unsupported syntax
|
||||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum ObsoleteSyntax {
|
pub enum ObsoleteSyntax {
|
||||||
ClosureKind,
|
ClosureKind,
|
||||||
ExternCrateString,
|
ExternCrateString,
|
||||||
|
@ -96,7 +96,7 @@ type ItemInfo = (Ident, Item_, Option<Vec<Attribute> >);
|
|||||||
|
|
||||||
/// How to parse a path. There are four different kinds of paths, all of which
|
/// How to parse a path. There are four different kinds of paths, all of which
|
||||||
/// are parsed somewhat differently.
|
/// are parsed somewhat differently.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum PathParsingMode {
|
pub enum PathParsingMode {
|
||||||
/// A path with no type parameters; e.g. `foo::bar::Baz`
|
/// A path with no type parameters; e.g. `foo::bar::Baz`
|
||||||
NoTypesAllowed,
|
NoTypesAllowed,
|
||||||
@ -109,7 +109,7 @@ pub enum PathParsingMode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// How to parse a bound, whether to allow bound modifiers such as `?`.
|
/// How to parse a bound, whether to allow bound modifiers such as `?`.
|
||||||
#[derive(Copy, PartialEq)]
|
#[derive(Copy, Clone, PartialEq)]
|
||||||
pub enum BoundParsingMode {
|
pub enum BoundParsingMode {
|
||||||
Bare,
|
Bare,
|
||||||
Modified,
|
Modified,
|
||||||
|
@ -147,13 +147,13 @@ pub fn buf_str(toks: &[Token],
|
|||||||
s
|
s
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum PrintStackBreak {
|
pub enum PrintStackBreak {
|
||||||
Fits,
|
Fits,
|
||||||
Broken(Breaks),
|
Broken(Breaks),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct PrintStackElem {
|
pub struct PrintStackElem {
|
||||||
offset: isize,
|
offset: isize,
|
||||||
pbreak: PrintStackBreak
|
pbreak: PrintStackBreak
|
||||||
|
@ -46,12 +46,12 @@ pub trait PpAnn {
|
|||||||
fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> { Ok(()) }
|
fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> { Ok(()) }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct NoAnn;
|
pub struct NoAnn;
|
||||||
|
|
||||||
impl PpAnn for NoAnn {}
|
impl PpAnn for NoAnn {}
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub struct CurrentCommentAndLiteral {
|
pub struct CurrentCommentAndLiteral {
|
||||||
cur_cmnt: usize,
|
cur_cmnt: usize,
|
||||||
cur_lit: usize,
|
cur_lit: usize,
|
||||||
|
@ -32,7 +32,7 @@ use codemap::Span;
|
|||||||
use ptr::P;
|
use ptr::P;
|
||||||
use owned_slice::OwnedSlice;
|
use owned_slice::OwnedSlice;
|
||||||
|
|
||||||
#[derive(Copy)]
|
#[derive(Copy, Clone)]
|
||||||
pub enum FnKind<'a> {
|
pub enum FnKind<'a> {
|
||||||
/// fn foo() or extern "Abi" fn foo()
|
/// fn foo() or extern "Abi" fn foo()
|
||||||
FkItemFn(Ident, &'a Generics, Unsafety, Abi),
|
FkItemFn(Ident, &'a Generics, Unsafety, Abi),
|
||||||
|
Loading…
Reference in New Issue
Block a user