Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions tests/ui/structs-enums/auxiliary/cci_class.rs

This file was deleted.

19 changes: 0 additions & 19 deletions tests/ui/structs-enums/auxiliary/cci_class_2.rs

This file was deleted.

19 changes: 0 additions & 19 deletions tests/ui/structs-enums/auxiliary/cci_class_3.rs

This file was deleted.

73 changes: 43 additions & 30 deletions tests/ui/structs-enums/auxiliary/cci_class_4.rs
Original file line number Diff line number Diff line change
@@ -1,41 +1,54 @@
pub mod kitties {
pub struct cat {
meows : usize,
use std::fmt;

pub how_hungry : isize,
pub name : String,
#[derive(Clone)]
pub struct Cat {
meows: usize,

pub how_hungry: isize,
pub name: String,
}

impl Cat {
pub fn speak(&mut self) {
self.meow();
}

impl cat {
pub fn speak(&mut self) { self.meow(); }

pub fn eat(&mut self) -> bool {
if self.how_hungry > 0 {
println!("OM NOM NOM");
self.how_hungry -= 2;
return true;
} else {
println!("Not hungry!");
return false;
}
pub fn eat(&mut self) -> bool {
if self.how_hungry > 0 {
println!("OM NOM NOM");
self.how_hungry -= 2;
return true;
} else {
println!("Not hungry!");
return false;
}
}

impl cat {
pub fn meow(&mut self) {
println!("Meow");
self.meows += 1;
if self.meows % 5 == 0 {
self.how_hungry += 1;
}
pub fn noop(&self) {}
}

impl Cat {
pub fn meow(&mut self) {
println!("Meow");
self.meows += 1;
if self.meows % 5 == 0 {
self.how_hungry += 1;
}
}
pub fn meow_count(&self) -> usize {
self.meows
}
}

pub fn cat(in_x : usize, in_y : isize, in_name: String) -> cat {
cat {
meows: in_x,
how_hungry: in_y,
name: in_name
}
pub fn cat(in_x: usize, in_y: isize, in_name: String) -> Cat {
Cat { meows: in_x, how_hungry: in_y, name: in_name }
}
pub fn cat_unnamed(in_x: usize, in_y: isize) -> Cat {
Cat { meows: in_x, how_hungry: in_y, name: String::new() }
}

impl fmt::Display for Cat {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.name)
}
}
50 changes: 0 additions & 50 deletions tests/ui/structs-enums/auxiliary/cci_class_cast.rs

This file was deleted.

5 changes: 0 additions & 5 deletions tests/ui/structs-enums/auxiliary/cci_class_trait.rs

This file was deleted.

17 changes: 0 additions & 17 deletions tests/ui/structs-enums/class-cast-to-trait-cross-crate-2.rs

This file was deleted.

94 changes: 0 additions & 94 deletions tests/ui/structs-enums/class-cast-to-trait-multiple-types.rs

This file was deleted.

60 changes: 0 additions & 60 deletions tests/ui/structs-enums/class-cast-to-trait.rs

This file was deleted.

2 changes: 1 addition & 1 deletion tests/ui/structs-enums/class-dtor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ run-pass
//@ check-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]

Expand Down
Loading
Loading