rust/src/test/compile-fail/issue-5153.rs
Ariel Ben-Yehuda 32fe2e3ad4 Address review commets
I think I didn't run tests properly - my second call to
select_all_obligations_or_error has made 3 tests fail. However, this is
just an error message change - integer fallback never worked with casts.
2015-05-19 17:42:14 +03:00

23 lines
692 B
Rust

// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
trait Foo {
fn foo(self: Box<Self>);
}
impl Foo for isize {
fn foo(self: Box<isize>) { }
}
fn main() {
(&5isize as &Foo).foo();
//~^ ERROR: no method named `foo` found for type `&Foo` in the current scope
}