]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-3973.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-3973.rs
CommitLineData
223e47cc 1struct Point {
1a4d82fc
JJ
2 x: f64,
3 y: f64,
223e47cc
LB
4}
5
1a4d82fc
JJ
6trait ToString_ {
7 fn to_string(&self) -> String;
8}
9
10impl ToString_ for Point {
11 fn new(x: f64, y: f64) -> Point {
12 //~^ ERROR method `new` is not a member of trait `ToString_`
223e47cc
LB
13 Point { x: x, y: y }
14 }
15
1a4d82fc
JJ
16 fn to_string(&self) -> String {
17 format!("({}, {})", self.x, self.y)
223e47cc
LB
18 }
19}
20
21fn main() {
1a4d82fc 22 let p = Point::new(0.0, 0.0);
46de9a89 23 //~^ ERROR no function or associated item named `new` found for struct `Point`
a7813a04 24 println!("{}", p.to_string());
223e47cc 25}