File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+ #![ crate_type = "lib" ]
3+ // bbb
4+ pub struct Foo ;
5+
6+ impl Foo {
7+ pub fn bar ( self : Foo ) { }
8+ }
Original file line number Diff line number Diff line change 1+ #![ crate_name = "foo" ]
2+ #![ crate_type = "lib" ]
3+ // aaa
4+ pub struct Foo ;
5+
6+ impl Foo {
7+ pub fn bar ( self : Foo ) { }
8+ }
Original file line number Diff line number Diff line change 1+ // tests that we can reuse an existing rlib instead of rebuilding
2+ // when changin a non-doc comments in a file
3+ use run_make_support:: { rfs, rustc} ;
4+ use std:: path:: Path ;
5+ use std:: hash:: { Hash , Hasher } ;
6+
7+ fn main ( ) {
8+ let before = check_and_hash ( "before.rs" ) ;
9+ let after = check_and_hash ( "after.rs" ) ;
10+ dbg ! ( before, after) ;
11+ assert_eq ! ( before, after) ;
12+ }
13+
14+ fn check_and_hash < P > ( filename : P ) -> u64
15+ where
16+ P : AsRef < Path > ,
17+ {
18+ rfs:: rename ( filename, "foo.rs" ) ;
19+ rustc ( ) . input ( "foo.rs" ) . emit ( "metadata" ) . run ( ) ;
20+ // hash the output
21+ let bytes = rfs:: read ( "libfoo.rmeta" ) ;
22+ let mut hasher = std:: hash:: DefaultHasher :: new ( ) ;
23+ bytes. hash ( & mut hasher) ;
24+ hasher. finish ( )
25+ }
You can’t perform that action at this time.
0 commit comments