/// Allocates a byte or string literal for `mir::interpret`, read-only
pub fn allocate_bytes(self, bytes: &[u8]) -> interpret::AllocId {
// create an allocation that just contains these bytes
- let alloc = interpret::Allocation::from_byte_aligned_bytes(bytes);
+ let alloc = interpret::Allocation::from_byte_aligned_bytes(bytes, ());
let alloc = self.intern_const_alloc(alloc);
self.alloc_map.lock().allocate(alloc)
}
/// done with either: `-Ztwo-phase-borrows`, `#![feature(nll)]`,
/// or by opting into an edition after 2015.
pub fn two_phase_borrows(self) -> bool {
- if self.features().nll || self.sess.opts.debugging_opts.two_phase_borrows {
- return true;
- }
-
- match self.sess.edition() {
- Edition::Edition2015 => false,
- Edition::Edition2018 => true,
- _ => true,
- }
+ self.sess.rust_2018() || self.features().nll ||
+ self.sess.opts.debugging_opts.two_phase_borrows
}
/// What mode(s) of borrowck should we run? AST? MIR? both?
}
}
- /// Should we emit EndRegion MIR statements? These are consumed by
- /// MIR borrowck, but not when NLL is used.
- pub fn emit_end_regions(self) -> bool {
- self.sess.opts.debugging_opts.emit_end_regions ||
- self.use_mir_borrowck()
- }
-
#[inline]
pub fn local_crate_exports_generics(self) -> bool {
debug_assert!(self.sess.opts.share_generics());
pub fn print_debug_stats(self) {
sty_debug_print!(
self,
- Adt, Array, Slice, RawPtr, Ref, FnDef, FnPtr,
+ Adt, Array, Slice, RawPtr, Ref, FnDef, FnPtr, Placeholder,
Generator, GeneratorWitness, Dynamic, Closure, Tuple, Bound,
Param, Infer, UnnormalizedProjection, Projection, Opaque, Foreign);