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

"expecting a type here because of type ascription" when forgetting a : #51222

Closed
progval opened this issue May 30, 2018 · 3 comments
Closed

"expecting a type here because of type ascription" when forgetting a : #51222

progval opened this issue May 30, 2018 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug.

Comments

@progval
Copy link
Contributor

progval commented May 30, 2018

In the following code, I forgot a semicolon:

fn main() {
    Box:new("foo".to_string())
}

This generates the following error:

  |
2 |     Box:new("foo".to_string())
  |             ^^^^^ expecting a type here because of type ascription

This may get confusing when nesting multiple calls in the argument of Box::new.

ping @GuillaumeGomez

@kennytm kennytm added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. labels May 30, 2018
@estebank
Copy link
Contributor

cc #34255, #48016.

@estebank
Copy link
Contributor

CC #54516

@estebank
Copy link
Contributor

CC #47666

Centril added a commit to Centril/rust that referenced this issue Mar 26, 2019
Centril added a commit to Centril/rust that referenced this issue Mar 26, 2019
Centril added a commit to Centril/rust that referenced this issue Mar 26, 2019
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 C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

3 participants