]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-27583.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / issues / issue-27583.rs
CommitLineData
60c5eb7d 1// check-pass
e9174d1e
SL
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
9use std::cell::Cell;
10use std::marker::PhantomData;
11
12pub trait Delegate<'tcx> { }
13
14pub struct InferCtxt<'a, 'tcx: 'a> {
15 x: PhantomData<&'a Cell<&'tcx ()>>
16}
17
18pub struct MemCategorizationContext<'t, 'a: 't, 'tcx : 'a> {
19 x: &'t InferCtxt<'a, 'tcx>,
20}
21
22pub 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
28impl<'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
41impl<'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
47fn main() { }