Skip to content

Commit e3c33d5

Browse files
author
Jorge Aparicio
committed
fix fallout
1 parent f2b4937 commit e3c33d5

File tree

14 files changed

+44
-6
lines changed

14 files changed

+44
-6
lines changed

src/doc/reference.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1705,6 +1705,7 @@ specific type.
17051705
Implementations are defined with the keyword `impl`.
17061706

17071707
```
1708+
# use std::marker::Pod;
17081709
# #[derive(Copy)]
17091710
# struct Point {x: f64, y: f64};
17101711
# type Surface = i32;
@@ -1716,6 +1717,7 @@ struct Circle {
17161717
center: Point,
17171718
}
17181719
1720+
impl Pod for Circle {}
17191721
impl Copy for Circle {}
17201722
17211723
impl Shape for Circle {

src/libcollections/enum_set.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ pub struct EnumSet<E> {
3131
marker: marker::PhantomData<E>,
3232
}
3333

34+
#[cfg(not(stage0))]
35+
impl<E> marker::Pod for EnumSet<E> {}
3436
impl<E> Copy for EnumSet<E> {}
3537

3638
#[stable(feature = "rust1", since = "1.0.0")]

src/libcollections/linked_list.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ use core::hash::{Hasher, Hash};
3131
use core::iter::{self, FromIterator, IntoIterator};
3232
use core::mem;
3333
use core::ptr;
34+
#[cfg(not(stage0))]
35+
use core::marker::Pod;
3436

3537
#[deprecated(since = "1.0.0", reason = "renamed to LinkedList")]
3638
#[unstable(feature = "collections")]
@@ -50,6 +52,8 @@ struct Rawlink<T> {
5052
p: *mut T,
5153
}
5254

55+
#[cfg(not(stage0))]
56+
impl<T> Pod for Rawlink<T> {}
5357
impl<T> Copy for Rawlink<T> {}
5458
unsafe impl<T:Send> Send for Rawlink<T> {}
5559
unsafe impl<T:Sync> Sync for Rawlink<T> {}

src/libcore/marker.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ macro_rules! impls{
273273
}
274274
}
275275

276+
#[cfg(not(stage0))]
277+
impl<T:?Sized> Pod for $t<T> { }
276278
impl<T:?Sized> Copy for $t<T> { }
277279

278280
impl<T:?Sized> Clone for $t<T> {

src/libcore/raw.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
//! Their definition should always match the ABI defined in `rustc::back::abi`.
2020
2121
use marker::Copy;
22+
#[cfg(not(stage0))]
23+
use marker::Pod;
2224
use mem;
2325

2426
/// The representation of a slice like `&[T]`.
@@ -62,6 +64,8 @@ pub struct Slice<T> {
6264
}
6365

6466
impl<T> Copy for Slice<T> {}
67+
#[cfg(not(stage0))]
68+
impl<T> Pod for Slice<T> {}
6569

6670
/// The representation of an old closure.
6771
#[repr(C)]

src/librustc/middle/mem_categorization.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ use syntax::print::pprust;
8686
use syntax::parse::token;
8787

8888
use std::cell::RefCell;
89+
#[cfg(not(stage0))]
90+
use std::marker::Pod;
8991
use std::rc::Rc;
9092

9193
#[derive(Clone, PartialEq, Debug)]
@@ -260,6 +262,8 @@ pub struct MemCategorizationContext<'t,TYPER:'t> {
260262
typer: &'t TYPER
261263
}
262264

265+
#[cfg(not(stage0))]
266+
impl<'t,TYPER:'t> Pod for MemCategorizationContext<'t,TYPER> {}
263267
impl<'t,TYPER:'t> Copy for MemCategorizationContext<'t,TYPER> {}
264268

265269
pub type McResult<T> = Result<T, ()>;

src/librustc_llvm/diagnostic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ impl OptimizationDiagnostic {
6969
}
7070
}
7171

72+
#[derive(Copy)]
7273
pub struct InlineAsmDiagnostic {
7374
pub cookie: c_uint,
7475
pub message: TwineRef,
7576
pub instruction: ValueRef,
7677
}
7778

78-
impl Copy for InlineAsmDiagnostic {}
79-
8079
impl InlineAsmDiagnostic {
8180
unsafe fn unpack(di: DiagnosticInfoRef)
8281
-> InlineAsmDiagnostic {

src/libstd/collections/hash/table.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ use cmp;
1717
use hash::{Hash, Hasher};
1818
use iter::{Iterator, IteratorExt, ExactSizeIterator, count};
1919
use marker::{Copy, Send, Sync, Sized, self};
20+
#[cfg(not(stage0))]
21+
use marker::Pod;
2022
use mem::{min_align_of, size_of};
2123
use mem;
2224
use num::{Int, UnsignedInt};
@@ -87,6 +89,8 @@ struct RawBucket<K, V> {
8789
_marker: marker::PhantomData<(K,V)>,
8890
}
8991

92+
#[cfg(not(stage0))]
93+
impl<K,V> Pod for RawBucket<K,V> {}
9094
impl<K,V> Copy for RawBucket<K,V> {}
9195

9296
pub struct Bucket<K, V, M> {
@@ -95,6 +99,9 @@ pub struct Bucket<K, V, M> {
9599
table: M
96100
}
97101

102+
// XXX(japaric) needs auditing
103+
#[cfg(not(stage0))]
104+
impl<K,V,M:Copy> Pod for Bucket<K,V,M> {}
98105
impl<K,V,M:Copy> Copy for Bucket<K,V,M> {}
99106

100107
pub struct EmptyBucket<K, V, M> {

src/test/compile-fail/exclusive-drop-and-copy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212

1313
// issue #20126
1414

15-
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
15+
#[derive(Copy)] //~ ERROR the trait `Pod` may not be implemented
1616
struct Foo;
1717

1818
impl Drop for Foo {
1919
fn drop(&mut self) {}
2020
}
2121

22-
#[derive(Copy)] //~ ERROR the trait `Copy` may not be implemented
22+
#[derive(Copy)] //~ ERROR the trait `Pod` may not be implemented
2323
struct Bar<T>(::std::marker::PhantomData<T>);
2424

2525
#[unsafe_destructor]

src/test/compile-fail/opt-in-copy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ struct IWantToCopyThis {
1515
}
1616

1717
impl Copy for IWantToCopyThis {}
18-
//~^ ERROR the trait `Copy` may not be implemented for this type
18+
//~^ ERROR the trait `core::marker::Pod` is not implemented
1919

2020
enum CantCopyThisEither {
2121
A,
@@ -27,7 +27,7 @@ enum IWantToCopyThisToo {
2727
}
2828

2929
impl Copy for IWantToCopyThisToo {}
30-
//~^ ERROR the trait `Copy` may not be implemented for this type
30+
//~^ ERROR the trait `core::marker::Pod` is not implemented
3131

3232
fn main() {}
3333

src/test/run-make/simd-ffi/simd.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,16 @@ pub trait Sized : PhantomFn<Self> {}
7575
#[lang = "copy"]
7676
pub trait Copy : PhantomFn<Self> {}
7777

78+
#[lang = "pod"]
79+
pub trait Pod : PhantomFn<Self> {}
80+
7881
#[lang="phantom_fn"]
7982
pub trait PhantomFn<A:?Sized,R:?Sized=()> { }
8083
impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
8184

8285
mod core {
8386
pub mod marker {
8487
pub use Copy;
88+
pub use Pod;
8589
}
8690
}

src/test/run-pass/copy-out-of-array-1.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,11 @@
1212
//
1313
// (Compare with compile-fail/move-out-of-array-1.rs)
1414

15+
use std::marker::Pod;
16+
1517
struct C { _x: u8 }
1618

19+
impl Pod for C { }
1720
impl Copy for C { }
1821

1922
fn main() {

src/test/run-pass/issue-22536-copy-mustnt-zero.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// Regression test for Issue #22536: If a type implements Copy, then
1212
// moving it must not zero the original memory.
1313

14+
use std::marker::Pod;
15+
1416
trait Resources {
1517
type Buffer: Copy;
1618
fn foo(&self) {}
@@ -19,12 +21,14 @@ trait Resources {
1921
struct BufferHandle<R: Resources> {
2022
raw: <R as Resources>::Buffer,
2123
}
24+
impl<R: Resources> Pod for BufferHandle<R> {}
2225
impl<R: Resources> Copy for BufferHandle<R> {}
2326

2427
enum Res {}
2528
impl Resources for Res {
2629
type Buffer = u32;
2730
}
31+
impl Pod for Res { }
2832
impl Copy for Res { }
2933

3034
fn main() {

src/test/run-pass/regions-early-bound-used-in-bound.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
// Tests that you can use a fn lifetime parameter as part of
1212
// the value for a type parameter in a bound.
1313

14+
use std::marker::Pod;
15+
1416
trait GetRef<'a, T> {
1517
fn get(&self) -> &'a T;
1618
}
@@ -19,6 +21,7 @@ struct Box<'a, T:'a> {
1921
t: &'a T
2022
}
2123

24+
impl<'a,T:'a> Pod for Box<'a,T> {}
2225
impl<'a,T:'a> Copy for Box<'a,T> {}
2326

2427
impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {

0 commit comments

Comments
 (0)