Skip to content

Commit 405badc

Browse files
committed
Auto merge of #111076 - notriddle:notriddle/silence-private-dep-trait-impl-suggestions, r=cjgillot
diagnostics: exclude indirect private deps from trait impl suggest Fixes #88696
2 parents 165d750 + ff38db0 commit 405badc

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

std/Cargo.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
cargo-features = ["public-dependency"]
2+
13
[package]
24
name = "std"
35
version = "0.0.0"
@@ -10,12 +12,12 @@ edition = "2021"
1012
crate-type = ["dylib", "rlib"]
1113

1214
[dependencies]
13-
alloc = { path = "../alloc" }
15+
alloc = { path = "../alloc", public = true }
1416
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
1517
panic_unwind = { path = "../panic_unwind", optional = true }
1618
panic_abort = { path = "../panic_abort" }
17-
core = { path = "../core" }
18-
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'] }
19+
core = { path = "../core", public = true }
20+
libc = { version = "0.2.143", default-features = false, features = ['rustc-dep-of-std'], public = true }
1921
compiler_builtins = { version = "0.1.92" }
2022
profiler_builtins = { path = "../profiler_builtins", optional = true }
2123
unwind = { path = "../unwind" }
@@ -25,7 +27,7 @@ std_detect = { path = "../stdarch/crates/std_detect", default-features = false,
2527
# Dependencies of the `backtrace` crate
2628
addr2line = { version = "0.19.0", optional = true, default-features = false }
2729
rustc-demangle = { version = "0.1.21", features = ['rustc-dep-of-std'] }
28-
miniz_oxide = { version = "0.6.0", optional = true, default-features = false }
30+
miniz_oxide = { version = "0.6.0", optional = true, default-features = false, public = false }
2931
[dependencies.object]
3032
version = "0.30.0"
3133
optional = true
@@ -40,7 +42,7 @@ rand_xorshift = "0.3.0"
4042
dlmalloc = { version = "0.2.3", features = ['rustc-dep-of-std'] }
4143

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

4547
[target.'cfg(target_os = "hermit")'.dependencies]
4648
hermit-abi = { version = "0.3.0", features = ['rustc-dep-of-std'] }

std/src/sys/wasi/fd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl WasiFd {
9696
unsafe { wasi::fd_sync(self.as_raw_fd() as wasi::Fd).map_err(err2io) }
9797
}
9898

99-
pub fn advise(&self, offset: u64, len: u64, advice: wasi::Advice) -> io::Result<()> {
99+
pub(crate) fn advise(&self, offset: u64, len: u64, advice: wasi::Advice) -> io::Result<()> {
100100
unsafe {
101101
wasi::fd_advise(self.as_raw_fd() as wasi::Fd, offset, len, advice).map_err(err2io)
102102
}
@@ -179,7 +179,7 @@ impl WasiFd {
179179
}
180180
}
181181

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

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

202-
pub fn path_filestat_get(
202+
pub(crate) fn path_filestat_get(
203203
&self,
204204
flags: wasi::Lookupflags,
205205
path: &str,

std/src/sys/wasi/fs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl FileAttr {
104104
Ok(SystemTime::from_wasi_timestamp(self.meta.ctim))
105105
}
106106

107-
pub fn as_wasi(&self) -> &wasi::Filestat {
107+
pub(crate) fn as_wasi(&self) -> &wasi::Filestat {
108108
&self.meta
109109
}
110110
}
@@ -142,7 +142,7 @@ impl FileType {
142142
self.bits == wasi::FILETYPE_SYMBOLIC_LINK
143143
}
144144

145-
pub fn bits(&self) -> wasi::Filetype {
145+
pub(crate) fn bits(&self) -> wasi::Filetype {
146146
self.bits
147147
}
148148
}

std/tests/common/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ pub(crate) fn test_rng() -> rand_xorshift::XorShiftRng {
2020
}
2121

2222
// Copied from std::sys_common::io
23-
pub struct TempDir(PathBuf);
23+
pub(crate) struct TempDir(PathBuf);
2424

2525
impl TempDir {
26-
pub fn join(&self, path: &str) -> PathBuf {
26+
pub(crate) fn join(&self, path: &str) -> PathBuf {
2727
let TempDir(ref p) = *self;
2828
p.join(path)
2929
}
3030

31-
pub fn path(&self) -> &Path {
31+
pub(crate) fn path(&self) -> &Path {
3232
let TempDir(ref p) = *self;
3333
p
3434
}
@@ -49,7 +49,7 @@ impl Drop for TempDir {
4949
}
5050

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

0 commit comments

Comments
 (0)