Fallout out rustc
This commit is contained in:
parent
890ed5c468
commit
d9530c01a7
61 changed files with 173 additions and 171 deletions
|
@ -113,7 +113,7 @@ declare_lint! {
|
|||
}
|
||||
/// Does nothing as a lint pass, but registers some `Lint`s
|
||||
/// which are used by other parts of the compiler.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct HardwiredLints;
|
||||
|
||||
impl LintPass for HardwiredLints {
|
||||
|
|
|
@ -41,7 +41,7 @@ pub use lint::context::{Context, LintStore, raw_emit_lint, check_crate, gather_a
|
|||
GatherNodeLevels};
|
||||
|
||||
/// Specification of a single lint.
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct Lint {
|
||||
/// A string identifier for the lint.
|
||||
///
|
||||
|
|
|
@ -116,7 +116,7 @@ pub const tag_items_data_item_reexport_def_id: usize = 0x47;
|
|||
pub const tag_items_data_item_reexport_name: usize = 0x48;
|
||||
|
||||
// used to encode crate_ctxt side tables
|
||||
#[derive(Copy, PartialEq, FromPrimitive)]
|
||||
#[derive(Copy, Clone, PartialEq, FromPrimitive)]
|
||||
#[repr(usize)]
|
||||
pub enum astencode_tag { // Reserves 0x50 -- 0x6f
|
||||
tag_ast = 0x50,
|
||||
|
|
|
@ -29,7 +29,7 @@ use syntax::parse::token;
|
|||
|
||||
use std::collections::hash_map::HashMap;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct MethodInfo {
|
||||
pub name: ast::Name,
|
||||
pub def_id: ast::DefId,
|
||||
|
|
|
@ -21,7 +21,7 @@ use std::path::{Path, PathBuf};
|
|||
use util::fs as myfs;
|
||||
use session::search_paths::{SearchPaths, PathKind};
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum FileMatch {
|
||||
FileMatches,
|
||||
FileDoesntMatch,
|
||||
|
|
|
@ -43,7 +43,7 @@ use syntax::parse::token;
|
|||
// def-id will depend on where it originated from. Therefore, the conversion
|
||||
// function is given an indicator of the source of the def-id. See
|
||||
// astencode.rs for more information.
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum DefIdSource {
|
||||
// Identifies a struct, trait, enum, etc.
|
||||
NominalType,
|
||||
|
|
|
@ -25,7 +25,7 @@ struct CFGBuilder<'a, 'tcx: 'a> {
|
|||
loop_scopes: Vec<LoopScope>,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct LoopScope {
|
||||
loop_id: ast::NodeId, // id of loop/while node
|
||||
continue_index: CFGIndex, // where to go on a `loop`
|
||||
|
|
|
@ -24,7 +24,7 @@ pub struct CFG {
|
|||
pub exit: CFGIndex,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum CFGNodeData {
|
||||
AST(ast::NodeId),
|
||||
Entry,
|
||||
|
|
|
@ -76,7 +76,7 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Eq, PartialEq)]
|
||||
#[derive(Copy, Clone, Eq, PartialEq)]
|
||||
enum Mode {
|
||||
Const,
|
||||
Static,
|
||||
|
|
|
@ -21,7 +21,7 @@ enum Context {
|
|||
Normal, Loop, Closure
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct CheckLoopVisitor<'a> {
|
||||
sess: &'a Session,
|
||||
cx: Context
|
||||
|
|
|
@ -128,7 +128,7 @@ enum Usefulness {
|
|||
NotUseful
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum WitnessPreference {
|
||||
ConstructWitness,
|
||||
LeaveOutWitness
|
||||
|
|
|
@ -28,7 +28,7 @@ use syntax::visit;
|
|||
use syntax::print::{pp, pprust};
|
||||
use util::nodemap::NodeMap;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum EntryOrExit {
|
||||
Entry,
|
||||
Exit,
|
||||
|
|
|
@ -65,7 +65,7 @@ pub enum Def {
|
|||
/// <T as Trait>::AssocX::AssocY::MethodOrAssocType
|
||||
/// ^~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/// base_def depth = 2
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct PathResolution {
|
||||
pub base_def: Def,
|
||||
pub last_private: LastPrivate,
|
||||
|
@ -93,7 +93,7 @@ pub type DefMap = RefCell<NodeMap<PathResolution>>;
|
|||
// within.
|
||||
pub type ExportMap = NodeMap<Vec<Export>>;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Export {
|
||||
pub name: ast::Name, // The name of the target.
|
||||
pub def_id: ast::DefId, // The definition of the target.
|
||||
|
|
|
@ -22,7 +22,7 @@ use syntax::codemap::Span;
|
|||
use syntax::visit;
|
||||
use syntax::visit::Visitor;
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum UnsafeContext {
|
||||
SafeContext,
|
||||
UnsafeFn,
|
||||
|
|
|
@ -94,7 +94,7 @@ pub trait Delegate<'tcx> {
|
|||
mode: MutateMode);
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum LoanCause {
|
||||
ClosureCapture(Span),
|
||||
AddrOf,
|
||||
|
@ -106,20 +106,20 @@ pub enum LoanCause {
|
|||
MatchDiscriminant
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum ConsumeMode {
|
||||
Copy, // reference to x where x has a type that copies
|
||||
Move(MoveReason), // reference to x where x has a type that moves
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MoveReason {
|
||||
DirectRefMove,
|
||||
PatBindingMove,
|
||||
CaptureMove,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MatchMode {
|
||||
NonBindingMatch,
|
||||
BorrowingMatch,
|
||||
|
@ -127,7 +127,7 @@ pub enum MatchMode {
|
|||
MovingMatch,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
enum TrackMatchMode {
|
||||
Unknown,
|
||||
Definite(MatchMode),
|
||||
|
@ -194,14 +194,14 @@ impl TrackMatchMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MutateMode {
|
||||
Init,
|
||||
JustWrite, // x = y
|
||||
WriteAndRead, // x += y
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum OverloadedCallType {
|
||||
FnOverloadedCall,
|
||||
FnMutOverloadedCall,
|
||||
|
|
|
@ -66,13 +66,13 @@ pub struct NodeIndex(pub usize);
|
|||
#[allow(non_upper_case_globals)]
|
||||
pub const InvalidNodeIndex: NodeIndex = NodeIndex(usize::MAX);
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub struct EdgeIndex(pub usize);
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const InvalidEdgeIndex: EdgeIndex = EdgeIndex(usize::MAX);
|
||||
|
||||
// Use a private field here to guarantee no more instances are created:
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct Direction { repr: usize }
|
||||
#[allow(non_upper_case_globals)]
|
||||
pub const Outgoing: Direction = Direction { repr: 0 };
|
||||
|
|
|
@ -294,7 +294,7 @@ pub enum RegionVariableOrigin<'tcx> {
|
|||
BoundRegionInCoherence(ast::Name),
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum fixup_err {
|
||||
unresolved_int_ty(IntVid),
|
||||
unresolved_float_ty(FloatVid),
|
||||
|
|
|
@ -74,13 +74,13 @@ pub enum GenericKind<'tcx> {
|
|||
Projection(ty::ProjectionTy<'tcx>),
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct TwoRegions {
|
||||
a: Region,
|
||||
b: Region,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum UndoLogEntry {
|
||||
OpenSnapshot,
|
||||
CommitedSnapshot,
|
||||
|
@ -91,7 +91,7 @@ pub enum UndoLogEntry {
|
|||
AddCombination(CombineMapType, TwoRegions)
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum CombineMapType {
|
||||
Lub, Glb
|
||||
}
|
||||
|
@ -944,10 +944,10 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
|
|||
|
||||
// ______________________________________________________________________
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
enum Classification { Expanding, Contracting }
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum VarValue { NoValue, Value(Region), ErrorValue }
|
||||
|
||||
struct VarData {
|
||||
|
|
|
@ -47,7 +47,7 @@ struct Delegate<'tcx>(PhantomData<&'tcx ()>);
|
|||
|
||||
type Relation = (RelationDir, ty::TyVid);
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum RelationDir {
|
||||
SubtypeOf, SupertypeOf, EqTo, BiTo
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ pub struct Node<K:UnifyKey> {
|
|||
pub rank: usize,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Delegate<K>(PhantomData<K>);
|
||||
|
||||
// We can't use V:LatticeValue, much as I would like to,
|
||||
|
|
|
@ -46,7 +46,7 @@ macro_rules! lets_do_this {
|
|||
$( $variant:ident, $name:expr, $method:ident; )*
|
||||
) => {
|
||||
|
||||
#[derive(Copy, FromPrimitive, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, Clone, FromPrimitive, PartialEq, Eq, Hash)]
|
||||
pub enum LangItem {
|
||||
$($variant),*
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ enum LoopKind<'a> {
|
|||
WhileLoop(&'a Expr),
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
struct Variable(usize);
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
|
@ -159,7 +159,7 @@ impl Clone for LiveNode {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
enum LiveNodeKind {
|
||||
FreeVarNode(Span),
|
||||
ExprNode(Span),
|
||||
|
@ -245,13 +245,13 @@ struct CaptureInfo {
|
|||
var_nid: NodeId
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
struct LocalInfo {
|
||||
id: NodeId,
|
||||
ident: ast::Ident
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum VarKind {
|
||||
Arg(NodeId, ast::Ident),
|
||||
Local(LocalInfo),
|
||||
|
@ -534,7 +534,7 @@ fn invalid_users() -> Users {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Specials {
|
||||
exit_ln: LiveNode,
|
||||
fallthrough_ln: LiveNode,
|
||||
|
|
|
@ -199,7 +199,7 @@ pub type cmt<'tcx> = Rc<cmt_<'tcx>>;
|
|||
|
||||
// We pun on *T to mean both actual deref of a ptr as well
|
||||
// as accessing of components:
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum deref_kind {
|
||||
deref_ptr(PointerKind),
|
||||
deref_interior(InteriorKind),
|
||||
|
@ -263,6 +263,9 @@ pub struct MemCategorizationContext<'t,TYPER:'t> {
|
|||
}
|
||||
|
||||
impl<'t,TYPER:'t> Copy for MemCategorizationContext<'t,TYPER> {}
|
||||
impl<'t,TYPER:'t> Clone for MemCategorizationContext<'t,TYPER> {
|
||||
fn clone(&self) -> MemCategorizationContext<'t,TYPER> { *self }
|
||||
}
|
||||
|
||||
pub type McResult<T> = Result<T, ()>;
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ pub type ExternalExports = DefIdSet;
|
|||
/// reexporting a public struct doesn't inline the doc).
|
||||
pub type PublicItems = NodeSet;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum LastPrivate {
|
||||
LastMod(PrivateDep),
|
||||
// `use` directives (imports) can refer to two separate definitions in the
|
||||
|
@ -46,14 +46,14 @@ pub enum LastPrivate {
|
|||
type_used: ImportUse},
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum PrivateDep {
|
||||
AllPublic,
|
||||
DependsOn(ast::DefId),
|
||||
}
|
||||
|
||||
// How an import is used.
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum ImportUse {
|
||||
Unused, // The import is not used.
|
||||
Used, // The import is used.
|
||||
|
|
|
@ -255,7 +255,7 @@ pub struct RegionMaps {
|
|||
/// Carries the node id for the innermost block or match expression,
|
||||
/// for building up the `var_map` which maps ids to the blocks in
|
||||
/// which they were declared.
|
||||
#[derive(PartialEq, Eq, Debug, Copy)]
|
||||
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
||||
enum InnermostDeclaringBlock {
|
||||
None,
|
||||
Block(ast::NodeId),
|
||||
|
@ -280,7 +280,7 @@ impl InnermostDeclaringBlock {
|
|||
/// Contextual information for declarations introduced by a statement
|
||||
/// (i.e. `let`). It carries node-id's for statement and enclosing
|
||||
/// block both, as well as the statement's index within the block.
|
||||
#[derive(PartialEq, Eq, Debug, Copy)]
|
||||
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
||||
struct DeclaringStatementContext {
|
||||
stmt_id: ast::NodeId,
|
||||
block_id: ast::NodeId,
|
||||
|
@ -296,7 +296,7 @@ impl DeclaringStatementContext {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Debug, Copy)]
|
||||
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
|
||||
enum InnermostEnclosingExpr {
|
||||
None,
|
||||
Some(ast::NodeId),
|
||||
|
@ -318,7 +318,7 @@ impl InnermostEnclosingExpr {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct Context {
|
||||
/// the scope that contains any new variables declared
|
||||
var_parent: InnermostDeclaringBlock,
|
||||
|
|
|
@ -96,7 +96,7 @@ pub enum MethodMatchResult {
|
|||
MethodDidNotMatch,
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum MethodMatchedData {
|
||||
// In the case of a precise match, we don't really need to store
|
||||
// how the match was found. So don't.
|
||||
|
|
|
@ -261,7 +261,7 @@ pub struct field_ty {
|
|||
|
||||
// Contains information needed to resolve types and (in the future) look up
|
||||
// the types of AST nodes.
|
||||
#[derive(Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
|
||||
pub struct creader_cache_key {
|
||||
pub cnum: CrateNum,
|
||||
pub pos: usize,
|
||||
|
@ -595,7 +595,7 @@ pub type ObjectCastMap<'tcx> = RefCell<NodeMap<ty::PolyTraitRef<'tcx>>>;
|
|||
/// will push one or more such restriction into the
|
||||
/// `transmute_restrictions` vector during `intrinsicck`. They are
|
||||
/// then checked during `trans` by the fn `check_intrinsics`.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct TransmuteRestriction<'tcx> {
|
||||
/// The span whence the restriction comes.
|
||||
pub span: Span,
|
||||
|
@ -885,7 +885,7 @@ macro_rules! sty_debug_print {
|
|||
// variable names.
|
||||
mod inner {
|
||||
use middle::ty;
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct DebugStat {
|
||||
total: usize,
|
||||
region_infer: usize,
|
||||
|
@ -4012,7 +4012,7 @@ pub fn is_instantiable<'tcx>(cx: &ctxt<'tcx>, r_ty: Ty<'tcx>) -> bool {
|
|||
///
|
||||
/// The ordering of the cases is significant. They are sorted so that cmp::max
|
||||
/// will keep the "more erroneous" of two values.
|
||||
#[derive(Copy, PartialOrd, Ord, Eq, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialOrd, Ord, Eq, PartialEq, Debug)]
|
||||
pub enum Representability {
|
||||
Representable,
|
||||
ContainsRecursive,
|
||||
|
@ -4743,7 +4743,7 @@ pub fn expr_is_lval(tcx: &ctxt, e: &ast::Expr) -> bool {
|
|||
/// two kinds of rvalues is an artifact of trans which reflects how we will
|
||||
/// generate code for that kind of expression. See trans/expr.rs for more
|
||||
/// information.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum ExprKind {
|
||||
LvalueExpr,
|
||||
RvalueDpsExpr,
|
||||
|
@ -5439,7 +5439,7 @@ pub fn item_path_str(cx: &ctxt, id: ast::DefId) -> String {
|
|||
with_path(cx, id, |path| ast_map::path_to_string(path)).to_string()
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum DtorKind {
|
||||
NoDtor,
|
||||
TraitDtor(DefId, bool)
|
||||
|
@ -7163,7 +7163,7 @@ pub fn make_substs_for_receiver_types<'tcx>(tcx: &ty::ctxt<'tcx>,
|
|||
trait_ref.substs.clone().with_method(meth_tps, meth_regions)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum CopyImplementationError {
|
||||
FieldDoesNotImplementCopy(ast::Name),
|
||||
VariantDoesNotImplementCopy(ast::Name),
|
||||
|
|
|
@ -247,7 +247,7 @@ pub fn basic_options() -> Options {
|
|||
// users can have their own entry
|
||||
// functions that don't start a
|
||||
// scheduler
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum EntryFnType {
|
||||
EntryMain,
|
||||
EntryStart,
|
||||
|
|
|
@ -15,7 +15,7 @@ use target::TargetOptions;
|
|||
use self::Arch::*;
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Arch {
|
||||
Armv7,
|
||||
Armv7s,
|
||||
|
|
|
@ -334,7 +334,7 @@ impl ToInteriorKind for mc::InteriorKind {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
pub enum LoanPathElem {
|
||||
LpDeref(mc::PointerKind), // `*LV` in README.md
|
||||
LpInterior(InteriorKind), // `LV.f` in README.md
|
||||
|
@ -500,13 +500,13 @@ pub struct BckError<'tcx> {
|
|||
code: bckerr_code
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AliasableViolationKind {
|
||||
MutabilityViolation,
|
||||
BorrowViolation(euv::LoanCause)
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum MovedValueUseKind {
|
||||
MovedInUse,
|
||||
MovedInCapture,
|
||||
|
|
|
@ -94,7 +94,7 @@ impl Clone for MovePathIndex {
|
|||
const InvalidMovePathIndex: MovePathIndex = MovePathIndex(usize::MAX);
|
||||
|
||||
/// Index into `MoveData.moves`, used like a pointer
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub struct MoveIndex(usize);
|
||||
|
||||
impl MoveIndex {
|
||||
|
@ -125,7 +125,7 @@ pub struct MovePath<'tcx> {
|
|||
pub next_sibling: MovePathIndex,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum MoveKind {
|
||||
Declared, // When declared, variables start out "moved".
|
||||
MoveExpr, // Expression or binding that moves a variable
|
||||
|
@ -133,7 +133,7 @@ pub enum MoveKind {
|
|||
Captured // Closure creation that moves a value
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Move {
|
||||
/// Path being moved.
|
||||
pub path: MovePathIndex,
|
||||
|
@ -148,7 +148,7 @@ pub struct Move {
|
|||
pub next_move: MoveIndex
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Assignment {
|
||||
/// Path being assigned.
|
||||
pub path: MovePathIndex,
|
||||
|
@ -160,7 +160,7 @@ pub struct Assignment {
|
|||
pub span: Span,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct VariantMatch {
|
||||
/// downcast to the variant.
|
||||
pub path: MovePathIndex,
|
||||
|
|
|
@ -26,7 +26,7 @@ use rustc::middle::dataflow;
|
|||
use std::rc::Rc;
|
||||
use std::borrow::IntoCow;
|
||||
|
||||
#[derive(Debug, Copy)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum Variant {
|
||||
Loans,
|
||||
Moves,
|
||||
|
|
|
@ -182,7 +182,7 @@ fn make_input(free_matches: &[String]) -> Option<(Input, Option<PathBuf>)> {
|
|||
}
|
||||
|
||||
// Whether to stop or continue compilation.
|
||||
#[derive(Copy, Debug, Eq, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Compilation {
|
||||
Stop,
|
||||
Continue,
|
||||
|
@ -265,7 +265,7 @@ pub trait CompilerCalls<'a> {
|
|||
}
|
||||
|
||||
// CompilerCalls instance for a regular rustc build.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct RustcDefaultCalls;
|
||||
|
||||
impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
|
||||
|
|
|
@ -44,7 +44,7 @@ use std::option;
|
|||
use std::path::PathBuf;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum PpSourceMode {
|
||||
PpmNormal,
|
||||
PpmEveryBodyLoops,
|
||||
|
@ -56,7 +56,7 @@ pub enum PpSourceMode {
|
|||
}
|
||||
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum PpFlowGraphMode {
|
||||
Default,
|
||||
/// Drops the labels from the edges in the flowgraph output. This
|
||||
|
@ -65,7 +65,7 @@ pub enum PpFlowGraphMode {
|
|||
/// have become a pain to maintain.
|
||||
UnlabelledEdges,
|
||||
}
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum PpMode {
|
||||
PpmSource(PpSourceMode),
|
||||
PpmFlowGraph(PpFlowGraphMode),
|
||||
|
|
|
@ -63,7 +63,7 @@ declare_lint! {
|
|||
"suggest using `loop { }` instead of `while true { }`"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct WhileTrue;
|
||||
|
||||
impl LintPass for WhileTrue {
|
||||
|
@ -107,7 +107,7 @@ declare_lint! {
|
|||
"shift exceeds the type's number of bits"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct TypeLimits {
|
||||
/// Id of the last visited negated expression
|
||||
negated_expr_id: ast::NodeId,
|
||||
|
@ -431,7 +431,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for ImproperCTypesVisitor<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct ImproperCTypes;
|
||||
|
||||
impl LintPass for ImproperCTypes {
|
||||
|
@ -474,7 +474,7 @@ declare_lint! {
|
|||
"use of owned (Box type) heap memory"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct BoxPointers;
|
||||
|
||||
impl BoxPointers {
|
||||
|
@ -621,7 +621,7 @@ declare_lint! {
|
|||
"detects attributes that were not used by the compiler"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedAttributes;
|
||||
|
||||
impl LintPass for UnusedAttributes {
|
||||
|
@ -662,7 +662,7 @@ declare_lint! {
|
|||
"path statements with no effect"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct PathStatements;
|
||||
|
||||
impl LintPass for PathStatements {
|
||||
|
@ -696,7 +696,7 @@ declare_lint! {
|
|||
"unused result of an expression in a statement"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedResults;
|
||||
|
||||
impl LintPass for UnusedResults {
|
||||
|
@ -764,7 +764,7 @@ declare_lint! {
|
|||
"types, variants, traits and type parameters should have camel case names"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct NonCamelCaseTypes;
|
||||
|
||||
impl NonCamelCaseTypes {
|
||||
|
@ -874,7 +874,7 @@ declare_lint! {
|
|||
"methods, functions, lifetime parameters and modules should have snake case names"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct NonSnakeCase;
|
||||
|
||||
impl NonSnakeCase {
|
||||
|
@ -1014,7 +1014,7 @@ declare_lint! {
|
|||
"static constants should have uppercase identifiers"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct NonUpperCaseGlobals;
|
||||
|
||||
impl NonUpperCaseGlobals {
|
||||
|
@ -1072,7 +1072,7 @@ declare_lint! {
|
|||
"`if`, `match`, `while` and `return` do not need parentheses"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedParens;
|
||||
|
||||
impl UnusedParens {
|
||||
|
@ -1166,7 +1166,7 @@ declare_lint! {
|
|||
"unnecessary braces around an imported item"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedImportBraces;
|
||||
|
||||
impl LintPass for UnusedImportBraces {
|
||||
|
@ -1196,7 +1196,7 @@ declare_lint! {
|
|||
"using `Struct { x: x }` instead of `Struct { x }`"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct NonShorthandFieldPatterns;
|
||||
|
||||
impl LintPass for NonShorthandFieldPatterns {
|
||||
|
@ -1233,7 +1233,7 @@ declare_lint! {
|
|||
"unnecessary use of an `unsafe` block"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedUnsafe;
|
||||
|
||||
impl LintPass for UnusedUnsafe {
|
||||
|
@ -1258,7 +1258,7 @@ declare_lint! {
|
|||
"usage of `unsafe` code"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnsafeCode;
|
||||
|
||||
impl LintPass for UnsafeCode {
|
||||
|
@ -1319,7 +1319,7 @@ declare_lint! {
|
|||
"detect mut variables which don't need to be mutable"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedMut;
|
||||
|
||||
impl UnusedMut {
|
||||
|
@ -1388,7 +1388,7 @@ declare_lint! {
|
|||
"detects unnecessary allocations that can be eliminated"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnusedAllocation;
|
||||
|
||||
impl LintPass for UnusedAllocation {
|
||||
|
@ -1625,7 +1625,7 @@ declare_lint! {
|
|||
"detects potentially-forgotten implementations of `Copy`"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct MissingCopyImplementations;
|
||||
|
||||
impl LintPass for MissingCopyImplementations {
|
||||
|
@ -1740,7 +1740,7 @@ declare_lint! {
|
|||
}
|
||||
|
||||
/// Checks for use of items with `#[deprecated]` attributes
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Stability;
|
||||
|
||||
impl Stability {
|
||||
|
@ -1800,7 +1800,7 @@ declare_lint! {
|
|||
"functions that cannot return without calling themselves"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnconditionalRecursion;
|
||||
|
||||
|
||||
|
@ -1991,7 +1991,7 @@ declare_lint! {
|
|||
"compiler plugin used as ordinary library in non-plugin crate"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct PluginAsLibrary;
|
||||
|
||||
impl LintPass for PluginAsLibrary {
|
||||
|
@ -2045,7 +2045,7 @@ declare_lint! {
|
|||
"const items will not have their symbols exported"
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct InvalidNoMangleItems;
|
||||
|
||||
impl LintPass for InvalidNoMangleItems {
|
||||
|
@ -2088,7 +2088,7 @@ impl LintPass for InvalidNoMangleItems {
|
|||
}
|
||||
|
||||
/// Forbids using the `#[feature(...)]` attribute
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct UnstableFeatures;
|
||||
|
||||
declare_lint! {
|
||||
|
|
|
@ -18,7 +18,7 @@ use std::ptr;
|
|||
|
||||
use {ValueRef, TwineRef, DebugLocRef, DiagnosticInfoRef};
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum OptimizationDiagnosticKind {
|
||||
OptimizationRemark,
|
||||
OptimizationMissed,
|
||||
|
@ -38,7 +38,7 @@ impl OptimizationDiagnosticKind {
|
|||
}
|
||||
|
||||
#[allow(raw_pointer_derive)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct OptimizationDiagnostic {
|
||||
pub kind: OptimizationDiagnosticKind,
|
||||
pub pass_name: *const c_char,
|
||||
|
@ -69,14 +69,13 @@ impl OptimizationDiagnostic {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct InlineAsmDiagnostic {
|
||||
pub cookie: c_uint,
|
||||
pub message: TwineRef,
|
||||
pub instruction: ValueRef,
|
||||
}
|
||||
|
||||
impl Copy for InlineAsmDiagnostic {}
|
||||
|
||||
impl InlineAsmDiagnostic {
|
||||
unsafe fn unpack(di: DiagnosticInfoRef)
|
||||
-> InlineAsmDiagnostic {
|
||||
|
@ -96,7 +95,7 @@ impl InlineAsmDiagnostic {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Diagnostic {
|
||||
Optimization(OptimizationDiagnostic),
|
||||
InlineAsm(InlineAsmDiagnostic),
|
||||
|
|
|
@ -76,7 +76,7 @@ pub const False: Bool = 0 as Bool;
|
|||
|
||||
// Consts for the LLVM CallConv type, pre-cast to usize.
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum CallConv {
|
||||
CCallConv = 0,
|
||||
FastCallConv = 8,
|
||||
|
@ -86,7 +86,7 @@ pub enum CallConv {
|
|||
X86_64_Win64 = 79,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Visibility {
|
||||
LLVMDefaultVisibility = 0,
|
||||
HiddenVisibility = 1,
|
||||
|
@ -97,7 +97,7 @@ pub enum Visibility {
|
|||
// DLLExportLinkage, GhostLinkage and LinkOnceODRAutoHideLinkage.
|
||||
// LinkerPrivateLinkage and LinkerPrivateWeakLinkage are not included either;
|
||||
// they've been removed in upstream LLVM commit r203866.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Linkage {
|
||||
ExternalLinkage = 0,
|
||||
AvailableExternallyLinkage = 1,
|
||||
|
@ -113,7 +113,7 @@ pub enum Linkage {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum DiagnosticSeverity {
|
||||
Error,
|
||||
Warning,
|
||||
|
@ -154,7 +154,7 @@ bitflags! {
|
|||
|
||||
|
||||
#[repr(u64)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum OtherAttribute {
|
||||
// The following are not really exposed in
|
||||
// the LLVM c api so instead to add these
|
||||
|
@ -175,13 +175,13 @@ pub enum OtherAttribute {
|
|||
NonNullAttribute = 1 << 44,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum SpecialAttribute {
|
||||
DereferenceableAttribute(u64)
|
||||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AttributeSet {
|
||||
ReturnIndex = 0,
|
||||
FunctionIndex = !0
|
||||
|
@ -273,7 +273,7 @@ impl AttrBuilder {
|
|||
}
|
||||
|
||||
// enum for the LLVM IntPredicate type
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum IntPredicate {
|
||||
IntEQ = 32,
|
||||
IntNE = 33,
|
||||
|
@ -288,7 +288,7 @@ pub enum IntPredicate {
|
|||
}
|
||||
|
||||
// enum for the LLVM RealPredicate type
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum RealPredicate {
|
||||
RealPredicateFalse = 0,
|
||||
RealOEQ = 1,
|
||||
|
@ -310,7 +310,7 @@ pub enum RealPredicate {
|
|||
|
||||
// The LLVM TypeKind type - must stay in sync with the def of
|
||||
// LLVMTypeKind in llvm/include/llvm-c/Core.h
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
#[repr(C)]
|
||||
pub enum TypeKind {
|
||||
Void = 0,
|
||||
|
@ -332,7 +332,7 @@ pub enum TypeKind {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AtomicBinOp {
|
||||
AtomicXchg = 0,
|
||||
AtomicAdd = 1,
|
||||
|
@ -348,7 +348,7 @@ pub enum AtomicBinOp {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AtomicOrdering {
|
||||
NotAtomic = 0,
|
||||
Unordered = 1,
|
||||
|
@ -362,13 +362,13 @@ pub enum AtomicOrdering {
|
|||
|
||||
// Consts for the LLVMCodeGenFileType type (in include/llvm/c/TargetMachine.h)
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum FileType {
|
||||
AssemblyFileType = 0,
|
||||
ObjectFileType = 1
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum MetadataType {
|
||||
MD_dbg = 0,
|
||||
MD_tbaa = 1,
|
||||
|
@ -385,13 +385,13 @@ pub enum MetadataType {
|
|||
}
|
||||
|
||||
// Inline Asm Dialect
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AsmDialect {
|
||||
AD_ATT = 0,
|
||||
AD_Intel = 1
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Clone)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[repr(C)]
|
||||
pub enum CodeGenOptLevel {
|
||||
CodeGenLevelNone = 0,
|
||||
|
@ -400,7 +400,7 @@ pub enum CodeGenOptLevel {
|
|||
CodeGenLevelAggressive = 3,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
#[repr(C)]
|
||||
pub enum RelocMode {
|
||||
RelocDefault = 0,
|
||||
|
@ -410,7 +410,7 @@ pub enum RelocMode {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum CodeGenModel {
|
||||
CodeModelDefault = 0,
|
||||
CodeModelJITDefault = 1,
|
||||
|
@ -421,7 +421,7 @@ pub enum CodeGenModel {
|
|||
}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum DiagnosticKind {
|
||||
DK_InlineAsm = 0,
|
||||
DK_StackSize,
|
||||
|
@ -533,7 +533,7 @@ pub mod debuginfo {
|
|||
pub type DIEnumerator = DIDescriptor;
|
||||
pub type DITemplateTypeParameter = DIDescriptor;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum DIDescriptorFlags {
|
||||
FlagPrivate = 1 << 0,
|
||||
FlagProtected = 1 << 1,
|
||||
|
|
|
@ -61,7 +61,7 @@ use std::rc::Rc;
|
|||
|
||||
// Specifies how duplicates should be handled when adding a child item if
|
||||
// another item exists with the same name in some namespace.
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum DuplicateCheckingMode {
|
||||
ForbidDuplicateModules,
|
||||
ForbidDuplicateTypesAndModules,
|
||||
|
@ -70,7 +70,7 @@ enum DuplicateCheckingMode {
|
|||
OverwriteDuplicates
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum NamespaceError {
|
||||
NoError,
|
||||
ModuleError,
|
||||
|
|
|
@ -107,7 +107,7 @@ mod record_exports;
|
|||
mod build_reduced_graph;
|
||||
mod resolve_imports;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct BindingInfo {
|
||||
span: Span,
|
||||
binding_mode: BindingMode,
|
||||
|
@ -116,14 +116,14 @@ struct BindingInfo {
|
|||
// Map from the name in a pattern to its binding mode.
|
||||
type BindingMap = HashMap<Name, BindingInfo>;
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum PatternBindingMode {
|
||||
RefutableMode,
|
||||
LocalIrrefutableMode,
|
||||
ArgumentIrrefutableMode,
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
enum Namespace {
|
||||
TypeNS,
|
||||
ValueNS
|
||||
|
@ -277,7 +277,7 @@ enum FallbackSuggestion {
|
|||
TraitMethod(String),
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum TypeParameters<'a> {
|
||||
NoTypeParameters,
|
||||
HasTypeParameters(
|
||||
|
@ -294,7 +294,7 @@ enum TypeParameters<'a> {
|
|||
|
||||
// The rib kind controls the translation of local
|
||||
// definitions (`DefLocal`) to upvars (`DefUpvar`).
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
enum RibKind {
|
||||
// No translation needs to be applied.
|
||||
NormalRibKind,
|
||||
|
@ -316,7 +316,7 @@ enum RibKind {
|
|||
ConstantItemRibKind
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum UseLexicalScopeFlag {
|
||||
DontUseLexicalScope,
|
||||
UseLexicalScope
|
||||
|
@ -327,7 +327,7 @@ enum ModulePrefixResult {
|
|||
PrefixFound(Rc<Module>, usize)
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum NameSearchType {
|
||||
/// We're doing a name search in order to resolve a `use` directive.
|
||||
ImportSearch,
|
||||
|
@ -337,7 +337,7 @@ enum NameSearchType {
|
|||
PathSearch,
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum BareIdentifierPatternResolution {
|
||||
FoundStructOrEnumVariant(Def, LastPrivate),
|
||||
FoundConst(Def, LastPrivate),
|
||||
|
@ -369,7 +369,7 @@ enum ParentLink {
|
|||
}
|
||||
|
||||
/// The type of module this is.
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
enum ModuleKind {
|
||||
NormalModuleKind,
|
||||
TraitModuleKind,
|
||||
|
@ -3539,7 +3539,7 @@ pub struct CrateMap {
|
|||
pub glob_map: Option<GlobMap>
|
||||
}
|
||||
|
||||
#[derive(PartialEq,Copy)]
|
||||
#[derive(PartialEq,Copy, Clone)]
|
||||
pub enum MakeGlobMap {
|
||||
Yes,
|
||||
No
|
||||
|
|
|
@ -37,7 +37,7 @@ use std::rc::Rc;
|
|||
|
||||
|
||||
/// Contains data for specific types of import directives.
|
||||
#[derive(Copy,Debug)]
|
||||
#[derive(Copy, Clone,Debug)]
|
||||
pub enum ImportDirectiveSubclass {
|
||||
SingleImport(Name /* target */, Name /* source */),
|
||||
GlobImport
|
||||
|
|
|
@ -62,7 +62,7 @@ macro_rules! svec {
|
|||
})
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug, Eq, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
pub enum Row {
|
||||
Variable,
|
||||
Enum,
|
||||
|
|
|
@ -228,7 +228,7 @@ use syntax::codemap::Span;
|
|||
use syntax::fold::Folder;
|
||||
use syntax::ptr::P;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
struct ConstantExpr<'a>(&'a ast::Expr);
|
||||
|
||||
impl<'a> ConstantExpr<'a> {
|
||||
|
@ -311,7 +311,7 @@ impl<'a, 'tcx> Opt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum BranchKind {
|
||||
NoBranch,
|
||||
Single,
|
||||
|
|
|
@ -2112,7 +2112,7 @@ pub fn llvm_linkage_by_name(name: &str) -> Option<Linkage> {
|
|||
|
||||
|
||||
/// Enum describing the origin of an LLVM `Value`, for linkage purposes.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum ValueOrigin {
|
||||
/// The LLVM `Value` is in this context because the corresponding item was
|
||||
/// assigned to the current compilation unit.
|
||||
|
|
|
@ -13,7 +13,7 @@ use llvm::BasicBlockRef;
|
|||
use trans::value::{Users, Value};
|
||||
use std::iter::{Filter, Map};
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct BasicBlock(pub BasicBlockRef);
|
||||
|
||||
pub type Preds = Map<Filter<Users, fn(&Value) -> bool>, fn(Value) -> BasicBlock>;
|
||||
|
|
|
@ -60,7 +60,7 @@ use syntax::ast;
|
|||
use syntax::ast_map;
|
||||
use syntax::ptr::P;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct MethodData {
|
||||
pub llfn: ValueRef,
|
||||
pub llself: ValueRef,
|
||||
|
@ -1110,7 +1110,7 @@ pub fn trans_args<'a, 'blk, 'tcx>(cx: Block<'blk, 'tcx>,
|
|||
bcx
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum AutorefArg {
|
||||
DontAutorefArg,
|
||||
DoAutorefArg(ast::NodeId)
|
||||
|
|
|
@ -153,7 +153,7 @@ pub struct CleanupScope<'blk, 'tcx: 'blk> {
|
|||
cached_landing_pad: Option<BasicBlockRef>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub struct CustomScopeIndex {
|
||||
index: usize
|
||||
}
|
||||
|
@ -184,14 +184,14 @@ impl<'blk, 'tcx: 'blk> fmt::Debug for CleanupScopeKind<'blk, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum EarlyExitLabel {
|
||||
UnwindExit,
|
||||
ReturnExit,
|
||||
LoopExit(ast::NodeId, usize)
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct CachedEarlyExit {
|
||||
label: EarlyExitLabel,
|
||||
cleanup_block: BasicBlockRef,
|
||||
|
@ -209,7 +209,7 @@ pub trait Cleanup<'tcx> {
|
|||
|
||||
pub type CleanupObj<'tcx> = Box<Cleanup<'tcx>+'tcx>;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum ScopeId {
|
||||
AstScope(ast::NodeId),
|
||||
CustomScope(CustomScopeIndex)
|
||||
|
@ -982,7 +982,7 @@ impl EarlyExitLabel {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// Cleanup types
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct DropValue<'tcx> {
|
||||
is_immediate: bool,
|
||||
must_unwind: bool,
|
||||
|
@ -1021,12 +1021,12 @@ impl<'tcx> Cleanup<'tcx> for DropValue<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
pub enum Heap {
|
||||
HeapExchange
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct FreeValue<'tcx> {
|
||||
ptr: ValueRef,
|
||||
heap: Heap,
|
||||
|
@ -1061,7 +1061,7 @@ impl<'tcx> Cleanup<'tcx> for FreeValue<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct FreeSlice {
|
||||
ptr: ValueRef,
|
||||
size: ValueRef,
|
||||
|
@ -1098,7 +1098,7 @@ impl<'tcx> Cleanup<'tcx> for FreeSlice {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct LifetimeEnd {
|
||||
ptr: ValueRef,
|
||||
}
|
||||
|
|
|
@ -343,7 +343,7 @@ pub fn gensym_name(name: &str) -> PathElem {
|
|||
*
|
||||
*/
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct NodeIdAndSpan {
|
||||
pub id: ast::NodeId,
|
||||
pub span: Span,
|
||||
|
@ -1225,7 +1225,7 @@ pub fn drain_fulfillment_cx<'a,'tcx,T>(infcx: &infer::InferCtxt<'a,'tcx>,
|
|||
}
|
||||
|
||||
// Key used to lookup values supplied for type parameters in an expr.
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum ExprOrMethodCall {
|
||||
// Type parameters for a path like `None::<int>`
|
||||
ExprId(ast::NodeId),
|
||||
|
|
|
@ -172,7 +172,7 @@ impl Drop for Rvalue {
|
|||
fn drop(&mut self) { }
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq, Hash, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
pub enum RvalueMode {
|
||||
/// `val` is a pointer to the actual value (and thus has type *T)
|
||||
ByRef,
|
||||
|
|
|
@ -2382,7 +2382,7 @@ impl<'tcx> VariantMemberDescriptionFactory<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum EnumDiscriminantInfo {
|
||||
RegularDiscriminant(DIType),
|
||||
OptimizedDiscriminant,
|
||||
|
@ -3106,7 +3106,7 @@ impl MetadataCreationResult {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
enum InternalDebugLocation {
|
||||
KnownLocation { scope: DIScope, line: usize, col: usize },
|
||||
UnknownLocation
|
||||
|
|
|
@ -94,7 +94,7 @@ use std::rc::Rc;
|
|||
// These are passed around by the code generating functions to track the
|
||||
// destination of a computation's value.
|
||||
|
||||
#[derive(Copy, PartialEq)]
|
||||
#[derive(Copy, Clone, PartialEq)]
|
||||
pub enum Dest {
|
||||
SaveIn(ValueRef),
|
||||
Ignore,
|
||||
|
@ -2038,7 +2038,7 @@ fn float_cast(bcx: Block,
|
|||
} else { llsrc };
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
||||
pub enum cast_kind {
|
||||
cast_pointer,
|
||||
cast_integral,
|
||||
|
|
|
@ -57,7 +57,7 @@ mod basic_block;
|
|||
mod llrepr;
|
||||
mod cleanup;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct ModuleTranslation {
|
||||
pub llcx: ContextRef,
|
||||
pub llmod: ModuleRef,
|
||||
|
|
|
@ -33,7 +33,7 @@ use util::ppaux::ty_to_string;
|
|||
use syntax::ast;
|
||||
use syntax::parse::token::InternedString;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct VecTypes<'tcx> {
|
||||
unit_ty: Ty<'tcx>,
|
||||
llunit_ty: Type
|
||||
|
|
|
@ -14,7 +14,7 @@ use trans::basic_block::BasicBlock;
|
|||
use trans::common::Block;
|
||||
use libc::c_uint;
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Value(pub ValueRef);
|
||||
|
||||
macro_rules! opt_val { ($e:expr) => (
|
||||
|
@ -125,7 +125,7 @@ impl Value {
|
|||
}
|
||||
|
||||
/// Wrapper for LLVM UseRef
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Use(UseRef);
|
||||
|
||||
impl Use {
|
||||
|
|
|
@ -52,7 +52,7 @@ pub enum MethodError {
|
|||
|
||||
// A pared down enum describing just the places from which a method
|
||||
// candidate can arise. Used for error reporting only.
|
||||
#[derive(Copy, PartialOrd, Ord, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialOrd, Ord, PartialEq, Eq)]
|
||||
pub enum CandidateSource {
|
||||
ImplSource(ast::DefId),
|
||||
TraitSource(/* trait id */ ast::DefId),
|
||||
|
|
|
@ -109,7 +109,7 @@ pub enum PickAdjustment {
|
|||
AutoRef(ast::Mutability, Box<PickAdjustment>),
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Copy)]
|
||||
#[derive(PartialEq, Eq, Copy, Clone)]
|
||||
pub enum Mode {
|
||||
// An expression of the form `receiver.method_name(...)`.
|
||||
// Autoderefs are performed on `receiver`, lookup is done based on the
|
||||
|
|
|
@ -266,7 +266,7 @@ fn type_derefs_to_local<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
|
|||
}).2.is_some()
|
||||
}
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct TraitInfo {
|
||||
pub def_id: ast::DefId,
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ struct CastCheck<'tcx> {
|
|||
|
||||
/// When type-checking an expression, we propagate downward
|
||||
/// whatever type hint we are able in the form of an `Expectation`.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum Expectation<'tcx> {
|
||||
/// We know nothing about what type this expression should have.
|
||||
NoExpectation,
|
||||
|
@ -1951,14 +1951,14 @@ impl<'a, 'tcx> RegionScope for FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum LvaluePreference {
|
||||
PreferMutLvalue,
|
||||
NoPreference
|
||||
}
|
||||
|
||||
/// Whether `autoderef` requires types to resolve.
|
||||
#[derive(Copy, Debug, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||
pub enum UnresolvedTypeAction {
|
||||
/// Produce an error and return `ty_err` whenever a type cannot
|
||||
/// be resolved (i.e. it is `ty_infer`).
|
||||
|
|
|
@ -350,7 +350,7 @@ impl<'cx, 'tcx> WritebackCx<'cx, 'tcx> {
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// Resolution reason.
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum ResolveReason {
|
||||
ResolvingExpr(Span),
|
||||
ResolvingLocal(Span),
|
||||
|
|
|
@ -135,7 +135,7 @@ struct ItemCtxt<'a,'tcx:'a> {
|
|||
param_bounds: &'a (GetTypeParameterBounds<'tcx>+'a),
|
||||
}
|
||||
|
||||
#[derive(Copy, PartialEq, Eq)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq)]
|
||||
enum AstConvRequest {
|
||||
GetItemTypeScheme(ast::DefId),
|
||||
GetTraitDef(ast::DefId),
|
||||
|
|
|
@ -40,7 +40,7 @@ pub trait RegionScope {
|
|||
|
||||
// A scope in which all regions must be explicitly named. This is used
|
||||
// for types that appear in structs and so on.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct ExplicitRscope;
|
||||
|
||||
impl RegionScope for ExplicitRscope {
|
||||
|
|
|
@ -295,10 +295,10 @@ pub fn infer_variance(tcx: &ty::ctxt) {
|
|||
|
||||
type VarianceTermPtr<'a> = &'a VarianceTerm<'a>;
|
||||
|
||||
#[derive(Copy, Debug)]
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
struct InferredIndex(usize);
|
||||
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
enum VarianceTerm<'a> {
|
||||
ConstantTerm(ty::Variance),
|
||||
TransformTerm(VarianceTermPtr<'a>, VarianceTermPtr<'a>),
|
||||
|
@ -336,7 +336,7 @@ struct TermsContext<'a, 'tcx: 'a> {
|
|||
inferred_infos: Vec<InferredInfo<'a>> ,
|
||||
}
|
||||
|
||||
#[derive(Copy, Debug, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
enum ParamKind {
|
||||
TypeParam,
|
||||
RegionParam,
|
||||
|
@ -560,7 +560,7 @@ struct ConstraintContext<'a, 'tcx: 'a> {
|
|||
|
||||
/// Declares that the variable `decl_id` appears in a location with
|
||||
/// variance `variance`.
|
||||
#[derive(Copy)]
|
||||
#[derive(Copy, Clone)]
|
||||
struct Constraint<'a> {
|
||||
inferred: InferredIndex,
|
||||
variance: &'a VarianceTerm<'a>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue