-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print variadic argument pattern in HIR pretty printer
- Loading branch information
Showing
3 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// pretty-compare-only | ||
// pretty-mode:hir | ||
// pp-exact:hir-fn-variadic.pp | ||
|
||
#![feature(c_variadic)] | ||
#[prelude_import] | ||
use ::std::prelude::rust_2015::*; | ||
#[macro_use] | ||
extern crate std; | ||
|
||
extern "C" { | ||
fn foo(x: i32, ...); | ||
} | ||
|
||
unsafe extern "C" fn bar(_: i32, mut va2: ...) -> usize { va2.arg::<usize>() } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// pretty-compare-only | ||
// pretty-mode:hir | ||
// pp-exact:hir-fn-variadic.pp | ||
|
||
#![feature(c_variadic)] | ||
|
||
extern "C" { | ||
pub fn foo(x: i32, va1: ...); | ||
} | ||
|
||
pub unsafe extern "C" fn bar(_: i32, mut va2: ...) -> usize { | ||
va2.arg::<usize>() | ||
} |