1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 // Regression test for issue #27583. Unclear how useful this will be
13 // going forward, since the issue in question was EXTREMELY sensitive
14 // to compiler internals (like the precise numbering of nodes), but
20 use std::marker::PhantomData;
22 pub trait Delegate<'tcx> { }
24 pub struct InferCtxt<'a, 'tcx: 'a> {
25 x: PhantomData<&'a Cell<&'tcx ()>>
28 pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
29 x: &'t InferCtxt<'a, 'tcx>,
32 pub struct ExprUseVisitor<'d, 't, 'a: 't, 'tcx:'a+'d> {
33 typer: &'t InferCtxt<'a, 'tcx>,
34 mc: MemCategorizationContext<'t, 'a, 'tcx>,
35 delegate: &'d mut (Delegate<'tcx>+'d),
38 impl<'d,'t,'a,'tcx> ExprUseVisitor<'d,'t,'a,'tcx> {
39 pub fn new(delegate: &'d mut Delegate<'tcx>,
40 typer: &'t InferCtxt<'a, 'tcx>)
41 -> ExprUseVisitor<'d,'t,'a,'tcx>
45 mc: MemCategorizationContext::new(typer),
51 impl<'t, 'a,'tcx> MemCategorizationContext<'t, 'a, 'tcx> {
52 pub fn new(typer: &'t InferCtxt<'a, 'tcx>) -> MemCategorizationContext<'t, 'a, 'tcx> {
53 MemCategorizationContext { x: typer }