]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-27583.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-27583.rs
1 // check-pass
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
5 // what the hey.
6
7 #![allow(warnings)]
8
9 use std::cell::Cell;
10 use std::marker::PhantomData;
11
12 pub trait Delegate<'tcx> { }
13
14 pub struct InferCtxt<'a, 'tcx: 'a> {
15 x: PhantomData<&'a Cell<&'tcx ()>>
16 }
17
18 pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
19 x: &'t InferCtxt<'a, 'tcx>,
20 }
21
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),
26 }
27
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>
32 {
33 ExprUseVisitor {
34 typer: typer,
35 mc: MemCategorizationContext::new(typer),
36 delegate: delegate,
37 }
38 }
39 }
40
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 }
44 }
45 }
46
47 fn main() { }