1 // Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 fn shave(other: usize);
26 // If this provides a suggestion, it's a bug as MaybeDog doesn't impl Groom
28 //~^ ERROR: unresolved name `shave`
33 fn shave(other: usize) {
35 //~^ ERROR: unresolved name `whiskers`
36 //~| HELP this is an associated function
38 //~^ ERROR: unresolved name `shave`. Did you mean to call `Groom::shave`?
40 //~^ ERROR: unresolved name `purr`
49 //~^ ERROR: unresolved name `static_method`
51 //~^ ERROR: unresolved name `purr`
53 //~^ ERROR: unresolved name `purr`
55 //~^ ERROR: unresolved name `purr`
61 if self.whiskers > 3 {
62 //~^ ERROR `self` is not available in a static method [E0424]
63 //~| NOTE not available in static method
64 //~| NOTE maybe a `self` argument is missing?
71 //~^ ERROR: unresolved name `grow_older`
73 //~^ ERROR: unresolved name `shave`
76 fn burn_whiskers(&mut self) {
78 //~^ ERROR: unresolved name `whiskers`. Did you mean `self.whiskers`?
81 pub fn grow_older(other:usize) {
83 //~^ ERROR: unresolved name `whiskers`
84 //~| HELP this is an associated function
86 //~^ ERROR: unresolved name `purr_louder`
92 //~^ ERROR: unresolved name `self`
93 //~| HELP: module `self`
94 // it's a bug if this suggests a missing `self` as we're not in a method