Skip to content

println!() with no trailing semicolon causes an error #3204

@GrigorenkoPV

Description

@GrigorenkoPV

I tried this code:

fn main() {
    println!()
}

using the following command line invocation:

kani test.rs

with Kani version: 0.51.0

I expected to see this happen: all is ok

Instead, this happened:

error: macro expansion ends with an incomplete expression: expected expression
 --> test.rs:2:5
  |
2 |     println!()
  |     ^^^^^^^^^^ expected expression
  |
  = note: the macro call doesn't expand to an expression, but it can expand to a statement
help: add `;` to interpret the expansion as a statement
  |
2 |     println!();
  |               +

error: aborting due to 1 previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions