use lint;
use middle;
use hir::TraitMap;
-use hir::def::Def;
+use hir::def::{Def, ExportMap};
use hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
use hir::map as hir_map;
use hir::map::DisambiguatedDefPathData;
/// is relevant; generated by resolve.
pub trait_map: TraitMap,
+ /// Export map produced by name resolution.
+ pub export_map: ExportMap,
+
pub named_region_map: resolve_lifetime::NamedRegionMap,
pub region_maps: RegionMaps,
region_maps: region_maps,
variance_computed: Cell::new(false),
trait_map: resolutions.trait_map,
+ export_map: resolutions.export_map,
fulfilled_predicates: RefCell::new(fulfilled_predicates),
hir: hir,
maps: maps::Maps::new(dep_graph, providers),
ast_ty_to_ty_cache: RefCell::new(NodeMap()),
}, f)
}
+
+ pub fn consider_optimizing<T: Fn() -> String>(&self, msg: T) -> bool {
+ let cname = self.crate_name(LOCAL_CRATE).as_str();
+ self.sess.consider_optimizing(&cname, msg)
+ }
}
impl<'gcx: 'tcx, 'tcx> GlobalCtxt<'gcx> {
}
}
+impl<'a, T, R> InternIteratorElement<T, R> for &'a T
+ where T: Clone + 'a
+{
+ type Output = R;
+ fn intern_with<I: Iterator<Item=Self>, F: FnOnce(&[T]) -> R>(iter: I, f: F) -> Self::Output {
+ f(&iter.cloned().collect::<AccumulateVec<[_; 8]>>())
+ }
+}
+
impl<T, R, E> InternIteratorElement<T, R> for Result<T, E> {
type Output = Result<R, E>;
fn intern_with<I: Iterator<Item=Self>, F: FnOnce(&[T]) -> R>(iter: I, f: F) -> Self::Output {