Skip to content

Commit d69c02e

Browse files
committed
Fix wrong lifetime of TyCtxt
Rustup rust-lang/rust#61817
1 parent 4736692 commit d69c02e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/bin/miri-rustc-tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl rustc_driver::Callbacks for MiriCompilerCalls {
4343
compiler.session().abort_if_errors();
4444
compiler.global_ctxt().unwrap().peek_mut().enter(|tcx| {
4545
if std::env::args().any(|arg| arg == "--test") {
46-
struct Visitor<'tcx>(TyCtxt<'tcx, 'tcx>);
46+
struct Visitor<'tcx>(TyCtxt<'tcx>);
4747
impl<'tcx, 'hir> itemlikevisit::ItemLikeVisitor<'hir> for Visitor<'tcx> {
4848
fn visit_item(&mut self, i: &'hir hir::Item) {
4949
if let hir::ItemKind::Fn(.., body_id) = i.node {

src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub struct MiriConfig {
7272

7373
// Used by priroda.
7474
pub fn create_ecx<'mir, 'tcx: 'mir>(
75-
tcx: TyCtxt<'tcx, 'tcx>,
75+
tcx: TyCtxt<'tcx>,
7676
main_id: DefId,
7777
config: MiriConfig,
7878
) -> InterpResult<'tcx, InterpretCx<'mir, 'tcx, Evaluator<'tcx>>> {
@@ -212,7 +212,7 @@ pub fn create_ecx<'mir, 'tcx: 'mir>(
212212
}
213213

214214
pub fn eval_main<'tcx>(
215-
tcx: TyCtxt<'tcx, 'tcx>,
215+
tcx: TyCtxt<'tcx>,
216216
main_id: DefId,
217217
config: MiriConfig,
218218
) {
@@ -475,7 +475,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
475475

476476
fn find_foreign_static(
477477
def_id: DefId,
478-
tcx: TyCtxtAt<'tcx, 'tcx>,
478+
tcx: TyCtxtAt<'tcx>,
479479
) -> InterpResult<'tcx, Cow<'tcx, Allocation>> {
480480
let attrs = tcx.get_attrs(def_id);
481481
let link_name = match attr::first_attr_value_str_by_name(&attrs, sym::link_name) {

0 commit comments

Comments
 (0)