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

println! macro has confusing error message when the first argument isn't a string literal #730

Open
Nathan-Fenner opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Nathan-Fenner
Copy link

Playground link

pub fn main() {
	let x = 5;
	println!(x + 7);
}

(note, this syntax is incorrect - it should be println!("{}", x+7);)

However, the error message is highly misleading:

Failed to build rune sources (see diagnostics for details)

error: No local variable `x`
  ┌─ entry:3:11
  │
3 │     println!(x + 7);
  │              ^ No local variable `x`
@udoprog udoprog added the enhancement New feature or request label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants