Remove meaningless comments in src/test

This commit is contained in:
sd234678 2019-08-09 15:14:05 +01:00
parent f7af19c279
commit 56ebd57960
17 changed files with 0 additions and 81 deletions

View File

@ -259,8 +259,6 @@ fn _12() {
}
}
/////////////////
fn foo() { }
fn foo3(_: i32, _: (), _: ()) { }
fn qux(_: i32) { }

View File

@ -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

View File

@ -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) {
}

View File

@ -9,8 +9,6 @@ trait Test {
fn test(&self, value: &Self::V) -> bool;
}
///////////////////////////////////////////////////////////////////////////
struct TesterPair<T:Test> {
tester: T,
value: T::V,
@ -26,8 +24,6 @@ impl<T:Test> TesterPair<T> {
}
}
///////////////////////////////////////////////////////////////////////////
struct EqU32(u32);
impl Test for EqU32 {
type V = u32;

View File

@ -14,7 +14,6 @@ fn want_foo<T>()
{
}
///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause
struct SomeStruct<X> {
@ -30,7 +29,6 @@ fn one() {
want_foo::<SomeStruct<usize>>();
}
///////////////////////////////////////////////////////////////////////////
// Expressed as shorthand
struct AnotherStruct<X> {

View File

@ -15,7 +15,6 @@ fn want_foo1<T>()
{
}
///////////////////////////////////////////////////////////////////////////
// Expressed as a where clause
struct SomeStruct;

View File

@ -8,7 +8,6 @@
// See issue 60414
/////////////////////////////////////////////
// Reduction to `impl Trait`
struct Foo<T>(T);
@ -33,7 +32,6 @@ mod impl_trait {
}
}
/////////////////////////////////////////////
// Same with lifetimes in the trait
mod lifetimes {

View File

@ -8,7 +8,6 @@
// See issue 60414
/////////////////////////////////////////////
// Reduction to `impl Trait`
struct Foo<T>(T);
@ -32,7 +31,6 @@ mod impl_trait {
}
}
/////////////////////////////////////////////
// Same with lifetimes in the trait
mod lifetimes {
@ -59,7 +57,6 @@ mod lifetimes {
}
}
/////////////////////////////////////////////
// Reduction using `impl Trait` in bindings
mod impl_trait_in_bindings {
@ -80,7 +77,6 @@ mod impl_trait_in_bindings {
}
}
/////////////////////////////////////////////
// The same applied to `type Foo = impl Bar`s
mod opaque_types {

View File

@ -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);
}

View File

@ -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 }
}
@ -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 }
}

View File

@ -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;
}
@ -21,8 +18,6 @@ impl MakeString for usize {
}
}
///////////////////////////////////////////////////////////////////////////
trait Foo {
type F: MakeString;
@ -33,8 +28,6 @@ fn foo<F:Foo>(f: &F) -> String {
f.get().make_string()
}
///////////////////////////////////////////////////////////////////////////
struct SomeStruct {
field: isize,
}
@ -47,8 +40,6 @@ impl Foo for SomeStruct {
}
}
///////////////////////////////////////////////////////////////////////////
struct SomeOtherStruct {
field: usize,
}

View File

@ -6,9 +6,6 @@
#![allow(dead_code)]
///////////////////////////////////////////////////////////////////////////
pub trait TheTrait<'b> {
type TheAssocType;
}
@ -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>
{
@ -37,8 +32,6 @@ fn with_assoc<'a,'b>() {
//[nll]~^^ ERROR lifetime may not live long enough
}
///////////////////////////////////////////////////////////////////////////
pub trait TheSubTrait : for<'a> TheTrait<'a> {
}

View File

@ -8,8 +8,6 @@
#![allow(dead_code)]
///////////////////////////////////////////////////////////////////////////
pub trait TheTrait {
type TheAssocType;
}
@ -22,8 +20,6 @@ impl<'b> TheTrait for TheType<'b> {
type TheAssocType = &'b ();
}
///////////////////////////////////////////////////////////////////////////
pub struct WithAssoc<T> where T : TheTrait {
m: [T; 0]
}

View File

@ -5,8 +5,6 @@
#![allow(dead_code)]
#![feature(rustc_attrs)]
///////////////////////////////////////////////////////////////////////////
pub trait TheTrait {
type TheAssocType;
}
@ -19,8 +17,6 @@ impl<'b> TheTrait for TheType<'b> {
type TheAssocType = &'b ();
}
///////////////////////////////////////////////////////////////////////////
pub struct WithAssoc<T:TheTrait> {
m: [T; 0]
}

View File

@ -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);
@ -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;
@ -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);
@ -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);

View File

@ -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);
@ -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;
@ -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);
@ -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);

View File

@ -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>>
}
@ -26,8 +24,6 @@ impl Go for SomeGoableThing {
}
}
///////////////////////////////////////////////////////////////////////////
struct SomeGoOnceableThing {
counter: Rc<Cell<isize>>
}
@ -38,8 +34,6 @@ impl GoOnce for SomeGoOnceableThing {
}
}
///////////////////////////////////////////////////////////////////////////
fn main() {
let counter = Rc::new(Cell::new(0));
let mut x = SomeGoableThing { counter: counter.clone() };