mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
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.
This commit is contained in:
parent
51548ce71f
commit
3cb9966235
23
tests/pretty/hir-delegation.pp
Normal file
23
tests/pretty/hir-delegation.pp
Normal file
@ -0,0 +1,23 @@
|
||||
//@ pretty-compare-only
|
||||
//@ pretty-mode:hir
|
||||
//@ pp-exact:hir-delegation.pp
|
||||
|
||||
#![allow(incomplete_features)]#![feature(fn_delegation)]
|
||||
#[prelude_import]
|
||||
use ::std::prelude::rust_2015::*;
|
||||
#[macro_use]
|
||||
extern crate std;
|
||||
|
||||
fn b<C>(e: C) { }
|
||||
|
||||
trait G {
|
||||
fn b(: _) -> _ { b({ }) }
|
||||
}
|
||||
|
||||
mod m {
|
||||
fn add(a: u32, b: u32) -> u32 { a + b }
|
||||
}
|
||||
|
||||
fn add(: _, : _) -> _ { m::add(, ) }
|
||||
|
||||
fn main() { { let _ = add(1, 2); }; }
|
22
tests/pretty/hir-delegation.rs
Normal file
22
tests/pretty/hir-delegation.rs
Normal file
@ -0,0 +1,22 @@
|
||||
//@ pretty-compare-only
|
||||
//@ pretty-mode:hir
|
||||
//@ pp-exact:hir-delegation.pp
|
||||
|
||||
#![allow(incomplete_features)]
|
||||
#![feature(fn_delegation)]
|
||||
|
||||
fn b<C>(e: C) {}
|
||||
|
||||
trait G {
|
||||
reuse b {}
|
||||
}
|
||||
|
||||
mod m {
|
||||
pub fn add(a: u32, b: u32) -> u32 { a + b }
|
||||
}
|
||||
|
||||
reuse m::add;
|
||||
|
||||
fn main() {
|
||||
_ = add(1, 2);
|
||||
}
|
Loading…
Reference in New Issue
Block a user