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

invalid location with #debug type error #1387

Closed
erickt opened this issue Dec 27, 2011 · 3 comments
Closed

invalid location with #debug type error #1387

erickt opened this issue Dec 27, 2011 · 3 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)

Comments

@erickt
Copy link
Contributor

erickt commented Dec 27, 2011

This code highlights an invalid code location:

fn main() {
    let x = [1,2,3];
    #debug(x);
}

Returns this error message:

foo.rs:4:186: 4:187 error: first argument to #fmt must be a string literal.
foo.rs:4 }
                                                                                                                                                                                                   ^
rust: upcall fail 'explicit failure', ../src/comp/driver/session.rs:71
rust: domain main @0x102029600 root task failed
rust: fatal, 'leaked memory in rust main loop (2 objects)' failed, ../src/rt/memory_region.cpp:158 2 objects
@graydon
Copy link
Contributor

graydon commented Dec 30, 2011

This is a general problem with macros, not just #debug. When they report an error they go to (or near) the source line before the macro, and highlight it, but fail to pretty-print what the expanded syntax looked like. They should do both.

@kevina
Copy link
Contributor

kevina commented Jan 22, 2012

This bug turns out to be a duplicate of #1448. The fix to that will fix this one.

kevina added a commit to kevina/rust that referenced this issue Jan 23, 2012
Need a better fix, right now it is just causing even more confusion,
for example in issue rust-lang#1448 and rust-lang#1387.

This reverts commit 1e4de33.
kevina added a commit to kevina/rust that referenced this issue Jan 23, 2012
the replacement and not the span of the pattern variable.

Fixes issue rust-lang#1448, and rust-lang#1387.
kevina added a commit to kevina/rust that referenced this issue Jan 23, 2012
brson pushed a commit that referenced this issue Jan 24, 2012
Need a better fix, right now it is just causing even more confusion,
for example in issue #1448 and #1387.

This reverts commit 1e4de33.
brson pushed a commit that referenced this issue Jan 24, 2012
the replacement and not the span of the pattern variable.

Fixes issue #1448, and #1387.
brson pushed a commit that referenced this issue Jan 24, 2012
Need a better fix, right now it is just causing even more confusion,
for example in issue #1448 and #1387.

This reverts commit 1e4de33.
brson pushed a commit that referenced this issue Jan 24, 2012
the replacement and not the span of the pattern variable.

Fixes issue #1448, and #1387.
@brson
Copy link
Contributor

brson commented Jan 24, 2012

Fixed by kevina

@brson brson closed this as completed Jan 24, 2012
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…meters (rust-lang#1387)

1. Add an unstable hidden option to kani-driver to run sanity checks that are available in CBMC to perform consistency checks on the GOTO model.
2. Fix consistency checks related to missing is_parameter flag. We were not setting this parameter at all. CBMC expects all symbols that are function parameters to have this flag set to true.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants