Skip to content

Commit

Permalink
Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait…
Browse files Browse the repository at this point in the history
…-impl-suggestions, r=cjgillot

diagnostics: exclude indirect private deps from trait impl suggest

Fixes #88696
  • Loading branch information
bors committed May 31, 2023
2 parents 165d750 + ff38db0 commit 405badc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
12 changes: 7 additions & 5 deletions std/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "std"
version = "0.0.0"
Expand All @@ -10,12 +12,12 @@ edition = "2021"
crate-type = ["dylib", "rlib"]

[dependencies]
alloc = { path = "../alloc" }
alloc = { path = "../alloc", public = true }
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core" }
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'] }
core = { path = "../core", public = true }
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'], public = true }
compiler_builtins = { version = "0.1.92" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
Expand All @@ -25,7 +27,7 @@ std_detect = { path = "../stdarch/crates/std_detect", default-features = false,
# Dependencies of the `backtrace` crate
addr2line = { version = "0.19.0", optional = true, default-features = false }
rustc-demangle = { version = "0.1.21", features = ['rustc-dep-of-std'] }
miniz_oxide = { version = "0.6.0", optional = true, default-features = false }
miniz_oxide = { version = "0.6.0", optional = true, default-features = false, public = false }
[dependencies.object]
version = "0.30.0"
optional = true
Expand All @@ -40,7 +42,7 @@ rand_xorshift = "0.3.0"
dlmalloc = { version = "0.2.3", features = ['rustc-dep-of-std'] }

[target.x86_64-fortanix-unknown-sgx.dependencies]
fortanix-sgx-abi = { version = "0.5.0", features = ['rustc-dep-of-std'] }
fortanix-sgx-abi = { version = "0.5.0", features = ['rustc-dep-of-std'], public = true }

[target.'cfg(target_os = "hermit")'.dependencies]
hermit-abi = { version = "0.3.0", features = ['rustc-dep-of-std'] }
Expand Down
6 changes: 3 additions & 3 deletions std/src/sys/wasi/fd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl WasiFd {
unsafe { wasi::fd_sync(self.as_raw_fd() as wasi::Fd).map_err(err2io) }
}

pub fn advise(&self, offset: u64, len: u64, advice: wasi::Advice) -> io::Result<()> {
pub(crate) fn advise(&self, offset: u64, len: u64, advice: wasi::Advice) -> io::Result<()> {
unsafe {
wasi::fd_advise(self.as_raw_fd() as wasi::Fd, offset, len, advice).map_err(err2io)
}
Expand Down Expand Up @@ -179,7 +179,7 @@ impl WasiFd {
}
}

pub fn filestat_get(&self) -> io::Result<wasi::Filestat> {
pub(crate) fn filestat_get(&self) -> io::Result<wasi::Filestat> {
unsafe { wasi::fd_filestat_get(self.as_raw_fd() as wasi::Fd).map_err(err2io) }
}

Expand All @@ -199,7 +199,7 @@ impl WasiFd {
unsafe { wasi::fd_filestat_set_size(self.as_raw_fd() as wasi::Fd, size).map_err(err2io) }
}

pub fn path_filestat_get(
pub(crate) fn path_filestat_get(
&self,
flags: wasi::Lookupflags,
path: &str,
Expand Down
4 changes: 2 additions & 2 deletions std/src/sys/wasi/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl FileAttr {
Ok(SystemTime::from_wasi_timestamp(self.meta.ctim))
}

pub fn as_wasi(&self) -> &wasi::Filestat {
pub(crate) fn as_wasi(&self) -> &wasi::Filestat {
&self.meta
}
}
Expand Down Expand Up @@ -142,7 +142,7 @@ impl FileType {
self.bits == wasi::FILETYPE_SYMBOLIC_LINK
}

pub fn bits(&self) -> wasi::Filetype {
pub(crate) fn bits(&self) -> wasi::Filetype {
self.bits
}
}
Expand Down
8 changes: 4 additions & 4 deletions std/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ pub(crate) fn test_rng() -> rand_xorshift::XorShiftRng {
}

// Copied from std::sys_common::io
pub struct TempDir(PathBuf);
pub(crate) struct TempDir(PathBuf);

impl TempDir {
pub fn join(&self, path: &str) -> PathBuf {
pub(crate) fn join(&self, path: &str) -> PathBuf {
let TempDir(ref p) = *self;
p.join(path)
}

pub fn path(&self) -> &Path {
pub(crate) fn path(&self) -> &Path {
let TempDir(ref p) = *self;
p
}
Expand All @@ -49,7 +49,7 @@ impl Drop for TempDir {
}

#[track_caller] // for `test_rng`
pub fn tmpdir() -> TempDir {
pub(crate) fn tmpdir() -> TempDir {
let p = env::temp_dir();
let mut r = test_rng();
let ret = p.join(&format!("rust-{}", r.next_u32()));
Expand Down

0 comments on commit 405badc

Please sign in to comment.