Skip to content

Commit 8a13ceb

Browse files
committed
Deprecate lints checking for Debug or Copy impls
These lints are now implemented in Clippy and those should be used instead.
1 parent 2efa31b commit 8a13ceb

File tree

2 files changed

+4
-47
lines changed

2 files changed

+4
-47
lines changed

src/doc/rustc/src/lints/listing/allowed-by-default.md

+2-45
Original file line numberDiff line numberDiff line change
@@ -126,54 +126,11 @@ Lifetime elision elides this lifetime, but that is being deprecated.
126126

127127
## missing-copy-implementations
128128

129-
This lint detects potentially-forgotten implementations of `Copy`. Some
130-
example code that triggers this lint:
131-
132-
```rust
133-
pub struct Foo {
134-
pub field: i32
135-
}
136-
```
137-
138-
When set to 'deny', this will produce:
139-
140-
```text
141-
error: type could implement `Copy`; consider adding `impl Copy`
142-
--> src/main.rs:3:1
143-
|
144-
3 | / pub struct Foo { //~ ERROR type could implement `Copy`; consider adding `impl Copy`
145-
4 | | pub field: i32
146-
5 | | }
147-
| |_^
148-
|
149-
```
150-
151-
You can fix the lint by deriving `Copy`.
152-
153-
This lint is set to 'allow' because this code isn't bad; it's common to write
154-
newtypes like this specifically so that a `Copy` type is no longer `Copy`.
129+
This lint is deprecated and no longer used.
155130

156131
## missing-debug-implementations
157132

158-
This lint detects missing implementations of `fmt::Debug`. Some example code
159-
that triggers this lint:
160-
161-
```rust
162-
pub struct Foo;
163-
```
164-
165-
When set to 'deny', this will produce:
166-
167-
```text
168-
error: type does not implement `fmt::Debug`; consider adding #[derive(Debug)] or a manual implementation
169-
--> src/main.rs:3:1
170-
|
171-
3 | pub struct Foo;
172-
| ^^^^^^^^^^^^^^^
173-
|
174-
```
175-
176-
You can fix the lint by deriving `Debug`.
133+
This lint is deprecated and no longer used.
177134

178135
## missing-docs
179136

src/librustc_lint/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingDoc {
532532
declare_lint! {
533533
pub MISSING_COPY_IMPLEMENTATIONS,
534534
Allow,
535-
"detects potentially-forgotten implementations of `Copy`"
535+
"detects potentially-forgotten implementations of `Copy` (deprecated, do not use)"
536536
}
537537

538538
#[derive(Copy, Clone)]
@@ -596,7 +596,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MissingCopyImplementations {
596596
declare_lint! {
597597
MISSING_DEBUG_IMPLEMENTATIONS,
598598
Allow,
599-
"detects missing implementations of fmt::Debug"
599+
"detects missing implementations of fmt::Debug (deprecated, do not use)"
600600
}
601601

602602
pub struct MissingDebugImplementations {

0 commit comments

Comments
 (0)