Skip to content

Commit 67b5129

Browse files
committed
Rollup merge of rust-lang#21925 - sfackler:allow-missing-copy, r=alexcrichton
This was particularly helpful in the time just after OIBIT's implementation to make sure things that were supposed to be Copy continued to be, but it's now creates a lot of noise for types that intentionally don't want to be Copy. r? @alexcrichton
2 parents cfae247 + 85a85c2 commit 67b5129

File tree

28 files changed

+2
-61
lines changed

28 files changed

+2
-61
lines changed

src/doc/reference.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1813,7 +1813,6 @@ default visibility with the `priv` keyword. When an item is declared as `pub`,
18131813
it can be thought of as being accessible to the outside world. For example:
18141814

18151815
```
1816-
# #![allow(missing_copy_implementations)]
18171816
# fn main() {}
18181817
// Declare a private struct
18191818
struct Foo;

src/libcollections/string.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ pub struct FromUtf8Error {
4949

5050
/// A possible error value from the `String::from_utf16` function.
5151
#[stable(feature = "rust1", since = "1.0.0")]
52-
#[allow(missing_copy_implementations)]
5352
#[derive(Debug)]
5453
pub struct FromUtf16Error(());
5554

src/libcore/hash/sip.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use super::{Hasher, Writer};
3030
/// strong, this implementation has not been reviewed for such purposes.
3131
/// As such, all cryptographic uses of this implementation are strongly
3232
/// discouraged.
33-
#[allow(missing_copy_implementations)]
3433
pub struct SipHasher {
3534
k0: u64,
3635
k1: u64,

src/libcore/marker.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ pub struct InvariantLifetime<'a>;
396396
reason = "likely to change with new variance strategy")]
397397
#[lang="no_copy_bound"]
398398
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
399-
#[allow(missing_copy_implementations)]
400399
pub struct NoCopy;
401400

402401
/// A type which is considered managed by the GC. This is typically
@@ -405,5 +404,4 @@ pub struct NoCopy;
405404
reason = "likely to change with new variance strategy")]
406405
#[lang="managed_bound"]
407406
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord)]
408-
#[allow(missing_copy_implementations)]
409407
pub struct Managed;

src/libcore/str/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ impl FromStr for bool {
149149

150150
/// An error returned when parsing a `bool` from a string fails.
151151
#[derive(Debug, Clone, PartialEq)]
152-
#[allow(missing_copy_implementations)]
153152
#[stable(feature = "rust1", since = "1.0.0")]
154153
pub struct ParseBoolError { _priv: () }
155154

src/liblibc/lib.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,12 @@ pub mod types {
332332
/// variants, because the compiler complains about the repr attribute
333333
/// otherwise.
334334
#[repr(u8)]
335-
#[allow(missing_copy_implementations)]
336335
pub enum c_void {
337336
__variant1,
338337
__variant2,
339338
}
340339

341-
#[allow(missing_copy_implementations)]
342340
pub enum FILE {}
343-
#[allow(missing_copy_implementations)]
344341
pub enum fpos_t {}
345342
}
346343
pub mod c99 {
@@ -354,9 +351,7 @@ pub mod types {
354351
pub type uint64_t = u64;
355352
}
356353
pub mod posix88 {
357-
#[allow(missing_copy_implementations)]
358354
pub enum DIR {}
359-
#[allow(missing_copy_implementations)]
360355
pub enum dirent_t {}
361356
}
362357
pub mod posix01 {}

src/librand/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ pub trait SeedableRng<Seed>: Rng {
387387
/// [1]: Marsaglia, George (July 2003). ["Xorshift
388388
/// RNGs"](http://www.jstatsoft.org/v08/i14/paper). *Journal of
389389
/// Statistical Software*. Vol. 8 (Issue 14).
390-
#[allow(missing_copy_implementations)]
391390
#[derive(Clone)]
392391
pub struct XorShiftRng {
393392
x: u32,

src/librustc/lint/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ declare_lint! {
20382038

20392039
declare_lint! {
20402040
pub MISSING_COPY_IMPLEMENTATIONS,
2041-
Warn,
2041+
Allow,
20422042
"detects potentially-forgotten implementations of `Copy`"
20432043
}
20442044

src/librustc/middle/infer/region_inference/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ pub struct RegionVarBindings<'a, 'tcx: 'a> {
224224
}
225225

226226
#[derive(Debug)]
227-
#[allow(missing_copy_implementations)]
228227
pub struct RegionSnapshot {
229228
length: uint,
230229
skolemization_count: u32,

src/librustc/middle/traits/coherence.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ pub fn impl_can_satisfy(infcx: &InferCtxt,
5959
|o| selcx.evaluate_obligation(o))
6060
}
6161

62-
#[allow(missing_copy_implementations)]
6362
pub enum OrphanCheckErr<'tcx> {
6463
NoLocalInputType,
6564
UncoveredTy(Ty<'tcx>),

src/librustc/session/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ pub enum UnstableFeatures {
132132
}
133133

134134
#[derive(Clone, PartialEq, Eq)]
135-
#[allow(missing_copy_implementations)]
136135
pub enum PrintRequest {
137136
FileNames,
138137
Sysroot,
@@ -290,7 +289,6 @@ macro_rules! options {
290289
$($opt:ident : $t:ty = ($init:expr, $parse:ident, $desc:expr)),* ,) =>
291290
(
292291
#[derive(Clone)]
293-
#[allow(missing_copy_implementations)]
294292
pub struct $struct_name { $(pub $opt: $t),* }
295293

296294
pub fn $defaultfn() -> $struct_name {

src/librustc/util/nodemap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub fn DefIdSet() -> DefIdSet { FnvHashSet() }
4646
///
4747
/// This uses FNV hashing, as described here:
4848
/// http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function
49-
#[allow(missing_copy_implementations)]
5049
pub struct FnvHasher(u64);
5150

5251
impl Default for FnvHasher {

src/librustc/util/snapshot_vec.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub struct SnapshotVec<D:SnapshotVecDelegate> {
4646
}
4747

4848
// Snapshots are tokens that should be created/consumed linearly.
49-
#[allow(missing_copy_implementations)]
5049
pub struct Snapshot {
5150
// Length of the undo log at the time the snapshot was taken.
5251
length: uint,

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,6 @@ pub fn opt_loan_path<'tcx>(cmt: &mc::cmt<'tcx>) -> Option<Rc<LoanPath<'tcx>>> {
464464

465465
// Errors that can occur
466466
#[derive(PartialEq)]
467-
#[allow(missing_copy_implementations)]
468467
pub enum bckerr_code {
469468
err_mutbl,
470469
err_out_of_scope(ty::Region, ty::Region), // superscope, subscope

src/librustc_llvm/lib.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -436,73 +436,50 @@ pub enum DiagnosticKind {
436436
}
437437

438438
// Opaque pointer types
439-
#[allow(missing_copy_implementations)]
440439
pub enum Module_opaque {}
441440
pub type ModuleRef = *mut Module_opaque;
442-
#[allow(missing_copy_implementations)]
443441
pub enum Context_opaque {}
444442
pub type ContextRef = *mut Context_opaque;
445-
#[allow(missing_copy_implementations)]
446443
pub enum Type_opaque {}
447444
pub type TypeRef = *mut Type_opaque;
448-
#[allow(missing_copy_implementations)]
449445
pub enum Value_opaque {}
450446
pub type ValueRef = *mut Value_opaque;
451-
#[allow(missing_copy_implementations)]
452447
pub enum Metadata_opaque {}
453448
pub type MetadataRef = *mut Metadata_opaque;
454-
#[allow(missing_copy_implementations)]
455449
pub enum BasicBlock_opaque {}
456450
pub type BasicBlockRef = *mut BasicBlock_opaque;
457-
#[allow(missing_copy_implementations)]
458451
pub enum Builder_opaque {}
459452
pub type BuilderRef = *mut Builder_opaque;
460-
#[allow(missing_copy_implementations)]
461453
pub enum ExecutionEngine_opaque {}
462454
pub type ExecutionEngineRef = *mut ExecutionEngine_opaque;
463-
#[allow(missing_copy_implementations)]
464455
pub enum RustJITMemoryManager_opaque {}
465456
pub type RustJITMemoryManagerRef = *mut RustJITMemoryManager_opaque;
466-
#[allow(missing_copy_implementations)]
467457
pub enum MemoryBuffer_opaque {}
468458
pub type MemoryBufferRef = *mut MemoryBuffer_opaque;
469-
#[allow(missing_copy_implementations)]
470459
pub enum PassManager_opaque {}
471460
pub type PassManagerRef = *mut PassManager_opaque;
472-
#[allow(missing_copy_implementations)]
473461
pub enum PassManagerBuilder_opaque {}
474462
pub type PassManagerBuilderRef = *mut PassManagerBuilder_opaque;
475-
#[allow(missing_copy_implementations)]
476463
pub enum Use_opaque {}
477464
pub type UseRef = *mut Use_opaque;
478-
#[allow(missing_copy_implementations)]
479465
pub enum TargetData_opaque {}
480466
pub type TargetDataRef = *mut TargetData_opaque;
481-
#[allow(missing_copy_implementations)]
482467
pub enum ObjectFile_opaque {}
483468
pub type ObjectFileRef = *mut ObjectFile_opaque;
484-
#[allow(missing_copy_implementations)]
485469
pub enum SectionIterator_opaque {}
486470
pub type SectionIteratorRef = *mut SectionIterator_opaque;
487-
#[allow(missing_copy_implementations)]
488471
pub enum Pass_opaque {}
489472
pub type PassRef = *mut Pass_opaque;
490-
#[allow(missing_copy_implementations)]
491473
pub enum TargetMachine_opaque {}
492474
pub type TargetMachineRef = *mut TargetMachine_opaque;
493-
#[allow(missing_copy_implementations)]
494475
pub enum Archive_opaque {}
495476
pub type ArchiveRef = *mut Archive_opaque;
496-
#[allow(missing_copy_implementations)]
497477
pub enum Twine_opaque {}
498478
pub type TwineRef = *mut Twine_opaque;
499-
#[allow(missing_copy_implementations)]
500479
pub enum DiagnosticInfo_opaque {}
501480
pub type DiagnosticInfoRef = *mut DiagnosticInfo_opaque;
502-
#[allow(missing_copy_implementations)]
503481
pub enum DebugLoc_opaque {}
504482
pub type DebugLocRef = *mut DebugLoc_opaque;
505-
#[allow(missing_copy_implementations)]
506483
pub enum SMDiagnostic_opaque {}
507484
pub type SMDiagnosticRef = *mut SMDiagnostic_opaque;
508485

@@ -513,7 +490,6 @@ pub mod debuginfo {
513490
pub use self::DIDescriptorFlags::*;
514491
use super::{MetadataRef};
515492

516-
#[allow(missing_copy_implementations)]
517493
pub enum DIBuilder_opaque {}
518494
pub type DIBuilderRef = *mut DIBuilder_opaque;
519495

@@ -2215,7 +2191,6 @@ pub fn get_param(llfn: ValueRef, index: c_uint) -> ValueRef {
22152191
}
22162192
}
22172193

2218-
#[allow(missing_copy_implementations)]
22192194
pub enum RustString_opaque {}
22202195
pub type RustStringRef = *mut RustString_opaque;
22212196
type RustStringRepr = *mut RefCell<Vec<u8>>;

src/librustc_trans/trans/value.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ impl Use {
150150
}
151151

152152
/// Iterator for the users of a value
153-
#[allow(missing_copy_implementations)]
154153
pub struct Users {
155154
next: Option<Use>
156155
}

src/librustc_typeck/rscope.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ impl RegionScope for UnelidableRscope {
7979
// A scope in which any omitted region defaults to `default`. This is
8080
// used after the `->` in function signatures, but also for backwards
8181
// compatibility with object types. The latter use may go away.
82-
#[allow(missing_copy_implementations)]
8382
pub struct SpecificRscope {
8483
default: ty::Region
8584
}

src/libstd/collections/hash/map.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,6 @@ impl<K, V, S, H> Extend<(K, V)> for HashMap<K, V, S>
15801580
/// `Hasher`, but the hashers created by two different `RandomState`
15811581
/// instances are unlikely to produce the same result for the same values.
15821582
#[derive(Clone)]
1583-
#[allow(missing_copy_implementations)]
15841583
#[unstable(feature = "std_misc",
15851584
reason = "hashing an hash maps may be altered")]
15861585
pub struct RandomState {
@@ -1623,7 +1622,6 @@ impl Default for RandomState {
16231622
/// This is the default hasher used in a `HashMap` to hash keys. Types do not
16241623
/// typically declare an ability to explicitly hash into this particular type,
16251624
/// but rather in a `H: hash::Writer` type parameter.
1626-
#[allow(missing_copy_implementations)]
16271625
#[unstable(feature = "std_misc",
16281626
reason = "hashing an hash maps may be altered")]
16291627
pub struct Hasher { inner: SipHasher }

src/libstd/dynamic_lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use mem;
2222
use env;
2323
use str;
2424

25-
#[allow(missing_copy_implementations)]
2625
pub struct DynamicLibrary {
2726
handle: *mut u8
2827
}

src/libstd/os.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,6 @@ pub fn page_size() -> uint {
759759
///
760760
/// The memory map is released (unmapped) when the destructor is run, so don't
761761
/// let it leave scope by accident if you want it to stick around.
762-
#[allow(missing_copy_implementations)]
763762
pub struct MemoryMap {
764763
data: *mut u8,
765764
len: uint,

src/libstd/rand/os.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ mod imp {
206206
/// - iOS: calls SecRandomCopyBytes as /dev/(u)random is sandboxed.
207207
///
208208
/// This does not block.
209-
#[allow(missing_copy_implementations)]
210209
pub struct OsRng {
211210
// dummy field to ensure that this struct cannot be constructed outside of this module
212211
_dummy: (),

src/libstd/rt/unwind.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,13 +390,10 @@ pub mod eabi {
390390
use libc::{c_void, c_int};
391391

392392
#[repr(C)]
393-
#[allow(missing_copy_implementations)]
394393
pub struct EXCEPTION_RECORD;
395394
#[repr(C)]
396-
#[allow(missing_copy_implementations)]
397395
pub struct CONTEXT;
398396
#[repr(C)]
399-
#[allow(missing_copy_implementations)]
400397
pub struct DISPATCHER_CONTEXT;
401398

402399
#[repr(C)]

src/libstd/rt/util.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ pub fn default_sched_threads() -> uint {
8888
pub const ENFORCE_SANITY: bool = true || !cfg!(rtopt) || cfg!(rtdebug) ||
8989
cfg!(rtassert);
9090

91-
#[allow(missing_copy_implementations)]
9291
pub struct Stdio(libc::c_int);
9392

9493
#[allow(non_upper_case_globals)]

src/libstd/sync/barrier.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ struct BarrierState {
4646
///
4747
/// Currently this opaque structure only has one method, `.is_leader()`. Only
4848
/// one thread will receive a result that will return `true` from this function.
49-
#[allow(missing_copy_implementations)]
5049
pub struct BarrierWaitResult(bool);
5150

5251
impl Barrier {

src/libstd/sync/poison.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ impl Flag {
4242
}
4343
}
4444

45-
#[allow(missing_copy_implementations)]
4645
pub struct Guard {
4746
panicking: bool,
4847
}

src/test/compile-fail/lint-dead-code-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#![allow(unused_variables)]
1313
#![allow(non_camel_case_types)]
1414
#![allow(non_upper_case_globals)]
15-
#![allow(missing_copy_implementations)]
1615
#![deny(dead_code)]
1716
#![feature(core)]
1817

src/test/compile-fail/lint-missing-doc.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// injected intrinsics by the compiler.
1313
#![deny(missing_docs)]
1414
#![allow(dead_code)]
15-
#![allow(missing_copy_implementations)]
1615

1716
//! Some garbage docs for the crate here
1817
#![doc="More garbage"]

src/test/compile-fail/missing_debug_impls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// compile-flags: --crate-type lib
1212
#![deny(missing_debug_implementations)]
13-
#![allow(unused, missing_copy_implementations)]
13+
#![allow(unused)]
1414

1515
use std::fmt;
1616

0 commit comments

Comments
 (0)