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.
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 #![feature(box_syntax)]
13 fn test(_x: &mut String) {}
14 fn test2(_x: &mut i32) {}
17 let x: usize = String::new();
19 //~| NOTE expected usize, found struct `std::string::String`
20 //~| NOTE expected type `usize`
21 //~| NOTE found type `std::string::String`
22 //~| HELP here are some functions which might fulfill your needs:
23 let x: &str = String::new();
25 //~| NOTE expected &str, found struct `std::string::String`
26 //~| NOTE expected type `&str`
27 //~| NOTE found type `std::string::String`
28 //~| HELP try with `&String::new()`
29 let y = String::new();
32 //~| NOTE types differ in mutability
33 //~| NOTE expected type `&mut std::string::String`
34 //~| NOTE found type `&std::string::String`
37 //~| NOTE types differ in mutability
38 //~| NOTE expected type `&mut i32`
39 //~| NOTE found type `&std::string::String`
43 //~| NOTE cyclic type of infinite size
44 //~| NOTE expected type `_`
45 //~| NOTE found type `Box<_>`