Skip to content

Strange error message on empty asm! macro #34881

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

Closed
phil-opp opened this issue Jul 17, 2016 · 3 comments
Closed

Strange error message on empty asm! macro #34881

phil-opp opened this issue Jul 17, 2016 · 3 comments
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`)

Comments

@phil-opp
Copy link
Contributor

The following code produces a strange error:

#![feature(asm)]

fn main() { 
   unsafe { asm!() }
}

The error is:

error: expected expression, found `<eof>`

Playpen link

The error does not contain any file or line information, so it's pretty hard to find the offending line. The error also occurs on stable, where inline assembly isn't even allowed.

@sanxiyn sanxiyn added the A-inline-assembly Area: Inline assembly (`asm!(…)`) label Jul 17, 2016
@asdfopiweut
Copy link

It's not about inline assembly imo:

macro_rules! emit_bug {
// if nothing on input, then return what?
    () => (); // () => (()); <-- This works
}

fn main() {
   emit_bug!() // no semicolon here
}

@phil-opp
Copy link
Contributor Author

phil-opp commented Aug 6, 2016

@asdfopiweut I can reproduce it on my machine and on playpen. The same error: expected expression, found <eof>. So I think this issue should also get A-macros.

cc @sanxiyn

@Mark-Simulacrum
Copy link
Member

This is #30128, closing in favor of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`)
Projects
None yet
Development

No branches or pull requests

4 participants