1 // Copyright 2015 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.
11 // aux-build:no_method_suggested_traits.rs
12 extern crate no_method_suggested_traits;
30 // test the values themselves, and autoderef.
34 //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
35 //~| ERROR no method named
36 //~| HELP `use foo::Bar;`
37 //~| HELP `use no_method_suggested_traits::foo::PubPub;`
38 std::rc::Rc::new(&mut Box::new(&1u32)).method();
39 //~^ HELP following traits are implemented but not in scope, perhaps add a `use` for one of them
40 //~| ERROR no method named
41 //~| HELP `use foo::Bar;`
42 //~| HELP `use no_method_suggested_traits::foo::PubPub;`
45 //~^ ERROR no method named
46 //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
47 //~| HELP `use foo::Bar;`
48 std::rc::Rc::new(&mut Box::new(&'a')).method();
49 //~^ ERROR no method named
50 //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
51 //~| HELP `use foo::Bar;`
54 //~^ ERROR no method named
55 //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
56 //~| HELP `use no_method_suggested_traits::foo::PubPub;`
57 std::rc::Rc::new(&mut Box::new(&1i32)).method();
58 //~^ ERROR no method named
59 //~| HELP the following trait is implemented but not in scope, perhaps add a `use` for it:
60 //~| HELP `use no_method_suggested_traits::foo::PubPub;`
63 //~^ ERROR no method named
64 //~| HELP following traits define an item `method`, perhaps you need to implement one of them
66 //~| HELP `no_method_suggested_traits::foo::PubPub`
67 //~| HELP `no_method_suggested_traits::Reexported`
68 //~| HELP `no_method_suggested_traits::bar::PubPriv`
69 //~| HELP `no_method_suggested_traits::qux::PrivPub`
70 //~| HELP `no_method_suggested_traits::quz::PrivPriv`
71 std::rc::Rc::new(&mut Box::new(&Foo)).method();
72 //~^ ERROR no method named
73 //~| HELP following traits define an item `method`, perhaps you need to implement one of them
75 //~| HELP `no_method_suggested_traits::foo::PubPub`
76 //~| HELP `no_method_suggested_traits::Reexported`
77 //~| HELP `no_method_suggested_traits::bar::PubPriv`
78 //~| HELP `no_method_suggested_traits::qux::PrivPub`
79 //~| HELP `no_method_suggested_traits::quz::PrivPriv`
82 //~^ ERROR no method named
83 //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
85 std::rc::Rc::new(&mut Box::new(&1u64)).method2();
86 //~^ ERROR no method named
87 //~| HELP the following trait defines an item `method2`, perhaps you need to implement it
90 no_method_suggested_traits::Foo.method2();
91 //~^ ERROR no method named
92 //~| HELP following trait defines an item `method2`, perhaps you need to implement it
94 std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
95 //~^ ERROR no method named
96 //~| HELP following trait defines an item `method2`, perhaps you need to implement it
98 no_method_suggested_traits::Bar::X.method2();
99 //~^ ERROR no method named
100 //~| HELP following trait defines an item `method2`, perhaps you need to implement it
102 std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
103 //~^ ERROR no method named
104 //~| HELP following trait defines an item `method2`, perhaps you need to implement it
108 //~^ ERROR no method named
109 //~| HELP following trait defines an item `method3`, perhaps you need to implement it
110 //~| HELP `no_method_suggested_traits::foo::PubPub`
111 std::rc::Rc::new(&mut Box::new(&Foo)).method3();
112 //~^ ERROR no method named
113 //~| HELP following trait defines an item `method3`, perhaps you need to implement it
114 //~| HELP `no_method_suggested_traits::foo::PubPub`
116 //~^ ERROR no method named
117 //~| HELP following trait defines an item `method3`, perhaps you need to implement it
118 //~| HELP `no_method_suggested_traits::foo::PubPub`
119 std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
120 //~^ ERROR no method named
121 //~| HELP following trait defines an item `method3`, perhaps you need to implement it
122 //~| HELP `no_method_suggested_traits::foo::PubPub`
124 // should have no help:
125 1_usize.method3(); //~ ERROR no method named
126 std::rc::Rc::new(&mut Box::new(&1_usize)).method3(); //~ ERROR no method named
127 no_method_suggested_traits::Foo.method3(); //~ ERROR no method named
128 std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
129 //~^ ERROR no method named
130 no_method_suggested_traits::Bar::X.method3(); //~ ERROR no method named
131 std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
132 //~^ ERROR no method named