File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
src/test/run-make/trace-macros-flag Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This test verifies that "-Z trace-macros" works as it should. The traditional
2
+ # "hello world" program provides a small example of this as not only println! is
3
+ # listed, but also print! (since println! expands to this)
4
+
5
+ -include ../tools.mk
6
+
7
+ all :
8
+ $(RUSTC ) -o $(TMPDIR ) /hello -Z trace-macros hello.rs & > $(TMPDIR ) /hello.trace
9
+ diff -u $(TMPDIR ) /hello.trace hello.trace
Original file line number Diff line number Diff line change
1
+ // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ fn main ( ) {
12
+ println ! ( "Hello, World!" ) ;
13
+ }
Original file line number Diff line number Diff line change
1
+ println! { "Hello, World!" }
2
+ print! { concat ! ( "Hello, World!" , "\n" ) }
You can’t perform that action at this time.
0 commit comments