File tree Expand file tree Collapse file tree 1 file changed +7
-14
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 1 file changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -63,27 +63,20 @@ impl SearchPath {
6363 ( PathKind :: Framework , stripped)
6464 } else if let Some ( stripped) = path. strip_prefix ( "all=" ) {
6565 ( PathKind :: All , stripped)
66- } else if let Some ( stripped) = path. strip_prefix ( "builtin:" ) {
67- if stripped. contains ( std:: path:: is_separator) {
68- early_dcx. early_fatal ( "`-L builtin:` does not accept paths" ) ;
69- }
70-
71- let path =
72- make_target_lib_path ( sysroot, triple. triple ( ) ) . join ( "builtin" ) . join ( stripped) ;
73- if !path. is_dir ( ) {
74- early_dcx. early_fatal ( format ! ( "builtin:{stripped} does not exist" ) ) ;
75- }
76-
77- return Self :: new ( PathKind :: All , path) ;
7866 } else {
7967 ( PathKind :: All , path)
8068 } ;
81- if path. is_empty ( ) {
69+ let dir = match path. strip_prefix ( "@RUSTC_BUILTIN" ) {
70+ Some ( stripped) => {
71+ make_target_lib_path ( sysroot, triple. triple ( ) ) . join ( "builtin" ) . join ( stripped)
72+ }
73+ None => PathBuf :: from ( path) ,
74+ } ;
75+ if dir. as_os_str ( ) . is_empty ( ) {
8276 #[ allow( rustc:: untranslatable_diagnostic) ] // FIXME: make this translatable
8377 early_dcx. early_fatal ( "empty search path given via `-L`" ) ;
8478 }
8579
86- let dir = PathBuf :: from ( path) ;
8780 Self :: new ( kind, dir)
8881 }
8982
You can’t perform that action at this time.
0 commit comments