Skip to content

The ~ and @ sigils still appear in error messages #14915

Closed
@japaric

Description

@japaric

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

Filed as per @pcwalton request

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions