This fixes an accidental regression #46335 where the behavior of
`Path::ends_with` is different from `str::ends_with` (paths operate over
components, strs operate over chars).
// was tagged as #42791) and some more info can be found on #44443 for
// emscripten itself.
let cmd = |linker: &Path| {
// was tagged as #42791) and some more info can be found on #44443 for
// emscripten itself.
let cmd = |linker: &Path| {
- if cfg!(windows) && linker.ends_with(".bat") {
- let mut cmd = Command::new("cmd");
- cmd.arg("/c").arg(linker);
- cmd
- } else {
- Command::new(linker)
+ if let Some(linker) = linker.to_str() {
+ if cfg!(windows) && linker.ends_with(".bat") {
+ let mut cmd = Command::new("cmd");
+ cmd.arg("/c").arg(linker);
+ return cmd
+ }
};
if let Some(ref linker) = sess.opts.cg.linker {
};
if let Some(ref linker) = sess.opts.cg.linker {