From fd0dccd4b12169e0aac42aff8addbb26b6d72197 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 15 Jun 2019 02:34:11 +0700 Subject: [PATCH] Fix wrong lifetime of TyCtxt Rustup rust-lang/rust#61817 --- rust-version | 2 +- src/bin/miri-rustc-tests.rs | 2 +- src/lib.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust-version b/rust-version index b945d0b3a2..e60eb6c949 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -d8f50ab0ea6c529c24e575279acc72093caeb679 +9606f6fa64926a84d82e3c62dbdc57f5c10f756d diff --git a/src/bin/miri-rustc-tests.rs b/src/bin/miri-rustc-tests.rs index e8714123ce..9b0d02f4b7 100644 --- a/src/bin/miri-rustc-tests.rs +++ b/src/bin/miri-rustc-tests.rs @@ -43,7 +43,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls { compiler.session().abort_if_errors(); compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| { if std::env::args().any(|arg| arg == "--test") { - struct Visitor<'tcx>(TyCtxt<'tcx, 'tcx>); + struct Visitor<'tcx>(TyCtxt<'tcx>); impl<'tcx, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'tcx> { fn visit_item(&mut self, i: &'hir hir::Item) { if let hir::ItemKind::Fn(.., body_id) = i.node { diff --git a/src/lib.rs b/src/lib.rs index 822b173e34..061b07478a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,7 @@ pub struct MiriConfig { // Used by priroda. pub fn create_ecx<'mir, 'tcx: 'mir>( - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig, ) -> InterpResult<'tcx, InterpretCx<'mir, 'tcx, Evaluator<'tcx>>> { @@ -212,7 +212,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>( } pub fn eval_main<'tcx>( - tcx: TyCtxt<'tcx, 'tcx>, + tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig, ) { @@ -475,7 +475,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> { fn find_foreign_static( def_id: DefId, - tcx: TyCtxtAt<'tcx, 'tcx>, + tcx: TyCtxtAt<'tcx>, ) -> InterpResult<'tcx, Cow<'tcx, Allocation>> { let attrs = tcx.get_attrs(def_id); let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {