Auto merge of #61995 - eddyb:hir-sep-ptr, r=petrochenkov

rustc: use a separate copy of P for HIR than for AST.

Note: this currently includes/is based on top of #61987.

Like #61968, but goes one step further and uses a separate `P<...>` for the HIR, with no `Clone`, or the ability to mutate after allocation.
There is still `into_inner`/`into_iter`, but they're only exposed for `hir::lowering`, and they would take more work to untangle.

r? @petrochenkov cc @rust-lang/compiler
This commit is contained in:
bors 2019-07-03 10:57:39 +00:00
commit 8c6fb028ca
22 changed files with 183 additions and 34 deletions

View file

@ -20,6 +20,7 @@ use rustc::mir::interpret::{GlobalId, ConstValue};
use rustc::hir;
use rustc::hir::def::{CtorKind, DefKind, Res};
use rustc::hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use rustc::hir::ptr::P;
use rustc::ty::subst::{InternalSubsts, SubstsRef, UnpackedKind};
use rustc::ty::{self, DefIdTree, TyCtxt, Region, RegionVid, Ty, AdtKind};
use rustc::ty::fold::TypeFolder;
@ -29,7 +30,6 @@ use syntax::ast::{self, AttrStyle, Ident};
use syntax::attr;
use syntax::ext::base::MacroKind;
use syntax::source_map::{dummy_spanned, Spanned};
use syntax::ptr::P;
use syntax::symbol::{Symbol, kw, sym};
use syntax::symbol::InternedString;
use syntax_pos::{self, Pos, FileName};

View file

@ -6,11 +6,11 @@ use syntax::ast;
use syntax::ast::{Name, NodeId};
use syntax::attr;
use syntax::ext::base::MacroKind;
use syntax::ptr::P;
use syntax_pos::{self, Span};
use rustc::hir;
use rustc::hir::def_id::CrateNum;
use rustc::hir::ptr::P;
pub struct Module<'hir> {
pub name: Option<Name>,