Closed
Description
Script to reproduce:
use std::gc::{GC,Gc};
fn main() {
let x: Box<int> = box 0;
let y: Gc<int> = box (GC) 0;
println!("{}", x + 1);
println!("{}", y + 1);
}
Output:
foo.rs:7:20: 7:25 error: binary operation `+` cannot be applied to type `~int`
foo.rs:7 println!("{}", x + 1);
^~~~~
note: in expansion of format_args!
<std macros>:2:23: 2:77 note: expansion site
<std macros>:1:1: 3:2 note: in expansion of println!
foo.rs:7:5: 7:27 note: expansion site
foo.rs:8:20: 8:25 error: binary operation `+` cannot be applied to type `@int`
foo.rs:8 println!("{}", y + 1);
^~~~~
note: in expansion of format_args!
<std macros>:2:23: 2:77 note: expansion site
<std macros>:1:1: 3:2 note: in expansion of println!
foo.rs:8:5: 8:27 note: expansion site
foo.rs:7:20: 7:25 error: cannot determine a type for this bounded type parameter: unconstrained type
foo.rs:7 println!("{}", x + 1);
^~~~~
note: in expansion of format_args!
<std macros>:2:23: 2:77 note: expansion site
<std macros>:1:1: 3:2 note: in expansion of println!
foo.rs:7:5: 7:27 note: expansion site
Expected:
Box<int>
instead of ~int
Gc<int>
instead of @int
Version:
$ rustc --version
rustc 0.11.0-pre (6d8342f 2014-06-14 17:51:49 +0000)
host: x86_64-unknown-linux-gnu