Skip to content

Commit

Permalink
Remove meaningless comments in src/test
Browse files Browse the repository at this point in the history
  • Loading branch information
sd234678 committed Aug 14, 2019
1 parent 9e9a136 commit 2386cce
Show file tree
Hide file tree
Showing 17 changed files with 0 additions and 81 deletions.
2 changes: 0 additions & 2 deletions src/test/pretty/stmt_expr_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,6 @@ fn _12() {
}
}

/////////////////

fn foo() { }
fn foo3(_: i32, _: (), _: ()) { }
fn qux(_: i32) { }
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,22 @@ pub trait Car : Vehicle {
fn chip_paint(&self, c: Self::Color) { }
}

///////////////////////////////////////////////////////////////////////////

struct Black;
struct ModelT;
impl Vehicle for ModelT { type Color = Black; }
impl Car for ModelT { }

///////////////////////////////////////////////////////////////////////////

struct Blue;
struct ModelU;
impl Vehicle for ModelU { type Color = Blue; }
impl Car for ModelU { }

///////////////////////////////////////////////////////////////////////////

fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
fn a() { dent(ModelT, Black); }
fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
fn d() { dent(ModelU, Blue); }

///////////////////////////////////////////////////////////////////////////

fn e() { ModelT.chip_paint(Black); }
fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,16 @@ pub trait Car : Vehicle {
fn honk(&self) { }
}

///////////////////////////////////////////////////////////////////////////

struct Black;
struct ModelT;
impl Vehicle for ModelT { type Color = Black; }
impl Car for ModelT { }

///////////////////////////////////////////////////////////////////////////

struct Blue;
struct ModelU;
impl Vehicle for ModelU { type Color = Blue; }
impl Car for ModelU { }

///////////////////////////////////////////////////////////////////////////

fn black_car<C:Car<Color=Black>>(c: C) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ trait Test {
fn test(&self, value: &Self::V) -> bool;
}

///////////////////////////////////////////////////////////////////////////

struct TesterPair<T:Test> {
tester: T,
value: T::V,
Expand All @@ -26,8 +24,6 @@ impl<T:Test> TesterPair<T> {
}
}

///////////////////////////////////////////////////////////////////////////

