Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
12c32e944d3dbadb6a114a6e0bc51b065b4f42c1
rust/src/test/compile-fail/class-implements-bad-trait.rs

10 lines
155 B
Rust
Raw Normal View History

rustc: Switch to the new resolution pass
2012-07-06 19:06:58 -07:00
// error-pattern:nonexistent
Remove 'implements' keyword in favour of :, part of #2301.
2012-06-22 18:19:35 -07:00
class cat : nonexistent {
Allow classes to implement ifaces Introduce syntax like: iface animal { ... } class cat implements animal { ... } to allow classes to implement ifaces. Casting classes to ifaces is *not* yet supported. ifaces that a class implements are not yet included in metadata. The syntax is subject to change, and may go away completely if we decide to use duck typing to relate classes with ifaces (see http://smallcultfollowing.com/babysteps/blog/2012/04/10/declared-vs-duckish-typing/ )
2012-04-11 16:18:00 -07:00
let meows: uint;
new(in_x : uint) { self.meows = in_x; }
}
fn main() {
let nyan = cat(0u);
rustc: Switch to the new resolution pass
2012-07-06 19:06:58 -07:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 537ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API