]> git.proxmox.com Git - rustc.git/blame - src/test/compile-fail/trait-impl-method-mismatch.rs
Imported Upstream version 1.3.0+dfsg1
[rustc.git] / src / test / compile-fail / trait-impl-method-mismatch.rs
CommitLineData
223e47cc
LB
1// Copyright 2012 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.
4//
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.
10
1a4d82fc 11
223e47cc 12trait Mumbo {
1a4d82fc 13 fn jumbo(&self, x: &usize) -> usize;
223e47cc
LB
14}
15
1a4d82fc 16impl Mumbo for usize {
223e47cc 17 // Cannot have a larger effect than the trait:
1a4d82fc 18 unsafe fn jumbo(&self, x: &usize) { *self + *x; }
c1a9b12d
SL
19 //~^ ERROR method `jumbo` has an incompatible type for trait
20 //~| expected normal fn,
21 //~| found unsafe fn
223e47cc
LB
22}
23
24fn main() {}