]> git.proxmox.com Git - rustc.git/blame - src/test/ui/span/coerce-suggestions.rs
New upstream version 1.25.0+dfsg1
[rustc.git] / src / test / ui / span / coerce-suggestions.rs
CommitLineData
32a655c1
SL
1// Copyright 2016 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
11#![feature(box_syntax)]
12
13fn test(_x: &mut String) {}
14fn test2(_x: &mut i32) {}
15
16fn main() {
17 let x: usize = String::new();
18 //~^ ERROR E0308
32a655c1
SL
19 let x: &str = String::new();
20 //~^ ERROR E0308
32a655c1
SL
21 let y = String::new();
22 test(&y);
23 //~^ ERROR E0308
32a655c1
SL
24 test2(&y);
25 //~^ ERROR E0308
32a655c1
SL
26 let f;
27 f = box f;
28 //~^ ERROR E0308
7cac9316
XL
29
30 let s = &mut String::new();
31 s = format!("foo");
32a655c1 32}