Skip to content

Commit 3cb9966

Browse files
committed
Add a HIR pretty printing test for delegation.
Note that some of the output is currently bogus, with missing params and args: ``` fn add(: _, : _) -> _ { m::add(, ) } ``` The next commit will fix this.
1 parent 51548ce commit 3cb9966

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

tests/pretty/hir-delegation.pp

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//@ pretty-compare-only
2+
//@ pretty-mode:hir
3+
//@ pp-exact:hir-delegation.pp
4+
5+
#![allow(incomplete_features)]#![feature(fn_delegation)]
6+
#[prelude_import]
7+
use ::std::prelude::rust_2015::*;
8+
#[macro_use]
9+
extern crate std;
10+
11+
fn b<C>(e: C) { }
12+
13+
trait G {
14+
fn b(: _) -> _ { b({ }) }
15+
}
16+
17+
mod m {
18+
fn add(a: u32, b: u32) -> u32 { a + b }
19+
}
20+
21+
fn add(: _, : _) -> _ { m::add(, ) }
22+
23+
fn main() { { let _ = add(1, 2); }; }

tests/pretty/hir-delegation.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ pretty-compare-only
2+
//@ pretty-mode:hir
3+
//@ pp-exact:hir-delegation.pp
4+
5+
#![allow(incomplete_features)]
6+
#![feature(fn_delegation)]
7+
8+
fn b<C>(e: C) {}
9+
10+
trait G {
11+
reuse b {}
12+
}
13+
14+
mod m {
15+
pub fn add(a: u32, b: u32) -> u32 { a + b }
16+
}
17+
18+
reuse m::add;
19+
20+
fn main() {
21+
_ = add(1, 2);
22+
}

0 commit comments

Comments
 (0)