Skip to content

Commit 60a39df

Browse files
authored
Merge pull request #626 from RalfJung/format-padding
test padding in format strings
2 parents 4816bfb + d91ab9a commit 60a39df

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

rust-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-01-30
1+
nightly-2019-02-13

tests/run-pass/format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
fn main() {
22
println!("Hello {}", 13);
3+
println!("{:0<width$}", "hello", width = 10);
34
}

tests/run-pass/format.stdout

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Hello 13
2+
hello00000

tests/run-pass/function_pointers.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
1-
fn f() -> i32 {
2-
42
1+
trait Answer {
2+
fn answer() -> Self;
3+
}
4+
5+
impl Answer for i32 {
6+
fn answer() -> i32 {
7+
42
8+
}
9+
}
10+
11+
// A generic function, to make its address unstable
12+
fn f<T: Answer>() -> T {
13+
Answer::answer()
314
}
415

516
fn g(i: i32) -> i32 {

0 commit comments

Comments
 (0)