Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E0393 needs to be updated to new format #35632

Closed
sophiajt opened this issue Aug 13, 2016 · 0 comments
Closed

E0393 needs to be updated to new format #35632

sophiajt opened this issue Aug 13, 2016 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@sophiajt
Copy link
Contributor

From: src/test/compile-fail/E0393.rs

E0393 needs a span_label, updated title, and a note, changing it from:

error[E0393]: the type parameter `T` must be explicitly specified in an object type because its default value `Self` references the type `Self`
  --> src/test/compile-fail/E0393.rs:13:43
   |
13 | fn together_we_will_rule_the_galaxy(son: &A) {} //~ ERROR E0393
   |                                           ^

To:

error[E0393]: the type parameter `T` must be explicitly specified
  --> src/test/compile-fail/E0393.rs:13:43
   |
13 | fn together_we_will_rule_the_galaxy(son: &A) {} //~ ERROR E0393
   |                                           ^ missing reference to `T`
   |
   = note: because of the default `Self` reference, type parameters must be specified on object types
@bstrie bstrie added the A-diagnostics Area: Messages for errors, warnings, and lints label Aug 24, 2016
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 30, 2016
Update E0393 to new error format

Fixes rust-lang#35632.
Part of rust-lang#35233.

r? @jonathandturner

and a wired thing is that if i add another label

```rust
.span_label(span, &format!("missing reference to `{}`", def.name))
.span_label(span, &format!("because of the default `Self` reference, type parameters must be specified on object types"))
```

and add a new note in the test case like

```rust
trait A<T=Self> {}

fn together_we_will_rule_the_galaxy(son: &A) {}
//~^ ERROR E0393
//~| NOTE missing reference to `T`
//~| NOTE because of the default `Self` reference, type parameters must be specified on object types
```

it will complain that

```
running 1 test
test [compile-fail] compile-fail/E0393.rs ... FAILED

failures:

---- [compile-fail] compile-fail/E0393.rs stdout ----

error: /Users/zjh/Documents/rustspace/rust/src/test/compile-fail/E0393.rs:13: unexpected "error": '13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]'

unexpected errors (from JSON output): [
    Error {
        line_num: 13,
        kind: Some(
            Error
        ),
        msg: "13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]"
    }
]
```

it is a little bit confusing and through the blog post we can use `//~^` and `//~|` to support multiple notes, @jonathandturner am i missing something here?
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 31, 2016
Update E0393 to new error format

Fixes rust-lang#35632.
Part of rust-lang#35233.

r? @jonathandturner

and a wired thing is that if i add another label

```rust
.span_label(span, &format!("missing reference to `{}`", def.name))
.span_label(span, &format!("because of the default `Self` reference, type parameters must be specified on object types"))
```

and add a new note in the test case like

```rust
trait A<T=Self> {}

fn together_we_will_rule_the_galaxy(son: &A) {}
//~^ ERROR E0393
//~| NOTE missing reference to `T`
//~| NOTE because of the default `Self` reference, type parameters must be specified on object types
```

it will complain that

```
running 1 test
test [compile-fail] compile-fail/E0393.rs ... FAILED

failures:

---- [compile-fail] compile-fail/E0393.rs stdout ----

error: /Users/zjh/Documents/rustspace/rust/src/test/compile-fail/E0393.rs:13: unexpected "error": '13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]'

unexpected errors (from JSON output): [
    Error {
        line_num: 13,
        kind: Some(
            Error
        ),
        msg: "13:43: 13:44: the type parameter `T` must be explicitly specified [E0393]"
    }
]
```

it is a little bit confusing and through the blog post we can use `//~^` and `//~|` to support multiple notes, @jonathandturner am i missing something here?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

2 participants