Skip to content

Commit 0b5f1b8

Browse files
committed
Auto merge of rust-lang#128404 - compiler-errors:revert-dead-code-changes, r=pnkfelix
Revert recent changes to dead code analysis This is a revert to recent changes to dead code analysis, namely: * efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov * a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix * 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix * 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix * 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov * 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this `AnonPipe` type is not publically reachable -- please correct me if I'm wrong cc `@NobodyXu` who added these in #rust-lang#127153. Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs? I apologize for the size of the PR and the churn that it has on the codebase (and for reverting `@mu001999's` work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way. cc `@mu001999` r? `@pnkfelix` Fixes rust-lang#128272 Fixes rust-lang#126169
2 parents 975dc19 + 35cd95f commit 0b5f1b8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

core/src/default.rs

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ use crate::ascii::Char as AsciiChar;
103103
/// ```
104104
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
105105
#[stable(feature = "rust1", since = "1.0.0")]
106+
#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)]
106107
pub trait Default: Sized {
107108
/// Returns the "default value" for a type.
108109
///

std/src/sys/pal/unix/pipe.rs

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ pub fn anon_pipe() -> io::Result<(AnonPipe, AnonPipe)> {
4747
}
4848

4949
impl AnonPipe {
50+
#[allow(dead_code)]
51+
// FIXME: This function seems legitimately unused.
5052
pub fn try_clone(&self) -> io::Result<Self> {
5153
self.0.duplicate().map(Self)
5254
}
@@ -85,6 +87,8 @@ impl AnonPipe {
8587
self.0.is_write_vectored()
8688
}
8789

90+
#[allow(dead_code)]
91+
// FIXME: This function seems legitimately unused.
8892
pub fn as_file_desc(&self) -> &FileDesc {
8993
&self.0
9094
}

0 commit comments

Comments
 (0)