Skip to content

Commit 872ce47

Browse files
committed
Fallout: tests. As tests frequently elide things, lots of changes
here. Some of this may have been poorly rebased, though I tried to be careful and preserve the spirit of the test.
1 parent ef42c2b commit 872ce47

File tree

306 files changed

+915
-580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

306 files changed

+915
-580
lines changed

src/libcoretest/mem.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn test_transmute_copy() {
9292

9393
#[test]
9494
fn test_transmute() {
95-
trait Foo {}
95+
trait Foo { fn dummy(&self) { } }
9696
impl Foo for int {}
9797

9898
let a = box 100 as Box<Foo>;

src/test/auxiliary/coherence-orphan-lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub trait TheTrait<T> {
11+
pub trait TheTrait<T> : ::std::marker::PhantomFn<T> {
1212
fn the_fn(&self);
1313
}
1414

src/test/auxiliary/default_type_params_xc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ pub struct Heap;
1212

1313
pub struct FakeHeap;
1414

15-
pub struct FakeVec<T, A = FakeHeap>;
15+
pub struct FakeVec<T, A = FakeHeap> { pub f: Option<(T,A)> }
16+

src/test/auxiliary/inner_static.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub struct A<T>;
12-
pub struct B<T>;
11+
pub struct A<T> { pub v: T }
12+
pub struct B<T> { pub v: T }
1313

1414
pub mod test {
15-
pub struct A<T>;
15+
pub struct A<T> { pub v: T }
1616

1717
impl<T> A<T> {
1818
pub fn foo(&self) -> int {
@@ -52,9 +52,9 @@ impl<T> B<T> {
5252
}
5353

5454
pub fn foo() -> int {
55-
let a = A::<()>;
56-
let b = B::<()>;
57-
let c = test::A::<()>;
55+
let a = A { v: () };
56+
let b = B { v: () };
57+
let c = test::A { v: () };
5858
return a.foo() + a.bar() +
5959
b.foo() + b.bar() +
6060
c.foo() + c.bar();

src/test/auxiliary/issue-14421.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#![crate_type="lib"]
1212
#![deny(warnings)]
13+
#![allow(dead_code)]
1314

1415
pub use src::aliases::B;
1516
pub use src::hidden_core::make;
@@ -23,9 +24,9 @@ mod src {
2324
pub mod hidden_core {
2425
use super::aliases::B;
2526

26-
pub struct A<T>;
27+
pub struct A<T> { t: T }
2728

28-
pub fn make() -> B { A }
29+
pub fn make() -> B { A { t: 1.0 } }
2930

3031
impl<T> A<T> {
3132
pub fn foo(&mut self) { println!("called foo"); }

src/test/auxiliary/issue-16643.rs

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

1111
#![crate_type = "lib"]
1212

13-
pub struct TreeBuilder<H>;
13+
pub struct TreeBuilder<H> { pub h: H }
1414

1515
impl<H> TreeBuilder<H> {
1616
pub fn process_token(&mut self) {

src/test/auxiliary/issue-17662.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![crate_type = "lib"]
1212

1313
pub trait Foo<'a, T> {
14-
fn foo(&self) -> T;
14+
fn foo(&'a self) -> T;
1515
}
1616

1717
pub fn foo<'a, T>(x: &'a Foo<'a, T>) -> T {

src/test/auxiliary/issue-2380.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@
1414
#![allow(unknown_features)]
1515
#![feature(box_syntax)]
1616

17-
pub trait i<T> { }
17+
pub trait i<T>
18+
{
19+
fn dummy(&self, t: T) -> T { panic!() }
20+
}
1821

1922
pub fn f<T>() -> Box<i<T>+'static> {
2023
impl<T> i<T> for () { }

src/test/auxiliary/issue-2526.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313

1414
#![feature(unsafe_destructor)]
1515

16+
use std::marker;
17+
1618
struct arc_destruct<T> {
17-
_data: int,
19+
_data: int,
20+
_marker: marker::PhantomData<T>
1821
}
1922

2023
#[unsafe_destructor]
@@ -24,7 +27,8 @@ impl<T: Sync> Drop for arc_destruct<T> {
2427

2528
fn arc_destruct<T: Sync>(data: int) -> arc_destruct<T> {
2629
arc_destruct {
27-
_data: data
30+
_data: data,
31+
_marker: marker::PhantomData
2832
}
2933
}
3034

src/test/auxiliary/issue_20389.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010

1111
pub trait T {
1212
type C;
13+
fn dummy(&self) { }
1314
}

src/test/auxiliary/issue_3907.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub trait Foo {
11+
use std::marker::MarkerTrait;
12+
13+
pub trait Foo : MarkerTrait {
1214
fn bar();
1315
}
1416

src/test/auxiliary/issue_8401.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
use std::mem;
1414

15-
trait A {}
15+
trait A {
16+
fn dummy(&self) { }
17+
}
1618
struct B;
1719
impl A for B {}
1820

src/test/auxiliary/issue_9123.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ pub trait X {
1515
fn f() { }
1616
f();
1717
}
18+
fn dummy(&self) { }
1819
}
1920

src/test/auxiliary/lang-item-public.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212
#![no_std]
1313
#![feature(lang_items)]
1414

15+
#[lang="phantom_fn"]
16+
pub trait PhantomFn<A:?Sized,R:?Sized=()> { }
17+
impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
18+
1519
#[lang="sized"]
16-
pub trait Sized {}
20+
pub trait Sized : PhantomFn<Self> {}
1721

1822
#[lang="panic"]
1923
fn panic(_: &(&'static str, &'static str, uint)) -> ! { loop {} }
@@ -25,6 +29,8 @@ extern fn stack_exhausted() {}
2529
extern fn eh_personality() {}
2630

2731
#[lang="copy"]
28-
pub trait Copy {}
32+
pub trait Copy : PhantomFn<Self> {
33+
// Empty.
34+
}
2935

3036

src/test/auxiliary/lint_stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub trait Trait {
9696
impl Trait for MethodTester {}
9797

9898
#[unstable(feature = "test_feature")]
99-
pub trait UnstableTrait {}
99+
pub trait UnstableTrait { fn dummy(&self) { } }
100100

101101
#[stable(feature = "test_feature", since = "1.0.0")]
102102
#[deprecated(since = "1.0.0")]

src/test/auxiliary/nested_item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl Foo {
2525
}
2626

2727
// issue 8134
28-
pub struct Parser<T>;
28+
pub struct Parser<T>(T);
2929
impl<T: std::iter::Iterator<Item=char>> Parser<T> {
3030
fn in_doctype(&mut self) {
3131
static DOCTYPEPattern: [char; 6] = ['O', 'C', 'T', 'Y', 'P', 'E'];

src/test/auxiliary/orphan_check_diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
pub trait RemoteTrait {}
11+
pub trait RemoteTrait { fn dummy(&self) { } }

src/test/auxiliary/overloaded_autoderef_xc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
use std::ops::Deref;
1212

1313
struct DerefWithHelper<H, T> {
14-
pub helper: H
14+
pub helper: H,
15+
pub value: Option<T>
1516
}
1617

1718
trait Helper<T> {
@@ -34,6 +35,6 @@ impl<T, H: Helper<T>> Deref for DerefWithHelper<H, T> {
3435

3536
// Test cross-crate autoderef + vtable.
3637
pub fn check<T: PartialEq>(x: T, y: T) -> bool {
37-
let d: DerefWithHelper<Option<T>, T> = DerefWithHelper { helper: Some(x) };
38+
let d: DerefWithHelper<Option<T>, T> = DerefWithHelper { helper: Some(x), value: None };
3839
d.eq(&y)
3940
}

src/test/auxiliary/private_trait_xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
trait Foo {}
11+
trait Foo : ::std::marker::MarkerTrait {}

src/test/auxiliary/svh-a-base.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-lit.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-significant-cfg.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-trait-bound.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-type-arg.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-type-ret.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-change-type-static.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-comment.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

src/test/auxiliary/svh-a-doc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@
1515
1616
#![crate_name = "a"]
1717

18+
use std::marker::MarkerTrait;
19+
1820
macro_rules! three {
1921
() => { 3 }
2022
}
2123

22-
pub trait U {}
23-
pub trait V {}
24+
pub trait U : MarkerTrait {}
25+
pub trait V : MarkerTrait {}
2426
impl U for () {}
2527
impl V for () {}
2628

0 commit comments

Comments
 (0)