File tree Expand file tree Collapse file tree 5 files changed +7
-5
lines changed 
src/tools/run-make-support/src Expand file tree Collapse file tree 5 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -201,7 +201,8 @@ impl Rustc {
201201    } 
202202
203203    /// Specify the target triple, or a path to a custom target json spec file. 
204-      pub  fn  target ( & mut  self ,  target :  & str )  -> & mut  Self  { 
204+      pub  fn  target < S :  AsRef < str > > ( & mut  self ,  target :  S )  -> & mut  Self  { 
205+         let  target = target. as_ref ( ) ; 
205206        self . cmd . arg ( format ! ( "--target={target}" ) ) ; 
206207        self 
207208    } 
Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ impl Rustdoc {
104104    } 
105105
106106    /// Specify the target triple, or a path to a custom target json spec file. 
107-      pub  fn  target ( & mut  self ,  target :  & str )  -> & mut  Self  { 
107+      pub  fn  target < S :  AsRef < str > > ( & mut  self ,  target :  S )  -> & mut  Self  { 
108+         let  target = target. as_ref ( ) ; 
108109        self . cmd . arg ( format ! ( "--target={target}" ) ) ; 
109110        self 
110111    } 
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ fn main() {
2121        . stdin ( "fn main() {}" ) 
2222        . emit ( "link,obj" ) 
2323        . arg ( "-Csave-temps" ) 
24-         . target ( & target) 
24+         . target ( target) 
2525        . run ( ) ; 
2626
2727    // Check linked output has a `.comment` section with the expected content. 
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ fn main() {
2828        // Run rustc with `-Z temps-dir` set to a directory *inside* the inaccessible one, 
2929        // so that it can't create `tmp`. 
3030        rustc ( ) 
31-             . target ( & target ( ) ) 
31+             . target ( target ( ) ) 
3232            . input ( "program.rs" ) 
3333            . arg ( "-Ztemps-dir=inaccessible/tmp" ) 
3434            . run_fail ( ) 
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ fn test(compiler: &str) {
5151
5252    rustc ( ) 
5353        . input ( "test-aslr.rs" ) 
54-         . target ( & target ( ) ) 
54+         . target ( target ( ) ) 
5555        . linker ( compiler) 
5656        . arg ( "-Clinker-flavor=gcc" ) 
5757        . arg ( "-Ctarget-feature=+crt-static" ) 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments