File tree Expand file tree Collapse file tree 8 files changed +45
-27
lines changed
invalid-symlink-search-path Expand file tree Collapse file tree 8 files changed +45
-27
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,6 @@ run-make/interdependent-c-libraries/Makefile
3838run-make/issue-107094/Makefile
3939run-make/issue-14698/Makefile
4040run-make/issue-15460/Makefile
41- run-make/issue-26006/Makefile
4241run-make/issue-28595/Makefile
4342run-make/issue-33329/Makefile
4443run-make/issue-35164/Makefile
Original file line number Diff line number Diff line change 1+ extern crate foo;
2+
3+ pub fn main ( ) {
4+ let _ = foo:: hello_world ( ) ;
5+ }
Original file line number Diff line number Diff line change 1+ pub fn hello_world ( ) -> i32 {
2+ 42
3+ }
Original file line number Diff line number Diff line change 1+ // In this test, the symlink created is invalid (valid relative to the root, but not
2+ // relatively to where it is located), and used to cause an internal
3+ // compiler error (ICE) when passed as a library search path. This was fixed in #26044,
4+ // and this test checks that the invalid symlink is instead simply ignored.
5+ // See https://github.com/rust-lang/rust/issues/26006
6+
7+ //@ needs-symlink
8+ //Reason: symlink requires elevated permission in Windows
9+
10+ use run_make_support:: { rfs, rustc} ;
11+
12+ fn main ( ) {
13+ // We create two libs: `bar` which depends on `foo`. We need to compile `foo` first.
14+ rfs:: create_dir ( "out" ) ;
15+ rfs:: create_dir ( "out/foo" ) ;
16+ rustc ( )
17+ . input ( "in/foo/lib.rs" )
18+ . crate_name ( "foo" )
19+ . crate_type ( "lib" )
20+ . metadata ( "foo" )
21+ . output ( "out/foo/libfoo.rlib" )
22+ . run ( ) ;
23+ rfs:: create_dir ( "out/bar" ) ;
24+ rfs:: create_dir ( "out/bar/deps" ) ;
25+ rfs:: create_symlink ( "out/foo/libfoo.rlib" , "out/bar/deps/libfoo.rlib" ) ;
26+ // Check that the invalid symlink does not cause an ICE
27+ rustc ( )
28+ . input ( "in/bar/lib.rs" )
29+ . library_search_path ( "dependency=out/bar/deps" )
30+ . run_fail ( )
31+ . assert_exit_code ( 1 )
32+ . assert_stderr_not_contains ( "internal compiler error" ) ;
33+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33// After this was fixed in #22135, this test checks that this bug does not make a resurgence.
44// See https://github.com/rust-lang/rust/issues/22131
55
6- //FIXME(Oneirical): try test-various
6+ //@ ignore-cross-compile
7+ // Reason: rustdoc fails to find the "foo" crate
78
8- use run_make_support:: { rustc, rustdoc} ;
9+ use run_make_support:: { cwd , rustc, rustdoc} ;
910
1011fn main ( ) {
1112 rustc ( ) . cfg ( r#"feature="bar""# ) . crate_type ( "lib" ) . input ( "foo.rs" ) . run ( ) ;
1213 rustdoc ( )
1314 . arg ( "--test" )
1415 . arg ( "--cfg" )
1516 . arg ( r#"feature="bar""# )
17+ . library_search_path ( cwd ( ) )
1618 . input ( "foo.rs" )
1719 . run ( )
1820 . assert_stdout_contains ( "foo.rs - foo (line 1) ... ok" ) ;
You can’t perform that action at this time.
0 commit comments