diff options
| author | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-05-21 19:35:49 +0200 |
|---|---|---|
| committer | Fabian Wolff <fabian.wolff@alumni.ethz.ch> | 2021-09-09 19:49:07 +0200 |
| commit | 79adda930f9b607ecb4819ed7abcf1cd285e938a (patch) | |
| tree | 96a1db43372408e95bcd5c6c5f250a43382a17cb /library | |
| parent | 497ee321af3b8496eaccd7af7b437f18bab81abf (diff) | |
| download | rust-79adda930f9b607ecb4819ed7abcf1cd285e938a.tar.gz rust-79adda930f9b607ecb4819ed7abcf1cd285e938a.zip | |
Ignore automatically derived impls of `Clone` and `Debug` in dead code analysis
Diffstat (limited to 'library')
| -rw-r--r-- | library/core/src/clone.rs | 1 | ||||
| -rw-r--r-- | library/core/src/fmt/mod.rs | 1 | ||||
| -rw-r--r-- | library/core/tests/fmt/builders.rs | 1 | ||||
| -rw-r--r-- | library/std/src/io/buffered/tests.rs | 4 | ||||
| -rw-r--r-- | library/test/src/term/terminfo/mod.rs | 1 |
5 files changed, 4 insertions, 4 deletions
diff --git a/library/core/src/clone.rs b/library/core/src/clone.rs index 19faf9cddac..b02333b0288 100644 --- a/library/core/src/clone.rs +++ b/library/core/src/clone.rs @@ -105,6 +105,7 @@ #[stable(feature = "rust1", since = "1.0.0")] #[lang = "clone"] #[rustc_diagnostic_item = "Clone"] +#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)] pub trait Clone: Sized { /// Returns a copy of the value. /// diff --git a/library/core/src/fmt/mod.rs b/library/core/src/fmt/mod.rs index 0a29843c9cf..166a8e3f28a 100644 --- a/library/core/src/fmt/mod.rs +++ b/library/core/src/fmt/mod.rs @@ -582,6 +582,7 @@ impl Display for Arguments<'_> { )] #[doc(alias = "{:?}")] #[rustc_diagnostic_item = "debug_trait"] +#[cfg_attr(not(bootstrap), rustc_trivial_field_reads)] pub trait Debug { /// Formats the value using the given formatter. /// diff --git a/library/core/tests/fmt/builders.rs b/library/core/tests/fmt/builders.rs index 7580010a28b..9567479c813 100644 --- a/library/core/tests/fmt/builders.rs +++ b/library/core/tests/fmt/builders.rs @@ -653,6 +653,7 @@ mod debug_list { fn test_formatting_parameters_are_forwarded() { use std::collections::{BTreeMap, BTreeSet}; #[derive(Debug)] + #[allow(dead_code)] struct Foo { bar: u32, baz: u32, diff --git a/library/std/src/io/buffered/tests.rs b/library/std/src/io/buffered/tests.rs index f6c2b499567..d290c3c4660 100644 --- a/library/std/src/io/buffered/tests.rs +++ b/library/std/src/io/buffered/tests.rs @@ -468,9 +468,6 @@ struct ProgrammableSink { // Writes append to this slice pub buffer: Vec<u8>, - // Flush sets this flag - pub flushed: bool, - // If true, writes will always be an error pub always_write_error: bool, @@ -520,7 +517,6 @@ impl Write for ProgrammableSink { if self.always_flush_error { Err(io::Error::new(io::ErrorKind::Other, "test - always_flush_error")) } else { - self.flushed = true; Ok(()) } } diff --git a/library/test/src/term/terminfo/mod.rs b/library/test/src/term/terminfo/mod.rs index f4c5a05d1e2..694473f52c1 100644 --- a/library/test/src/term/terminfo/mod.rs +++ b/library/test/src/term/terminfo/mod.rs @@ -16,6 +16,7 @@ use parser::compiled::{msys_terminfo, parse}; use searcher::get_dbpath_for_term; /// A parsed terminfo database entry. +#[allow(unused)] #[derive(Debug)] pub(crate) struct TermInfo { /// Names for the terminal |
