File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ feature( int_format_into) ]
2
+
3
+ use std:: fmt:: NumBuffer ;
4
+
5
+ fn main ( ) {
6
+ let x = 0u32 ;
7
+ let mut buf = NumBuffer :: < u8 > :: new ( ) ;
8
+ x. format_into ( & mut buf) ; //~ ERROR
9
+ }
Original file line number Diff line number Diff line change
1
+ // Test to ensure that if you use a `NumBuffer` with a too small integer, it
2
+ // will fail at compilation time.
3
+
4
+ // FIXME: This test should be a `ui` test, but not possible for the following reasons:
5
+ // * With the default `--emit`, the compilation succeeds, we can go around by using `--emit=link`
6
+ // but then we get the second problem.
7
+ // * Compilation error is not generated in the JSON output.
8
+ //
9
+ // So for not we go around this problem by moving it in `run-make` until we figure out what's
10
+ // going on.
11
+
12
+ //@ needs-target-std
13
+
14
+ use run_make_support:: rustc;
15
+
16
+ fn main ( ) {
17
+ rustc ( )
18
+ . input ( "main.rs" )
19
+ . run_fail ( )
20
+ . assert_stderr_contains ( "buffer is not big enough" ) ;
21
+ }
You can’t perform that action at this time.
0 commit comments