use std::hash::Hash;
use ty::{self, TyCtxt};
use util::common::{ProfileQueriesMsg, profq_msg};
-use serialize::{Decodable, Decoder};
use ich::{StableHashingContext, StableHashingContextProvider, Fingerprint};
use dep_graph::DepNode;
use ich::Fingerprint;
use rustc_data_structures::indexed_vec::{IndexVec, Idx};
-use serialize::{Decodable, Decoder};
newtype_index! {
pub struct SerializedDepNodeIndex { .. }
// hack to ensure that we don't try to access the private parts of `ItemLocalId` in this module
mod item_local_id_inner {
use rustc_data_structures::indexed_vec::Idx;
- use serialize::{Decodable, Decoder};
/// An `ItemLocalId` uniquely identifies something within a given "item-like",
/// that is within a hir::Item, hir::TraitItem, or hir::ImplItem. There is no
/// guarantee that the numerical value of a given `ItemLocalId` corresponds to
use syntax_pos::{Span, DUMMY_SP};
use ty::TyCtxt;
use ty::query::Providers;
-use serialize::{Decodable, Decoder};
use hir;
use hir::Node;
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::sync::MappedReadGuard;
-use rustc_serialize::{self as serialize, Decodable, Decoder};
+use rustc_serialize::{self as serialize};
use smallvec::SmallVec;
use std::borrow::Cow;
use std::fmt::{self, Debug, Formatter, Write};
use arena::SyncDroplessArena;
use session::DataTypeKind;
-use serialize::{self, Encodable, Encoder, Decodable, Decoder};
+use serialize::{self, Encodable, Encoder};
use std::cell::RefCell;
use std::cmp::{self, Ordering};
use std::fmt;
use syntax::ast::{self, Ident};
use syntax::symbol::{keywords, InternedString};
-use serialize::{self, Decodable, Decoder};
+use serialize;
use hir;
@vis [$v]
@debug_format [$debug_format]
$($tokens)*);
- impl Decodable for $type {
- fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
- d.read_u32().into()
- }
- }
+ newtype_index!(@decodable $type);
);
// The case where no derives are added, but encodable is overridden. Don't
@vis [$v]
@debug_format [$debug_format]
$($tokens)*);
- impl Decodable for $type {
- fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
- d.read_u32().map(Self::from)
+ newtype_index!(@decodable $type);
+ );
+
+ (@decodable $type:ident) => (
+ impl $type {
+ fn __decodable__impl__hack() {
+ mod __more_hacks_because__self_doesnt_work_in_functions {
+ extern crate serialize;
+ use self::serialize::{Decodable, Decoder};
+ impl Decodable for super::$type {
+ fn decode<D: Decoder>(d: &mut D) -> Result<Self, D::Error> {
+ d.read_u32().map(Self::from)
+ }
+ }
+ }
}
}
);
use rustc::mir::{BasicBlock, Location, Mir};
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
-use rustc_serialize::{Decodable, Decoder};
/// Maps between a MIR Location, which identifies a particular
/// statement within a basic block, to a "rich location", which
use rustc_data_structures::graph::scc::Sccs;
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use borrow_check::nll::type_check::Locations;
-use rustc_serialize::{Decodable, Decoder};
use std::fmt;
use std::ops::Deref;
use rustc_data_structures::indexed_vec::IndexVec;
use std::fmt::Debug;
use std::rc::Rc;
-use rustc_serialize::{Decodable, Decoder};
/// Maps between a `Location` and a `PointIndex` (and vice versa).
crate struct RegionValueElements {
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use util::liveness::LiveVariableMap;
-use rustc_serialize::{Decodable, Decoder};
/// Map between Local and LiveVar indices: the purpose of this
/// map is to define the subset of local variables for which we need
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
use rustc_data_structures::vec_linked_list as vll;
use util::liveness::{categorize, DefUse, LiveVariableMap};
-use rustc_serialize::{Decodable, Decoder};
/// A map that cross references each local with the locations where it
/// is defined (assigned), used, or dropped. Used during liveness
use syntax::attr::{self, UnwindAttr};
use syntax::symbol::keywords;
use syntax_pos::Span;
-use rustc_serialize::{Decodable, Decoder};
use transform::MirSource;
use util as mir_util;
use std::ops::{Add, Deref, Sub, Mul, AddAssign, Range, RangeInclusive};
use rustc_data_structures::indexed_vec::{Idx, IndexVec};
-use rustc_serialize::{Decodable, Decoder};
pub mod call;