2 // Regression test for issue #27583. Unclear how useful this will be
3 // going forward, since the issue in question was EXTREMELY sensitive
4 // to compiler internals (like the precise numbering of nodes), but
10 use std
::marker
::PhantomData
;
12 pub trait Delegate
<'tcx
> { }
14 pub struct InferCtxt
<'a
, 'tcx
: 'a
> {
15 x
: PhantomData
<&'a Cell
<&'
tcx ()>>
18 pub struct MemCategorizationContext
<'t
, 'a
: 't
, 'tcx
: 'a
> {
19 x
: &'t InferCtxt
<'a
, 'tcx
>,
22 pub struct ExprUseVisitor
<'d
, 't
, 'a
: 't
, 'tcx
:'a
+'d
> {
23 typer
: &'t InferCtxt
<'a
, 'tcx
>,
24 mc
: MemCategorizationContext
<'t
, 'a
, 'tcx
>,
25 delegate
: &'d
mut (Delegate
<'tcx
>+'d
),
28 impl<'d
,'t
,'a
,'tcx
> ExprUseVisitor
<'d
,'t
,'a
,'tcx
> {
29 pub fn new(delegate
: &'d
mut Delegate
<'tcx
>,
30 typer
: &'t InferCtxt
<'a
, 'tcx
>)
31 -> ExprUseVisitor
<'d
,'t
,'a
,'tcx
>
35 mc
: MemCategorizationContext
::new(typer
),
41 impl<'t
, 'a
,'tcx
> MemCategorizationContext
<'t
, 'a
, 'tcx
> {
42 pub fn new(typer
: &'t InferCtxt
<'a
, 'tcx
>) -> MemCategorizationContext
<'t
, 'a
, 'tcx
> {
43 MemCategorizationContext { x: typer }