Implement AsRef<OsStr> for Cow<'_, Path> by thaliaarchi · Pull Request #139432 · rust-lang/rust (original) (raw)

#20 exporting to docker image format
#20 sending tarball 20.9s done
#20 DONE 27.1s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-19]
[CI_JOB_NAME=x86_64-gnu-llvm-19]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Listening on address 127.0.0.1:4226
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-19', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--set', 'build.print-step-timings', '--enable-verbose-tests', '--set', 'build.metrics', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: build.build          := x86_64-unknown-linux-gnu
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-19/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
  Number of decisions:   4447
  longest path:          1159 (code:    152)
  longest backtrack:       66 (code:    428)
Shared 86733 out of 152951 states by creating 14756 new states, saving 71977
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc: In function ‘rtx_def* extract_bit_field_1(rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, bool, rtx_def**)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1864:45: warning: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ may be used uninitialized [-Wmaybe-uninitialized]
 1864 |       rtx sub = extract_bit_field_as_subreg (mode1, op0, imode,
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
 1865 |                                              bitsize, bitnum);
      |                                              ~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/expmed.cc:1824:19: note: ‘*(unsigned int*)((char*)&imode + offsetof(scalar_int_mode, scalar_int_mode::m_mode))’ was declared here
 1824 |   scalar_int_mode imode;
      |                   ^~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc: In member function ‘void range_def_chain::dump(FILE*, basic_block, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gimple-range-gori.cc:319:19: warning: format not a string literal and no format arguments [-Wformat-security]
  319 |           fprintf (f, prefix);
      |           ~~~~~~~~^~~~~~~~~~~
---
                 from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/region-model.h:33,
                 from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:39:
In constructor ‘ana::byte_range::byte_range(ana::byte_offset_t, ana::byte_size_t)’,
    inlined from ‘virtual text_art::table ana::string_literal_spatial_item::make_table(const ana::bit_to_table_map&, text_art::style_manager&) const’ at /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:1812:18:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/store.h:312:5: warning: ‘size_in_bytes.generic_wide_int<fixed_wide_int_storage<128> >::fixed_wide_int_storage<128>.fixed_wide_int_storage<128>::val[1]’ may be used uninitialized [-Wmaybe-uninitialized]
  312 |     m_size_in_bytes (size_in_bytes)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc: In member function ‘virtual text_art::table ana::string_literal_spatial_item::make_table(const ana::bit_to_table_map&, text_art::style_manager&) const’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/analyzer/access-diagram.cc:1808:28: note: ‘size_in_bytes.generic_wide_int<fixed_wide_int_storage<128> >::fixed_wide_int_storage<128>.fixed_wide_int_storage<128>::val[1]’ was declared here
 1808 |                byte_size_t size_in_bytes
      |                            ^~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/diagnostic.cc: In function ‘void fancy_abort(const char*, int, const char*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/diagnostic.cc:1677:15: warning: format not a string literal and no format arguments [-Wformat-security]
 1677 |       fnotice (stderr, diagnostic_kind_text[DK_ICE]);
---
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:7930:9: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 7930 |   write (fd, "\n\n", 2);
      |   ~~~~~~^~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc: In member function ‘void driver::final_actions() const’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gcc.cc:9307:13: warning: ignoring return value of ‘int truncate(const char*, __off_t)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 9307 |     truncate(totruncate_file, 0);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/gengtype-lex.l: In function ‘int yylex(const char**)’:
gengtype-lex.cc:357:15: warning: this statement may fall through [-Wimplicit-fallthrough=]
  357 | #define YY_DO_BEFORE_ACTION \
      |  ~~~~~~~~~~~~~^~~~~~~
---
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc: In function ‘void lto_resolution_read(splay_tree, FILE*, lto_file*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2091:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2091 |   fscanf (resolution, " ");   /* Read white space.  */
      |   ~~~~~~~^~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2093:9: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2093 |   fread (obj_name, sizeof (char), name_len, resolution);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/lto/lto-common.cc:2113:10: warning: ignoring return value of ‘int fscanf(FILE*, const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
 2113 |   fscanf (resolution, "%u", &num_symbols);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/gcc/jit/jit-recording.cc:32:
---
Applying io_quotes_use            to linux/blkzoned.h
Applying io_quotes_use            to linux/ipmi.h
Applying io_quotes_use            to linux/psp-dbc.h
Applying io_quotes_use            to linux/bt-bmc.h
Applying io_quotes_use            to linux/tps6594_pfsm.h
Applying io_quotes_use            to linux/cxl_mem.h
Applying io_quotes_use            to linux/wmi.h
Applying io_quotes_use            to linux/auto_fs.h
Applying io_quotes_use            to linux/mmtimer.h
Applying io_quotes_use            to linux/f2fs.h
Applying io_quotes_use            to linux/vhost.h
---
Applying io_quotes_use            to sound/asound.h
Applying io_quotes_use            to sound/compress_offload.h
Applying hpux8_bogus_inlines      to math.h
Applying pthread_incomplete_struct_argument to pthread.h
Fixed:  pthread.h
Applying io_quotes_use            to misc/mrvl_cn10k_dpi.h
Applying io_quotes_use            to misc/ocxl.h
Applying io_quotes_use            to misc/cxl.h
Applying io_quotes_use            to misc/xilinx_sdfec.h
Applying io_quotes_def            to unicode/platform.h
Applying sun_malloc               to malloc.h
Applying io_quotes_use            to scsi/cxlflash_ioctl.h
---
Applying machine_name             to x86_64-linux-gnu/bits/unistd_ext.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/mtrr.h
Applying io_quotes_use            to x86_64-linux-gnu/asm/amd_hsmp.h
Applying machine_name             to openssl/e_os2.h
Applying io_quotes_use            to drm/xe_drm.h
Applying io_quotes_use            to drm/radeon_drm.h
Applying io_quotes_use            to drm/panfrost_drm.h
Applying io_quotes_use            to drm/etnaviv_drm.h
Applying io_quotes_use            to drm/lima_drm.h
Applying io_quotes_use            to drm/qaic_accel.h
Applying io_quotes_use            to drm/vc4_drm.h
Applying io_quotes_use            to drm/i915_drm.h
Applying io_quotes_use            to drm/omap_drm.h
Applying io_quotes_use            to drm/pvr_drm.h
Applying io_quotes_use            to drm/amdgpu_drm.h
Applying io_quotes_use            to drm/vgem_drm.h
Applying io_quotes_use            to drm/msm_drm.h
Applying io_quotes_use            to drm/v3d_drm.h
Applying io_quotes_use            to drm/exynos_drm.h
Applying io_quotes_use            to drm/nouveau_drm.h
Applying io_quotes_use            to drm/drm.h
Applying io_quotes_use            to drm/habanalabs_accel.h
Applying io_quotes_use            to drm/tegra_drm.h
Applying io_quotes_use            to rdma/rdma_user_ioctl.h
cc1: note: self-tests are not enabled in this build
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc: In function ‘void server(bool, int, module_resolver*)’:
/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/src/c++tools/server.cc:620:10: warning: ignoring return value of ‘int pipe(int*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
---
[RUSTC-TIMING] proc_macro test:false 5.015
[RUSTC-TIMING] test test:false 9.196
    Finished `release` profile [optimized] target(s) in 1m 21s
##[endgroup]
[TIMING] core::build_steps::compile::Std { target: x86_64-unknown-linux-gnu, compiler: Compiler { stage: 1, host: x86_64-unknown-linux-gnu, forced_compiler: true }, crates: [], force_recompile: false, extra_rust_args: ["-Csymbol-mangling-version=v0", "-Cpanic=abort"], is_for_mir_opt_tests: false } -- 81.087
Testing GCC stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
 Downloading crates ...
  Downloaded boml v0.3.1
   Compiling boml v0.3.1
[RUSTC-TIMING] boml test:false 0.823
   Compiling y v0.1.0 (/checkout/compiler/rustc_codegen_gcc/build_system)
[RUSTC-TIMING] y test:false 3.078
    Finished `release` profile [optimized] target(s) in 4.37s
     Running `/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-codegen/x86_64-unknown-linux-gnu/release/y test --use-backend gcc --gcc-path /checkout/obj/build/x86_64-unknown-linux-gnu/gcc/install/lib --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-tools/cg_gcc --release --mini-tests --std-tests`
`--gcc-path` was provided, ignoring config file. Using `/checkout/obj/build/x86_64-unknown-linux-gnu/gcc/install/lib` as path for libgccjit
[BUILD] mini_core
[RUSTC-TIMING] mini_core test:false 0.198
[BUILD] example
[AOT] mini_core_hello_world
[RUSTC-TIMING] mini_core_hello_world test:false 0.188
---
   Compiling cargo-platform v0.2.0 (/checkout/src/tools/cargo/crates/cargo-platform)
error[E0282]: type annotations needed
  --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-pathspec-0.9.0/src/pattern.rs:92:51
   |
92 |         let path = match gix_path::normalize(path.as_ref().into(), assure_path_cannot_break_out_upwards) {
   |                                                   ^^^^^^   ---- type must be known at this point
   |
help: try using a fully qualified path to specify the expected types
   |
92 -         let path = match gix_path::normalize(path.as_ref().into(), assure_path_cannot_break_out_upwards) {
92 +         let path = match gix_path::normalize(<Cow<'_, std::path::Path> as AsRef<T>>::as_ref(&path).into(), assure_path_cannot_break_out_upwards) {
   |

[RUSTC-TIMING] gix_lock test:false 2.020
[RUSTC-TIMING] clap_complete test:false 16.644
   Compiling gix-revwalk v0.18.0
---
    |                        ^^^^^^   ---- type must be known at this point
    |
help: try using a fully qualified path to specify the expected types
    |
259 -                 prefix.as_ref().into()
259 +                 <Cow<'_, Path> as AsRef<T>>::as_ref(prefix).into()
    |

error[E0283]: type annotations needed
   --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/overlay_iter.rs:306:30
    |
306 |         let iter_root = base.join(prefix.as_ref());
    |                              ^^^^        ------ type must be known at this point
    |                              |
    |                              cannot infer type of the type parameter `P` declared on the method `join`
    |
    = note: multiple `impl`s satisfying `Cow<'_, Path>: AsRef<_>` found in the following crates: `alloc`, `std`:
            - impl AsRef<OsStr> for Cow<'_, Path>;
            - impl<T> AsRef<T> for Cow<'_, T>
              where T: ToOwned, T: ?Sized;
help: consider specifying the generic argument
    |
306 |         let iter_root = base.join::<&T>(prefix.as_ref());
    |                                  ++++++

[RUSTC-TIMING] gix_revwalk test:false 0.805
error[E0283]: type annotations needed
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/overlay_iter.rs:306:30
     |
306  |         let iter_root = base.join(prefix.as_ref());
     |                              ^^^^ cannot infer type of the type parameter `P` declared on the method `join`
     |
     = note: multiple `impl`s satisfying `_: AsRef<Path>` found in the following crates: `std`, `tempfile`:
             - impl AsRef<Path> for OsStr;
             - impl AsRef<Path> for OsString;
             - impl AsRef<Path> for Path;
             - impl AsRef<Path> for PathBuf;
             - impl AsRef<Path> for String;
             - impl AsRef<Path> for str;
             - impl AsRef<Path> for tempfile::dir::TempDir;
             - impl AsRef<Path> for tempfile::file::TempPath;
     = note: required for `&_` to implement `AsRef<Path>`
note: required by a bound in `Path::join`
    --> /checkout/library/std/src/path.rs:2683:20
     |
2683 |     pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf {
     |                    ^^^^^^^^^^^ required by this bound in `Path::join`
help: consider specifying the generic argument
     |
306  |         let iter_root = base.join::<&T>(prefix.as_ref());
     |                                  ++++++

[RUSTC-TIMING] gix_shallow test:false 2.344
error[E0283]: type annotations needed
  --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/transaction/prepare.rs:62:30
   |
62 |                         base.join(relative_path.as_ref()),
   |                              ^^^^               ------ type must be known at this point
   |                              |
   |                              cannot infer type of the type parameter `P` declared on the method `join`
   |
   = note: multiple `impl`s satisfying `Cow<'_, Path>: AsRef<_>` found in the following crates: `alloc`, `std`:
           - impl AsRef<OsStr> for Cow<'_, Path>;
           - impl<T> AsRef<T> for Cow<'_, T>
             where T: ToOwned, T: ?Sized;
help: consider specifying the generic argument
   |
62 |                         base.join::<&T>(relative_path.as_ref()),
   |                                  ++++++

error[E0283]: type annotations needed
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/transaction/prepare.rs:62:30
     |
62   |                         base.join(relative_path.as_ref()),
     |                              ^^^^ cannot infer type of the type parameter `P` declared on the method `join`
     |
     = note: multiple `impl`s satisfying `_: AsRef<Path>` found in the following crates: `std`, `tempfile`:
             - impl AsRef<Path> for OsStr;
             - impl AsRef<Path> for OsString;
             - impl AsRef<Path> for Path;
             - impl AsRef<Path> for PathBuf;
             - impl AsRef<Path> for String;
             - impl AsRef<Path> for str;
             - impl AsRef<Path> for tempfile::dir::TempDir;
             - impl AsRef<Path> for tempfile::file::TempPath;
     = note: required for `&_` to implement `AsRef<Path>`
note: required by a bound in `Path::join`
    --> /checkout/library/std/src/path.rs:2683:20
     |
2683 |     pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf {
     |                    ^^^^^^^^^^^ required by this bound in `Path::join`
help: consider specifying the generic argument
     |
62   |                         base.join::<&T>(relative_path.as_ref()),
     |                                  ++++++

error[E0283]: type annotations needed
   --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/transaction/prepare.rs:111:30
    |
111 |                         base.join(relative_path.as_ref()),
    |                              ^^^^               ------ type must be known at this point
    |                              |
    |                              cannot infer type of the type parameter `P` declared on the method `join`
    |
    = note: multiple `impl`s satisfying `Cow<'_, Path>: AsRef<_>` found in the following crates: `alloc`, `std`:
            - impl AsRef<OsStr> for Cow<'_, Path>;
            - impl<T> AsRef<T> for Cow<'_, T>
              where T: ToOwned, T: ?Sized;
help: consider specifying the generic argument
    |
111 |                         base.join::<&T>(relative_path.as_ref()),
    |                                  ++++++

error[E0283]: type annotations needed
    --> /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/gix-ref-0.50.0/src/store/file/transaction/prepare.rs:111:30
     |
111  |                         base.join(relative_path.as_ref()),
     |                              ^^^^ cannot infer type of the type parameter `P` declared on the method `join`
     |
     = note: multiple `impl`s satisfying `_: AsRef<Path>` found in the following crates: `std`, `tempfile`:
             - impl AsRef<Path> for OsStr;
             - impl AsRef<Path> for OsString;
             - impl AsRef<Path> for Path;
             - impl AsRef<Path> for PathBuf;
             - impl AsRef<Path> for String;
             - impl AsRef<Path> for str;
             - impl AsRef<Path> for tempfile::dir::TempDir;
             - impl AsRef<Path> for tempfile::file::TempPath;
     = note: required for `&_` to implement `AsRef<Path>`
note: required by a bound in `Path::join`
    --> /checkout/library/std/src/path.rs:2683:20
     |
2683 |     pub fn join<P: AsRef<Path>>(&self, path: P) -> PathBuf {
     |                    ^^^^^^^^^^^ required by this bound in `Path::join`
help: consider specifying the generic argument
     |
111  |                         base.join::<&T>(relative_path.as_ref()),
     |                                  ++++++

[RUSTC-TIMING] serde_json test:false 8.430
[RUSTC-TIMING] tracing_chrome test:false 2.441
[RUSTC-TIMING] icu_normalizer test:false 4.915