struct EqU32(u32);
impl Test for EqU32 {
type V = u32;
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/higher-rank-trait-bounds/hrtb-type-outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ fn want_foo<T>()
{
}

///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause

struct SomeStruct<X> {
Expand All @@ -30,7 +29,6 @@ fn one() {
want_foo::<SomeStruct<usize>>();
}

///////////////////////////////////////////////////////////////////////////
// Expressed as shorthand

struct AnotherStruct<X> {
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/hrtb/hrtb-conflate-regions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fn want_foo1<T>()
{
}

///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause

struct SomeStruct;
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/impl-trait/bound-normalization-fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

// See issue 60414

/////////////////////////////////////////////
// Reduction to `impl Trait`

struct Foo<T>(T);
Expand All @@ -33,7 +32,6 @@ mod impl_trait {
}
}

/////////////////////////////////////////////
// Same with lifetimes in the trait

mod lifetimes {
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/impl-trait/bound-normalization-pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

// See issue 60414

/////////////////////////////////////////////
// Reduction to `impl Trait`

struct Foo<T>(T);
Expand All @@ -32,7 +31,6 @@ mod impl_trait {
}
}

/////////////////////////////////////////////
// Same with lifetimes in the trait

mod lifetimes {
Expand All @@ -59,7 +57,6 @@ mod lifetimes {
}
}

/////////////////////////////////////////////
// Reduction using `impl Trait` in bindings

mod impl_trait_in_bindings {
Expand All @@ -80,7 +77,6 @@ mod impl_trait_in_bindings {
}
}

/////////////////////////////////////////////
// The same applied to `type Foo = impl Bar`s

mod opaque_types {
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/issues/issue-12028.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ trait StreamHasher {
fn stream(&self) -> Self::S;
}

//////////////////////////////////////////////////////////////////////////////

trait StreamHash<H: StreamHasher>: Hash<H> {
fn input_stream(&self, stream: &mut H::S);
}
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/issues/issue-16739.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ impl FnOnce<()> for Foo {
extern "rust-call" fn call_once(mut self, _: ()) -> u32 { self.call_mut(()) }
}

/////////////////////////////////////////////////////////////////////////

impl FnMut<(u32,)> for Foo {
extern "rust-call" fn call_mut(&mut self, (x,): (u32,)) -> u32 { self.foo + x }
}
Expand All @@ -27,8 +25,6 @@ impl FnOnce<(u32,)> for Foo {
extern "rust-call" fn call_once(mut self, args: (u32,)) -> u32 { self.call_mut(args) }
}

/////////////////////////////////////////////////////////////////////////

impl FnMut<(u32,u32)> for Foo {
extern "rust-call" fn call_mut(&mut self, (x, y): (u32, u32)) -> u32 { self.foo + x + y }
}
Expand Down
9 changes: 0 additions & 9 deletions src/test/ui/methods/method-projection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// Test that we can use method notation to call methods based on a
// projection bound from a trait. Issue #20469.

///////////////////////////////////////////////////////////////////////////


trait MakeString {
fn make_string(&self) -> String;
}
Expand All @@ -21,8 +18,6 @@ impl MakeString for usize {
}
}

///////////////////////////////////////////////////////////////////////////

trait Foo {
type F: MakeString;

Expand All @@ -33,8 +28,6 @@ fn foo<F:Foo>(f: &F) -> String {
f.get().make_string()
}

///////////////////////////////////////////////////////////////////////////

struct SomeStruct {
field: isize,
}
Expand All @@ -47,8 +40,6 @@ impl Foo for SomeStruct {
}
}

///////////////////////////////////////////////////////////////////////////

struct SomeOtherStruct {
field: usize,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#![allow(dead_code)]


///////////////////////////////////////////////////////////////////////////

pub trait TheTrait<'b> {
type TheAssocType;
}
Expand All @@ -21,8 +18,6 @@ impl<'a,'b> TheTrait<'a> for TheType<'b> {
type TheAssocType = &'b ();
}

///////////////////////////////////////////////////////////////////////////

pub struct WithHrAssoc<T>
where for<'a> T : TheTrait<'a>
{
Expand All @@ -37,8 +32,6 @@ fn with_assoc<'a,'b>() {
//[nll]~^^ ERROR lifetime may not live long enough
}

///////////////////////////////////////////////////////////////////////////

pub trait TheSubTrait : for<'a> TheTrait<'a> {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

#![allow(dead_code)]

///////////////////////////////////////////////////////////////////////////

pub trait TheTrait {
type TheAssocType;
}
Expand All @@ -22,8 +20,6 @@ impl<'b> TheTrait for TheType<'b> {
type TheAssocType = &'b ();
}

///////////////////////////////////////////////////////////////////////////

pub struct WithAssoc<T> where T : TheTrait {
m: [T; 0]
}
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/regions/regions-outlives-projection-container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#![allow(dead_code)]
#![feature(rustc_attrs)]

///////////////////////////////////////////////////////////////////////////

pub trait TheTrait {
type TheAssocType;
}
Expand All @@ -19,8 +17,6 @@ impl<'b> TheTrait for TheType<'b> {
type TheAssocType = &'b ();
}

///////////////////////////////////////////////////////////////////////////

pub struct WithAssoc<T:TheTrait> {
m: [T; 0]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// Check a number of scenarios in which one impl tries to override another,
// without correctly using `default`.

////////////////////////////////////////////////////////////////////////////////
// Test 1: one layer of specialization, multiple methods, missing `default`
////////////////////////////////////////////////////////////////////////////////

trait Foo {
fn foo(&self);
Expand All @@ -25,9 +23,7 @@ impl Foo for u32 {
fn bar(&self) {} //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 2: one layer of specialization, missing `default` on associated type
////////////////////////////////////////////////////////////////////////////////

trait Bar {
type T;
Expand All @@ -41,9 +37,7 @@ impl Bar for u8 {
type T = (); //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 3a: multiple layers of specialization, missing interior `default`
////////////////////////////////////////////////////////////////////////////////

trait Baz {
fn baz(&self);
Expand All @@ -61,10 +55,8 @@ impl Baz for i32 {
fn baz(&self) {} //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 3b: multiple layers of specialization, missing interior `default`,
// redundant `default` in bottom layer.
////////////////////////////////////////////////////////////////////////////////

trait Redundant {
fn redundant(&self);
Expand Down
8 changes: 0 additions & 8 deletions src/test/ui/specialization/specialization-no-default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// Check a number of scenarios in which one impl tries to override another,
// without correctly using `default`.

////////////////////////////////////////////////////////////////////////////////
// Test 1: one layer of specialization, multiple methods, missing `default`
////////////////////////////////////////////////////////////////////////////////

trait Foo {
fn foo(&self);
Expand All @@ -25,9 +23,7 @@ impl Foo for u32 {
fn bar(&self) {} //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 2: one layer of specialization, missing `default` on associated type
////////////////////////////////////////////////////////////////////////////////

trait Bar {
type T;
Expand All @@ -41,9 +37,7 @@ impl Bar for u8 {
type T = (); //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 3a: multiple layers of specialization, missing interior `default`
////////////////////////////////////////////////////////////////////////////////

trait Baz {
fn baz(&self);
Expand All @@ -61,10 +55,8 @@ impl Baz for i32 {
fn baz(&self) {} //~ ERROR E0520
}

////////////////////////////////////////////////////////////////////////////////
// Test 3b: multiple layers of specialization, missing interior `default`,
// redundant `default` in bottom layer.
////////////////////////////////////////////////////////////////////////////////

trait Redundant {
fn redundant(&self);
Expand Down
6 changes: 0 additions & 6 deletions src/test/ui/traits/traits-conditional-model-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ use go_trait::{Go, GoMut, GoOnce, go, go_mut, go_once};
use std::rc::Rc;
use std::cell::Cell;

///////////////////////////////////////////////////////////////////////////

struct SomeGoableThing {
counter: Rc<Cell<isize>>
}
Expand All @@ -26,8 +24,6 @@ impl Go for SomeGoableThing {
}
}

///////////////////////////////////////////////////////////////////////////

struct SomeGoOnceableThing {
counter: Rc<Cell<isize>>
}
Expand All @@ -38,8 +34,6 @@ impl GoOnce for SomeGoOnceableThing {
}
}

///////////////////////////////////////////////////////////////////////////

fn main() {
let counter = Rc::new(Cell::new(0));
let mut x = SomeGoableThing { counter: counter.clone() };
Expand Down

0 comments on commit 2386cce

Please sign in to comment.