Register snapshots
This commit is contained in:
parent
3a481c0f88
commit
66319b0278
74 changed files with 23 additions and 9843 deletions
|
|
@ -44,15 +44,6 @@ pub fn get_type_param_count(cstore: @mut cstore::CStore, def: ast::def_id)
|
|||
}
|
||||
|
||||
/// Iterates over all the language items in the given crate.
|
||||
#[cfg(stage0)]
|
||||
pub fn each_lang_item(cstore: @mut cstore::CStore,
|
||||
cnum: ast::crate_num,
|
||||
f: &fn(ast::node_id, uint) -> bool) {
|
||||
let crate_data = cstore::get_crate_data(cstore, cnum);
|
||||
decoder::each_lang_item(crate_data, f)
|
||||
}
|
||||
/// Iterates over all the language items in the given crate.
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_lang_item(cstore: @mut cstore::CStore,
|
||||
cnum: ast::crate_num,
|
||||
f: &fn(ast::node_id, uint) -> bool) -> bool {
|
||||
|
|
@ -61,18 +52,6 @@ pub fn each_lang_item(cstore: @mut cstore::CStore,
|
|||
}
|
||||
|
||||
/// Iterates over all the paths in the given crate.
|
||||
#[cfg(stage0)]
|
||||
pub fn each_path(cstore: @mut cstore::CStore,
|
||||
cnum: ast::crate_num,
|
||||
f: &fn(&str, decoder::def_like) -> bool) {
|
||||
let crate_data = cstore::get_crate_data(cstore, cnum);
|
||||
let get_crate_data: decoder::GetCrateDataCb = |cnum| {
|
||||
cstore::get_crate_data(cstore, cnum)
|
||||
};
|
||||
decoder::each_path(cstore.intr, crate_data, get_crate_data, f);
|
||||
}
|
||||
/// Iterates over all the paths in the given crate.
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_path(cstore: @mut cstore::CStore,
|
||||
cnum: ast::crate_num,
|
||||
f: &fn(&str, decoder::def_like) -> bool) -> bool {
|
||||
|
|
|
|||
|
|
@ -196,15 +196,6 @@ fn item_def_id(d: ebml::Doc, cdata: cmd) -> ast::def_id {
|
|||
|d| parse_def_id(d)));
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_reexport(d: ebml::Doc, f: &fn(ebml::Doc) -> bool) {
|
||||
for reader::tagged_docs(d, tag_items_data_item_reexport) |reexport_doc| {
|
||||
if !f(reexport_doc) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_reexport(d: ebml::Doc, f: &fn(ebml::Doc) -> bool) -> bool {
|
||||
for reader::tagged_docs(d, tag_items_data_item_reexport) |reexport_doc| {
|
||||
if !f(reexport_doc) {
|
||||
|
|
@ -465,24 +456,6 @@ fn def_like_to_def(def_like: def_like) -> ast::def {
|
|||
}
|
||||
|
||||
/// Iterates over the language items in the given crate.
|
||||
#[cfg(stage0)]
|
||||
pub fn each_lang_item(cdata: cmd, f: &fn(ast::node_id, uint) -> bool) {
|
||||
let root = reader::Doc(cdata.data);
|
||||
let lang_items = reader::get_doc(root, tag_lang_items);
|
||||
for reader::tagged_docs(lang_items, tag_lang_items_item) |item_doc| {
|
||||
let id_doc = reader::get_doc(item_doc, tag_lang_items_item_id);
|
||||
let id = reader::doc_as_u32(id_doc) as uint;
|
||||
let node_id_doc = reader::get_doc(item_doc,
|
||||
tag_lang_items_item_node_id);
|
||||
let node_id = reader::doc_as_u32(node_id_doc) as ast::node_id;
|
||||
|
||||
if !f(node_id, id) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
/// Iterates over the language items in the given crate.
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_lang_item(cdata: cmd, f: &fn(ast::node_id, uint) -> bool) -> bool {
|
||||
let root = reader::Doc(cdata.data);
|
||||
let lang_items = reader::get_doc(root, tag_lang_items);
|
||||
|
|
@ -588,13 +561,6 @@ pub fn _each_path(intr: @ident_interner, cdata: cmd,
|
|||
return broken;
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub fn each_path(intr: @ident_interner, cdata: cmd,
|
||||
get_crate_data: GetCrateDataCb,
|
||||
f: &fn(&str, def_like) -> bool) {
|
||||
_each_path(intr, cdata, get_crate_data, f);
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_path(intr: @ident_interner, cdata: cmd,
|
||||
get_crate_data: GetCrateDataCb,
|
||||
f: &fn(&str, def_like) -> bool) -> bool {
|
||||
|
|
|
|||
|
|
@ -21,9 +21,6 @@ pub fn pick_file(file: Path, path: &Path) -> Option<Path> {
|
|||
|
||||
pub trait FileSearch {
|
||||
fn sysroot(&self) -> @Path;
|
||||
#[cfg(stage0)]
|
||||
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool);
|
||||
#[cfg(not(stage0))]
|
||||
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool) -> bool;
|
||||
fn get_target_lib_path(&self) -> Path;
|
||||
fn get_target_lib_file_path(&self, file: &Path) -> Path;
|
||||
|
|
@ -40,31 +37,6 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
|
|||
}
|
||||
impl FileSearch for FileSearchImpl {
|
||||
fn sysroot(&self) -> @Path { self.sysroot }
|
||||
#[cfg(stage0)]
|
||||
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool) {
|
||||
debug!("filesearch: searching additional lib search paths");
|
||||
// a little weird
|
||||
self.addl_lib_search_paths.each(f);
|
||||
|
||||
debug!("filesearch: searching target lib path");
|
||||
if !f(&make_target_lib_path(self.sysroot,
|
||||
self.target_triple)) {
|
||||
return;
|
||||
}
|
||||
debug!("filesearch: searching rustpkg lib path nearest");
|
||||
if match get_rustpkg_lib_path_nearest() {
|
||||
result::Ok(ref p) => f(p),
|
||||
result::Err(_) => true
|
||||
} {
|
||||
return;
|
||||
}
|
||||
debug!("filesearch: searching rustpkg lib path");
|
||||
match get_rustpkg_lib_path() {
|
||||
result::Ok(ref p) => f(p),
|
||||
result::Err(_) => true
|
||||
};
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn for_each_lib_search_path(&self, f: &fn(&Path) -> bool) -> bool {
|
||||
debug!("filesearch: searching additional lib search paths");
|
||||
// a little weird
|
||||
|
|
|
|||
|
|
@ -67,25 +67,6 @@ enum MoveError {
|
|||
pub impl<'self> CheckLoanCtxt<'self> {
|
||||
fn tcx(&self) -> ty::ctxt { self.bccx.tcx }
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_issued_loan(&self,
|
||||
scope_id: ast::node_id,
|
||||
op: &fn(&Loan) -> bool)
|
||||
{
|
||||
//! Iterates over each loan that that has been issued
|
||||
//! on entrance to `scope_id`, regardless of whether it is
|
||||
//! actually *in scope* at that point. Sometimes loans
|
||||
//! are issued for future scopes and thus they may have been
|
||||
//! *issued* but not yet be in effect.
|
||||
|
||||
for self.dfcx.each_bit_on_entry(scope_id) |loan_index| {
|
||||
let loan = &self.all_loans[loan_index];
|
||||
if !op(loan) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_issued_loan(&self,
|
||||
scope_id: ast::node_id,
|
||||
op: &fn(&Loan) -> bool) -> bool
|
||||
|
|
@ -105,24 +86,6 @@ pub impl<'self> CheckLoanCtxt<'self> {
|
|||
return true;
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_in_scope_loan(&self,
|
||||
scope_id: ast::node_id,
|
||||
op: &fn(&Loan) -> bool)
|
||||
{
|
||||
//! Like `each_issued_loan()`, but only considers loans that are
|
||||
//! currently in scope.
|
||||
|
||||
let region_maps = self.tcx().region_maps;
|
||||
for self.each_issued_loan(scope_id) |loan| {
|
||||
if region_maps.is_subscope_of(scope_id, loan.kill_scope) {
|
||||
if !op(loan) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_in_scope_loan(&self,
|
||||
scope_id: ast::node_id,
|
||||
op: &fn(&Loan) -> bool) -> bool
|
||||
|
|
@ -141,26 +104,6 @@ pub impl<'self> CheckLoanCtxt<'self> {
|
|||
return true;
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_in_scope_restriction(&self,
|
||||
scope_id: ast::node_id,
|
||||
loan_path: @LoanPath,
|
||||
op: &fn(&Loan, &Restriction) -> bool)
|
||||
{
|
||||
//! Iterates through all the in-scope restrictions for the
|
||||
//! given `loan_path`
|
||||
|
||||
for self.each_in_scope_loan(scope_id) |loan| {
|
||||
for loan.restrictions.each |restr| {
|
||||
if restr.loan_path == loan_path {
|
||||
if !op(loan, restr) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_in_scope_restriction(&self,
|
||||
scope_id: ast::node_id,
|
||||
loan_path: @LoanPath,
|
||||
|
|
|
|||
|
|
@ -21,8 +21,6 @@ use middle::dataflow::DataFlowOperator;
|
|||
use util::common::stmt_set;
|
||||
use util::ppaux::{note_and_explain_region, Repr};
|
||||
|
||||
#[cfg(stage0)]
|
||||
use core; // NOTE: this can be removed after the next snapshot
|
||||
use core::hashmap::{HashSet, HashMap};
|
||||
use core::io;
|
||||
use core::result::{Result};
|
||||
|
|
|
|||
|
|
@ -182,20 +182,6 @@ impl<O:DataFlowOperator> DataFlowContext<O> {
|
|||
}
|
||||
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub fn each_bit_on_entry(&self,
|
||||
id: ast::node_id,
|
||||
f: &fn(uint) -> bool) {
|
||||
//! Iterates through each bit that is set on entry to `id`.
|
||||
//! Only useful after `propagate()` has been called.
|
||||
|
||||
let (start, end) = self.compute_id_range(id);
|
||||
let on_entry = vec::slice(self.on_entry, start, end);
|
||||
debug!("each_bit_on_entry(id=%?, on_entry=%s)",
|
||||
id, bits_to_str(on_entry));
|
||||
self.each_bit(on_entry, f);
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_bit_on_entry(&self,
|
||||
id: ast::node_id,
|
||||
f: &fn(uint) -> bool) -> bool {
|
||||
|
|
@ -209,19 +195,6 @@ impl<O:DataFlowOperator> DataFlowContext<O> {
|
|||
self.each_bit(on_entry, f)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub fn each_gen_bit(&self,
|
||||
id: ast::node_id,
|
||||
f: &fn(uint) -> bool) {
|
||||
//! Iterates through each bit in the gen set for `id`.
|
||||
|
||||
let (start, end) = self.compute_id_range(id);
|
||||
let gens = vec::slice(self.gens, start, end);
|
||||
debug!("each_gen_bit(id=%?, gens=%s)",
|
||||
id, bits_to_str(gens));
|
||||
self.each_bit(gens, f)
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_gen_bit(&self,
|
||||
id: ast::node_id,
|
||||
f: &fn(uint) -> bool) -> bool {
|
||||
|
|
@ -234,37 +207,6 @@ impl<O:DataFlowOperator> DataFlowContext<O> {
|
|||
self.each_bit(gens, f)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_bit(&self,
|
||||
words: &[uint],
|
||||
f: &fn(uint) -> bool) {
|
||||
//! Helper for iterating over the bits in a bit set.
|
||||
|
||||
for words.eachi |word_index, &word| {
|
||||
if word != 0 {
|
||||
let base_index = word_index * uint::bits;
|
||||
for uint::range(0, uint::bits) |offset| {
|
||||
let bit = 1 << offset;
|
||||
if (word & bit) != 0 {
|
||||
// NB: we round up the total number of bits
|
||||
// that we store in any given bit set so that
|
||||
// it is an even multiple of uint::bits. This
|
||||
// means that there may be some stray bits at
|
||||
// the end that do not correspond to any
|
||||
// actual value. So before we callback, check
|
||||
// whether the bit_index is greater than the
|
||||
// actual value the user specified and stop
|
||||
// iterating if so.
|
||||
let bit_index = base_index + offset;
|
||||
if bit_index >= self.bits_per_id || !f(bit_index) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_bit(&self,
|
||||
words: &[uint],
|
||||
f: &fn(uint) -> bool) -> bool {
|
||||
|
|
|
|||
|
|
@ -86,15 +86,6 @@ pub impl LanguageItems {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_item(&self, f: &fn(def_id: def_id, i: uint) -> bool) {
|
||||
for self.items.eachi |i, &item| {
|
||||
if !f(item.get(), i) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_item(&self, f: &fn(def_id: def_id, i: uint) -> bool) -> bool {
|
||||
self.items.eachi(|i, &item| f(item.get(), i))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -419,39 +419,6 @@ impl Context {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
pub fn each_lint(sess: session::Session,
|
||||
attrs: &[ast::attribute],
|
||||
f: &fn(@ast::meta_item, level, &~str) -> bool)
|
||||
{
|
||||
for [allow, warn, deny, forbid].each |&level| {
|
||||
let level_name = level_to_str(level);
|
||||
let attrs = attr::find_attrs_by_name(attrs, level_name);
|
||||
for attrs.each |attr| {
|
||||
let meta = attr.node.value;
|
||||
let metas = match meta.node {
|
||||
ast::meta_list(_, ref metas) => metas,
|
||||
_ => {
|
||||
sess.span_err(meta.span, ~"malformed lint attribute");
|
||||
loop;
|
||||
}
|
||||
};
|
||||
for metas.each |meta| {
|
||||
match meta.node {
|
||||
ast::meta_word(lintname) => {
|
||||
if !f(*meta, level, lintname) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
sess.span_err(meta.span, ~"malformed lint attribute");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_lint(sess: session::Session,
|
||||
attrs: &[ast::attribute],
|
||||
f: &fn(@ast::meta_item, level, &~str) -> bool) -> bool
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1367,21 +1367,6 @@ pub struct mono_id_ {
|
|||
|
||||
pub type mono_id = @mono_id_;
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for mono_param_id {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
mono_precise(t, ref mids) =>
|
||||
to_bytes::iter_bytes_3(&0u8, &ty::type_id(t), mids, lsb0, f),
|
||||
|
||||
mono_any => 1u8.iter_bytes(lsb0, f),
|
||||
|
||||
mono_repr(ref a, ref b, ref c, ref d) =>
|
||||
to_bytes::iter_bytes_5(&2u8, a, b, c, d, lsb0, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for mono_param_id {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -1396,26 +1381,12 @@ impl to_bytes::IterBytes for mono_param_id {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for MonoDataClass {
|
||||
fn iter_bytes(&self, lsb0: bool, f:to_bytes::Cb) {
|
||||
(*self as u8).iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for MonoDataClass {
|
||||
fn iter_bytes(&self, lsb0: bool, f:to_bytes::Cb) -> bool {
|
||||
(*self as u8).iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for mono_id_ {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f);
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for mono_id_ {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_2(&self.def, &self.params, lsb0, f)
|
||||
|
|
|
|||
|
|
@ -154,13 +154,6 @@ pub impl DatumMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for DatumMode {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
(*self as uint).iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for DatumMode {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
(*self as uint).iter_bytes(lsb0, f)
|
||||
|
|
|
|||
|
|
@ -26,8 +26,6 @@ use util::ppaux::{Repr, UserString};
|
|||
use util::common::{indenter};
|
||||
use util::enum_set::{EnumSet, CLike};
|
||||
|
||||
#[cfg(stage0)]
|
||||
use core; // NOTE: this can be removed after the next snapshot
|
||||
use core::ptr::to_unsafe_ptr;
|
||||
use core::to_bytes;
|
||||
use core::hashmap::{HashMap, HashSet};
|
||||
|
|
@ -136,13 +134,6 @@ pub struct creader_cache_key {
|
|||
|
||||
type creader_cache = @mut HashMap<creader_cache_key, t>;
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for creader_cache_key {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_3(&self.cnum, &self.pos, &self.len, lsb0, f);
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for creader_cache_key {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_3(&self.cnum, &self.pos, &self.len, lsb0, f)
|
||||
|
|
@ -167,15 +158,6 @@ impl cmp::Eq for intern_key {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for intern_key {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
unsafe {
|
||||
(*self.sty).iter_bytes(lsb0, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for intern_key {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
unsafe {
|
||||
|
|
@ -408,27 +390,12 @@ pub struct FnSig {
|
|||
output: t
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for BareFnTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_3(&self.purity, &self.abis, &self.sig, lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for BareFnTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_3(&self.purity, &self.abis, &self.sig, lsb0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for ClosureTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_5(&self.purity, &self.sigil, &self.onceness,
|
||||
&self.region, &self.sig, lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for ClosureTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_5(&self.purity, &self.sigil, &self.onceness,
|
||||
|
|
@ -747,17 +714,6 @@ pub enum InferTy {
|
|||
FloatVar(FloatVid)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for InferTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
TyVar(ref tv) => to_bytes::iter_bytes_2(&0u8, tv, lsb0, f),
|
||||
IntVar(ref iv) => to_bytes::iter_bytes_2(&1u8, iv, lsb0, f),
|
||||
FloatVar(ref fv) => to_bytes::iter_bytes_2(&2u8, fv, lsb0, f),
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for InferTy {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -774,16 +730,6 @@ pub enum InferRegion {
|
|||
ReSkolemized(uint, bound_region)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for InferRegion {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
ReVar(ref rv) => to_bytes::iter_bytes_2(&0u8, rv, lsb0, f),
|
||||
ReSkolemized(ref v, _) => to_bytes::iter_bytes_2(&1u8, v, lsb0, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for InferRegion {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -872,52 +818,24 @@ impl ToStr for IntVarValue {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for TyVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for TyVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for IntVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for IntVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for FloatVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for FloatVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for RegionVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for RegionVid {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
self.to_uint().iter_bytes(lsb0, f)
|
||||
|
|
@ -2718,22 +2636,6 @@ impl cmp::TotalEq for bound_region {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for vstore {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
vstore_fixed(ref u) =>
|
||||
to_bytes::iter_bytes_2(&0u8, u, lsb0, f),
|
||||
|
||||
vstore_uniq => 1u8.iter_bytes(lsb0, f),
|
||||
vstore_box => 2u8.iter_bytes(lsb0, f),
|
||||
|
||||
vstore_slice(ref r) =>
|
||||
to_bytes::iter_bytes_2(&3u8, r, lsb0, f),
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for vstore {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -2749,15 +2651,6 @@ impl to_bytes::IterBytes for vstore {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for substs {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_3(&self.self_r,
|
||||
&self.self_ty,
|
||||
&self.tps, lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for substs {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_3(&self.self_r,
|
||||
|
|
@ -2766,14 +2659,6 @@ impl to_bytes::IterBytes for substs {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for mt {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_2(&self.ty,
|
||||
&self.mutbl, lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for mt {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_2(&self.ty,
|
||||
|
|
@ -2781,14 +2666,6 @@ impl to_bytes::IterBytes for mt {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for field {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_2(&self.ident,
|
||||
&self.mt, lsb0, f)
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for field {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_2(&self.ident,
|
||||
|
|
@ -2796,15 +2673,6 @@ impl to_bytes::IterBytes for field {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for FnSig {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
to_bytes::iter_bytes_2(&self.inputs,
|
||||
&self.output,
|
||||
lsb0, f);
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for FnSig {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
to_bytes::iter_bytes_2(&self.inputs,
|
||||
|
|
@ -2813,82 +2681,6 @@ impl to_bytes::IterBytes for FnSig {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for sty {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
ty_nil => 0u8.iter_bytes(lsb0, f),
|
||||
ty_bool => 1u8.iter_bytes(lsb0, f),
|
||||
|
||||
ty_int(ref t) =>
|
||||
to_bytes::iter_bytes_2(&2u8, t, lsb0, f),
|
||||
|
||||
ty_uint(ref t) =>
|
||||
to_bytes::iter_bytes_2(&3u8, t, lsb0, f),
|
||||
|
||||
ty_float(ref t) =>
|
||||
to_bytes::iter_bytes_2(&4u8, t, lsb0, f),
|
||||
|
||||
ty_estr(ref v) =>
|
||||
to_bytes::iter_bytes_2(&5u8, v, lsb0, f),
|
||||
|
||||
ty_enum(ref did, ref substs) =>
|
||||
to_bytes::iter_bytes_3(&6u8, did, substs, lsb0, f),
|
||||
|
||||
ty_box(ref mt) =>
|
||||
to_bytes::iter_bytes_2(&7u8, mt, lsb0, f),
|
||||
|
||||
ty_evec(ref mt, ref v) =>
|
||||
to_bytes::iter_bytes_3(&8u8, mt, v, lsb0, f),
|
||||
|
||||
ty_unboxed_vec(ref mt) =>
|
||||
to_bytes::iter_bytes_2(&9u8, mt, lsb0, f),
|
||||
|
||||
ty_tup(ref ts) =>
|
||||
to_bytes::iter_bytes_2(&10u8, ts, lsb0, f),
|
||||
|
||||
ty_bare_fn(ref ft) =>
|
||||
to_bytes::iter_bytes_2(&12u8, ft, lsb0, f),
|
||||
|
||||
ty_self(ref did) => to_bytes::iter_bytes_2(&13u8, did, lsb0, f),
|
||||
|
||||
ty_infer(ref v) =>
|
||||
to_bytes::iter_bytes_2(&14u8, v, lsb0, f),
|
||||
|
||||
ty_param(ref p) =>
|
||||
to_bytes::iter_bytes_2(&15u8, p, lsb0, f),
|
||||
|
||||
ty_type => 16u8.iter_bytes(lsb0, f),
|
||||
ty_bot => 17u8.iter_bytes(lsb0, f),
|
||||
|
||||
ty_ptr(ref mt) =>
|
||||
to_bytes::iter_bytes_2(&18u8, mt, lsb0, f),
|
||||
|
||||
ty_uniq(ref mt) =>
|
||||
to_bytes::iter_bytes_2(&19u8, mt, lsb0, f),
|
||||
|
||||
ty_trait(ref did, ref substs, ref v, ref mutbl) =>
|
||||
to_bytes::iter_bytes_5(&20u8, did, substs, v, mutbl, lsb0, f),
|
||||
|
||||
ty_opaque_closure_ptr(ref ck) =>
|
||||
to_bytes::iter_bytes_2(&21u8, ck, lsb0, f),
|
||||
|
||||
ty_opaque_box => 22u8.iter_bytes(lsb0, f),
|
||||
|
||||
ty_struct(ref did, ref substs) =>
|
||||
to_bytes::iter_bytes_3(&23u8, did, substs, lsb0, f),
|
||||
|
||||
ty_rptr(ref r, ref mt) =>
|
||||
to_bytes::iter_bytes_3(&24u8, r, mt, lsb0, f),
|
||||
|
||||
ty_err => 25u8.iter_bytes(lsb0, f),
|
||||
|
||||
ty_closure(ref ct) =>
|
||||
to_bytes::iter_bytes_2(&26u8, ct, lsb0, f),
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for sty {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -4499,52 +4291,6 @@ pub fn determine_inherited_purity(parent: (ast::purity, ast::node_id),
|
|||
// Here, the supertraits are the transitive closure of the supertrait
|
||||
// relation on the supertraits from each bounded trait's constraint
|
||||
// list.
|
||||
#[cfg(stage0)]
|
||||
pub fn each_bound_trait_and_supertraits(tcx: ctxt,
|
||||
bounds: &ParamBounds,
|
||||
f: &fn(@TraitRef) -> bool) {
|
||||
for bounds.trait_bounds.each |&bound_trait_ref| {
|
||||
let mut supertrait_set = HashMap::new();
|
||||
let mut trait_refs = ~[];
|
||||
let mut i = 0;
|
||||
|
||||
// Seed the worklist with the trait from the bound
|
||||
supertrait_set.insert(bound_trait_ref.def_id, ());
|
||||
trait_refs.push(bound_trait_ref);
|
||||
|
||||
// Add the given trait ty to the hash map
|
||||
while i < trait_refs.len() {
|
||||
debug!("each_bound_trait_and_supertraits(i=%?, trait_ref=%s)",
|
||||
i, trait_refs[i].repr(tcx));
|
||||
|
||||
if !f(trait_refs[i]) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Add supertraits to supertrait_set
|
||||
let supertrait_refs = trait_ref_supertraits(tcx, trait_refs[i]);
|
||||
for supertrait_refs.each |&supertrait_ref| {
|
||||
debug!("each_bound_trait_and_supertraits(supertrait_ref=%s)",
|
||||
supertrait_ref.repr(tcx));
|
||||
|
||||
let d_id = supertrait_ref.def_id;
|
||||
if !supertrait_set.contains_key(&d_id) {
|
||||
// FIXME(#5527) Could have same trait multiple times
|
||||
supertrait_set.insert(d_id, ());
|
||||
trait_refs.push(supertrait_ref);
|
||||
}
|
||||
}
|
||||
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Iterate over a type parameter's bounded traits and any supertraits
|
||||
// of those traits, ignoring kinds.
|
||||
// Here, the supertraits are the transitive closure of the supertrait
|
||||
// relation on the supertraits from each bounded trait's constraint
|
||||
// list.
|
||||
#[cfg(not(stage0))]
|
||||
pub fn each_bound_trait_and_supertraits(tcx: ctxt,
|
||||
bounds: &ParamBounds,
|
||||
f: &fn(@TraitRef) -> bool) -> bool {
|
||||
|
|
|
|||
|
|
@ -828,15 +828,6 @@ pub impl FnCtxt {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn opt_node_ty_substs(&self, id: ast::node_id,
|
||||
f: &fn(&ty::substs) -> bool) {
|
||||
match self.inh.node_type_substs.find(&id) {
|
||||
Some(s) => { f(s); }
|
||||
None => ()
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn opt_node_ty_substs(&self, id: ast::node_id,
|
||||
f: &fn(&ty::substs) -> bool) -> bool {
|
||||
match self.inh.node_type_substs.find(&id) {
|
||||
|
|
|
|||
|
|
@ -118,26 +118,6 @@ pub impl Rcx {
|
|||
}
|
||||
|
||||
/// Try to resolve the type for the given node.
|
||||
#[config(stage0)]
|
||||
fn resolve_expr_type_adjusted(@mut self, expr: @ast::expr) -> ty::t {
|
||||
let ty_unadjusted = self.resolve_node_type(expr.id);
|
||||
if ty::type_is_error(ty_unadjusted) || ty::type_is_bot(ty_unadjusted) {
|
||||
ty_unadjusted
|
||||
} else {
|
||||
let tcx = self.fcx.tcx();
|
||||
let adjustments = self.fcx.inh.adjustments;
|
||||
match adjustments.find_copy(&expr.id) {
|
||||
None => ty_unadjusted,
|
||||
Some(adjustment) => {
|
||||
ty::adjust_ty(tcx, expr.span, ty_unadjusted,
|
||||
Some(adjustment))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Try to resolve the type for the given node.
|
||||
#[config(not(stage0))]
|
||||
fn resolve_expr_type_adjusted(@mut self, expr: @ast::expr) -> ty::t {
|
||||
let ty_unadjusted = self.resolve_node_type(expr.id);
|
||||
if ty::type_is_error(ty_unadjusted) || ty::type_is_bot(ty_unadjusted) {
|
||||
|
|
|
|||
|
|
@ -524,27 +524,6 @@ pub impl CoherenceChecker {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_provided_trait_method(&self,
|
||||
trait_did: ast::def_id,
|
||||
f: &fn(@ty::Method) -> bool) {
|
||||
// Make a list of all the names of the provided methods.
|
||||
// XXX: This is horrible.
|
||||
let mut provided_method_idents = HashSet::new();
|
||||
let tcx = self.crate_context.tcx;
|
||||
for ty::provided_trait_methods(tcx, trait_did).each |ident| {
|
||||
provided_method_idents.insert(*ident);
|
||||
}
|
||||
|
||||
for ty::trait_methods(tcx, trait_did).each |&method| {
|
||||
if provided_method_idents.contains(&method.ident) {
|
||||
if !f(method) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_provided_trait_method(&self,
|
||||
trait_did: ast::def_id,
|
||||
f: &fn(x: @ty::Method) -> bool) -> bool {
|
||||
|
|
|
|||
|
|
@ -544,8 +544,6 @@ use middle::typeck::infer::cres;
|
|||
use util::common::indenter;
|
||||
use util::ppaux::note_and_explain_region;
|
||||
|
||||
#[cfg(stage0)]
|
||||
use core; // NOTE: this can be removed after next snapshot
|
||||
use core::cell::{Cell, empty_cell};
|
||||
use core::hashmap::{HashMap, HashSet};
|
||||
use core::to_bytes;
|
||||
|
|
@ -561,22 +559,6 @@ enum Constraint {
|
|||
ConstrainVarSubReg(RegionVid, Region)
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
impl to_bytes::IterBytes for Constraint {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
|
||||
match *self {
|
||||
ConstrainVarSubVar(ref v0, ref v1) =>
|
||||
to_bytes::iter_bytes_3(&0u8, v0, v1, lsb0, f),
|
||||
|
||||
ConstrainRegSubVar(ref ra, ref va) =>
|
||||
to_bytes::iter_bytes_3(&1u8, ra, va, lsb0, f),
|
||||
|
||||
ConstrainVarSubReg(ref va, ref ra) =>
|
||||
to_bytes::iter_bytes_3(&2u8, va, ra, lsb0, f)
|
||||
}
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
impl to_bytes::IterBytes for Constraint {
|
||||
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
|
||||
match *self {
|
||||
|
|
@ -1773,23 +1755,6 @@ pub impl RegionVarBindings {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each_edge(&mut self,
|
||||
graph: &Graph,
|
||||
node_idx: RegionVid,
|
||||
dir: Direction,
|
||||
op: &fn(edge: &GraphEdge) -> bool) {
|
||||
let mut edge_idx =
|
||||
graph.nodes[node_idx.to_uint()].head_edge[dir as uint];
|
||||
while edge_idx != uint::max_value {
|
||||
let edge_ptr = &graph.edges[edge_idx];
|
||||
if !op(edge_ptr) {
|
||||
return;
|
||||
}
|
||||
edge_idx = edge_ptr.next_edge[dir as uint];
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each_edge(&mut self,
|
||||
graph: &Graph,
|
||||
node_idx: RegionVid,
|
||||
|
|
|
|||
|
|
@ -75,9 +75,6 @@ pub mod middle {
|
|||
}
|
||||
pub mod ty;
|
||||
pub mod subst;
|
||||
#[cfg(stage0)] #[path = "resolve_stage0.rs"]
|
||||
pub mod resolve;
|
||||
#[cfg(not(stage0))]
|
||||
pub mod resolve;
|
||||
#[path = "typeck/mod.rs"]
|
||||
pub mod typeck;
|
||||
|
|
|
|||
|
|
@ -8,9 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#[cfg(stage0)]
|
||||
use core;
|
||||
|
||||
#[deriving(Eq, IterBytes)]
|
||||
pub struct EnumSet<E> {
|
||||
// We must maintain the invariant that no bits are set
|
||||
|
|
@ -60,22 +57,6 @@ pub impl<E:CLike> EnumSet<E> {
|
|||
(self.bits & bit(e)) != 0
|
||||
}
|
||||
|
||||
#[cfg(stage0)]
|
||||
fn each(&self, f: &fn(E) -> bool) {
|
||||
let mut bits = self.bits;
|
||||
let mut index = 0;
|
||||
while bits != 0 {
|
||||
if (bits & 1) != 0 {
|
||||
let e = CLike::from_uint(index);
|
||||
if !f(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
index += 1;
|
||||
bits >>= 1;
|
||||
}
|
||||
}
|
||||
#[cfg(not(stage0))]
|
||||
fn each(&self, f: &fn(E) -> bool) -> bool {
|
||||
let mut bits = self.bits;
|
||||
let mut index = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue