Skip to content

Commit 9b5acca

Browse files
committed
Fallout in tests
1 parent dd31bb2 commit 9b5acca

Some content is hidden

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

47 files changed

+117
-216
lines changed

src/test/auxiliary/coherence_orphan_lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,8 @@
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-
1915
#[lang="sized"]
20-
pub trait Sized : PhantomFn<Self> {}
16+
pub trait Sized { }
2117

2218
#[lang="panic"]
2319
fn panic(_: &(&'static str, &'static str, usize)) -> ! { loop {} }
@@ -29,7 +25,7 @@ extern fn stack_exhausted() {}
2925
extern fn eh_personality() {}
3026

3127
#[lang="copy"]
32-
pub trait Copy : PhantomFn<Self> {
28+
pub trait Copy {
3329
// Empty.
3430
}
3531

src/test/compile-fail/associated-types-ICE-when-projecting-out-of-err.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616
#![feature(no_std)]
1717
#![no_std]
1818

19-
#[lang="phantom_fn"]
20-
pub trait PhantomFn<A:?Sized,R:?Sized=()> { }
21-
impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
22-
2319
#[lang="sized"]
24-
pub trait Sized : PhantomFn<Self> {
20+
pub trait Sized {
2521
// Empty.
2622
}
2723

src/test/compile-fail/issue-13853-2.rs

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

11-
use std::marker::PhantomFn;
12-
13-
trait FromStructReader<'a> : PhantomFn<(Self,&'a ())> { }
11+
trait FromStructReader<'a> { }
1412
trait ResponseHook {
1513
fn get<'a, T: FromStructReader<'a>>(&'a self);
1614
}

src/test/compile-fail/issue-19660.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,8 @@
1313
#![feature(lang_items, start, no_std)]
1414
#![no_std]
1515

16-
#[lang="phantom_fn"]
17-
trait PhantomFn<A:?Sized,R:?Sized=()> { }
18-
impl<A:?Sized, R:?Sized, U:?Sized> PhantomFn<A,R> for U { }
19-
2016
#[lang = "sized"]
21-
trait Sized : PhantomFn<Self> {}
17+
trait Sized { }
2218

2319
#[start]
2420
fn main(_: isize, _: *const *const u8) -> isize {

src/test/compile-fail/kindck-impl-type-params.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn g<T>(val: T) {
4141
fn foo<'a>() {
4242
let t: S<&'a isize> = S(marker::PhantomData);
4343
let a = &t as &Gettable<&'a isize>;
44-
//~^ ERROR cannot infer
44+
//~^ ERROR does not fulfill
4545
}
4646

4747
fn foo2<'a>() {

src/test/compile-fail/lint-unsafe-code.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@
1212
#![allow(dead_code)]
1313
#![deny(unsafe_code)]
1414

15-
use std::marker::PhantomFn;
16-
1715
struct Bar;
1816
struct Bar2;
1917
struct Bar3;
2018

2119
#[allow(unsafe_code)]
2220
mod allowed_unsafe {
23-
use std::marker::PhantomFn;
2421
fn allowed() { unsafe {} }
2522
unsafe fn also_allowed() {}
26-
unsafe trait AllowedUnsafe : PhantomFn<Self> {}
23+
unsafe trait AllowedUnsafe { }
2724
unsafe impl AllowedUnsafe for super::Bar {}
2825
}
2926

@@ -34,7 +31,7 @@ macro_rules! unsafe_in_macro {
3431
}
3532

3633
unsafe fn baz() {} //~ ERROR: declaration of an `unsafe` function
37-
unsafe trait Foo : PhantomFn<Self> {} //~ ERROR: declaration of an `unsafe` trait
34+
unsafe trait Foo {} //~ ERROR: declaration of an `unsafe` trait
3835
unsafe impl Foo for Bar {} //~ ERROR: implementation of an `unsafe` trait
3936

4037
trait Baz {

src/test/compile-fail/object-safety-phantom-fn.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@
1313
#![feature(rustc_attrs)]
1414
#![allow(dead_code)]
1515

16-
use std::marker::PhantomFn;
17-
18-
trait Baz : PhantomFn<Self> {
16+
trait Baz {
1917
}
2018

21-
trait Bar<T> : PhantomFn<(Self, T)> {
19+
trait Bar<T> {
2220
}
2321

2422
fn make_bar<T:Bar<u32>>(t: &T) -> &Bar<u32> {

src/test/compile-fail/on-unimplemented-bad-anno.rs

-6
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,8 @@
1313

1414
#![allow(unused)]
1515

16-
use std::marker;
17-
1816
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
1917
trait Foo<Bar, Baz, Quux>
20-
: marker::PhantomFn<(Self,Bar,Baz,Quux)>
2118
{}
2219

2320
#[rustc_on_unimplemented="a collection of type `{Self}` cannot be built from an iterator over elements of type `{A}`"]
@@ -28,19 +25,16 @@ trait MyFromIterator<A> {
2825

2926
#[rustc_on_unimplemented] //~ ERROR this attribute must have a value
3027
trait BadAnnotation1
31-
: marker::MarkerTrait
3228
{}
3329

3430
#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{C}>`"]
3531
//~^ ERROR there is no type parameter C on trait BadAnnotation2
3632
trait BadAnnotation2<A,B>
37-
: marker::PhantomFn<(Self,A,B)>
3833
{}
3934

4035
#[rustc_on_unimplemented = "Unimplemented trait error on `{Self}` with params `<{A},{B},{}>`"]
4136
//~^ only named substitution parameters are allowed
4237
trait BadAnnotation3<A,B>
43-
: marker::PhantomFn<(Self,A,B)>
4438
{}
4539

4640
pub fn main() {

src/test/compile-fail/on-unimplemented.rs

-3
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111

1212
#![feature(on_unimplemented)]
1313

14-
use std::marker;
15-
1614
#[rustc_on_unimplemented = "test error `{Self}` with `{Bar}` `{Baz}` `{Quux}`"]
1715
trait Foo<Bar, Baz, Quux>
18-
: marker::PhantomFn<(Self,Bar,Baz,Quux)>
1916
{}
2017

2118
fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {

src/test/compile-fail/privacy1.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@
1111
#![feature(lang_items, start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

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

2117
#[lang="copy"]
22-
pub trait Copy : PhantomFn<Self> {}
18+
pub trait Copy {}
2319

2420
mod bar {
2521
// shouldn't bring in too much

src/test/compile-fail/privacy4.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@
1111
#![feature(lang_items, start, no_std)]
1212
#![no_std] // makes debugging this test *a lot* easier (during resolve)
1313

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

2117
// Test to make sure that private items imported through globs remain private
2218
// when they're used.

src/test/compile-fail/regions-assoc-type-in-supertrait-outlives-container.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616
#![allow(dead_code)]
1717

18-
use std::marker::PhantomFn;
19-
2018
///////////////////////////////////////////////////////////////////////////
2119

22-
pub trait TheTrait: PhantomFn<Self, Self> {
20+
pub trait TheTrait {
2321
type TheAssocType;
2422
}
2523

src/test/compile-fail/regions-assoc-type-outlives-container-hrtb.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@
1414
#![allow(dead_code)]
1515
#![feature(rustc_attrs)]
1616

17-
use std::marker::PhantomFn;
18-
1917
///////////////////////////////////////////////////////////////////////////
2018

21-
pub trait TheTrait<'b> : PhantomFn<&'b Self,Self> {
19+
pub trait TheTrait<'b> {
2220
type TheAssocType;
2321
}
2422

src/test/compile-fail/regions-assoc-type-outlives-container-wc.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515

1616
#![allow(dead_code)]
1717

18-
use std::marker::PhantomFn;
19-
2018
///////////////////////////////////////////////////////////////////////////
2119

22-
pub trait TheTrait: PhantomFn<Self, Self> {
20+
pub trait TheTrait {
2321
type TheAssocType;
2422
}
2523

src/test/compile-fail/regions-assoc-type-outlives-container.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
#![allow(dead_code)]
1616
#![feature(rustc_attrs)]
1717

18-
use std::marker::PhantomFn;
19-
2018
///////////////////////////////////////////////////////////////////////////
2119

22-
pub trait TheTrait: PhantomFn<Self, Self> {
20+
pub trait TheTrait {
2321
type TheAssocType;
2422
}
2523

src/test/compile-fail/regions-close-object-into-object-1.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
#![feature(box_syntax)]
1212
#![allow(warnings)]
1313

14-
use std::marker::PhantomFn;
15-
16-
trait A<T> : PhantomFn<(Self,T)> { }
14+
trait A<T> { }
1715
struct B<'a, T>(&'a (A<T>+'a));
1816

19-
trait X : ::std::marker::MarkerTrait {}
17+
trait X { }
2018

2119
impl<'a, T> X for B<'a, T> {}
2220

src/test/compile-fail/regions-close-object-into-object-2.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010

1111
#![feature(box_syntax)]
1212

13-
use std::marker::PhantomFn;
14-
15-
trait A<T> : PhantomFn<(Self,T)> { }
13+
trait A<T> { }
1614
struct B<'a, T>(&'a (A<T>+'a));
1715

18-
trait X : PhantomFn<Self> {}
16+
trait X { }
1917
impl<'a, T> X for B<'a, T> {}
2018

2119
fn g<'a, T: 'static>(v: Box<A<T>+'a>) -> Box<X+'static> {

src/test/compile-fail/regions-close-object-into-object-3.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
#![feature(box_syntax)]
1212
#![allow(warnings)]
1313

14-
use std::marker::PhantomFn;
15-
16-
trait A<T> : PhantomFn<(Self,T)> {}
14+
trait A<T> { }
1715
struct B<'a, T>(&'a (A<T>+'a));
1816

19-
trait X : PhantomFn<Self> {}
17+
trait X { }
2018
impl<'a, T> X for B<'a, T> {}
2119

22-
fn h<'a, T, U>(v: Box<A<U>+'static>) -> Box<X+'static> {
20+
fn h<'a, T, U:'static>(v: Box<A<U>+'static>) -> Box<X+'static> {
2321
box B(&*v) as Box<X> //~ ERROR `*v` does not live long enough
2422
}
2523

src/test/compile-fail/regions-close-object-into-object-4.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010

1111
#![feature(box_syntax)]
1212

13-
use std::marker::PhantomFn;
14-
15-
trait A<T> : PhantomFn<(Self,T)> {}
13+
trait A<T> { }
1614
struct B<'a, T>(&'a (A<T>+'a));
1715

18-
trait X : PhantomFn<Self> {}
16+
trait X { }
1917
impl<'a, T> X for B<'a, T> {}
2018

2119
fn i<'a, T, U>(v: Box<A<U>+'a>) -> Box<X+'static> {

src/test/compile-fail/required-lang-item.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
#![feature(lang_items, no_std)]
1212
#![no_std]
1313

14-
#[lang="phantom_fn"]
15-
pub trait PhantomFn<T:?Sized> { }
16-
impl<T:?Sized, U:?Sized> PhantomFn<T> for U { }
17-
18-
#[lang="sized"] pub trait Sized : PhantomFn<Self> {}
14+
#[lang="sized"] pub trait Sized { }
1915

2016
// error-pattern:requires `start` lang_item
2117

src/test/compile-fail/trait-bounds-impl-comparison-1.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
use std::marker;
1515

16-
trait A : marker::PhantomFn<Self> {
17-
}
16+
trait A { }
1817

1918
trait B: A {}
2019

src/test/compile-fail/trait-bounds-impl-comparison-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ trait Iterator<A> {
1515
}
1616

1717
trait IteratorUtil<A>
18-
: ::std::marker::PhantomFn<(),A>
1918
{
2019
fn zip<B, U: Iterator<U>>(self, other: U) -> ZipIterator<Self, U>;
2120
}

src/test/compile-fail/unboxed-closure-sugar-equiv.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616
#![feature(unboxed_closures)]
1717
#![allow(dead_code)]
1818

19-
use std::marker::PhantomFn;
20-
2119
trait Foo<T> {
2220
type Output;
2321
fn dummy(&self, t: T, u: Self::Output);
2422
}
2523

26-
trait Eq<X: ?Sized> : PhantomFn<(Self,X)> { }
24+
trait Eq<X: ?Sized> { }
2725
impl<X: ?Sized> Eq<X> for X { }
2826
fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
2927

src/test/compile-fail/unboxed-closure-sugar-lifetime-elision.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ trait Foo<T> {
2323
fn dummy(&self, t: T);
2424
}
2525

26-
trait Eq<X: ?Sized> : marker::PhantomFn<(Self, X)> { }
26+
trait Eq<X: ?Sized> { }
2727
impl<X: ?Sized> Eq<X> for X { }
2828
fn eq<A: ?Sized,B: ?Sized +Eq<A>>() { }
2929

src/test/compile-fail/variance-contravariant-arg-object.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
#![allow(dead_code)]
1212

13+
// This test was previously testing variance on traits.
14+
// But now that it is removed, both cases error.
15+
1316
trait Get<T> : 'static {
1417
fn get(&self, t: T);
1518
}
@@ -25,7 +28,8 @@ fn get_max_from_min<'min, 'max, G>(v: Box<Get<&'min i32>>)
2528
-> Box<Get<&'max i32>>
2629
where 'max : 'min
2730
{
28-
v
31+
// Previously OK:
32+
v //~ ERROR mismatched types
2933
}
3034

3135
fn main() { }

0 commit comments

Comments
 (0)