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

improve resolve error messages #3027

Closed
jesse99 opened this issue Jul 26, 2012 · 2 comments
Closed

improve resolve error messages #3027

jesse99 opened this issue Jul 26, 2012 · 2 comments
Assignees
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically

Comments

@jesse99
Copy link
Contributor

jesse99 commented Jul 26, 2012

import model::{msg, deregister_msg, foobar, register_msg};
src/handlers/get_query.rs:5 import model::{msg, deregister_msg, foobar, register_msg};
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

above error points to the wrong location and doesn't indicate the actual problem (which is foobar).

import foobar::{msg, deregister_msg, register_msg};

src/handlers/get_query.rs:5:7: 5:51 error: unresolved name
src/handlers/get_query.rs:5 import foobar::{msg, deregister_msg, register_msg};
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

points to the right place, but does not say that that name is the problem (again foobar).

@jdm
Copy link
Contributor

jdm commented Jul 26, 2012

Sounds very similar to #3004.

@bstrie
Copy link
Contributor

bstrie commented Apr 26, 2013

This:

extern mod std;
use std::{json, rope, foobar, arc, arena};
use foobar::bazqux;
fn main() {}

Now gives:

res.rs:2:22: 2:29 error: failed to resolve import: std::foobar
res.rs:2 use std::{json, rope, foobar, arc, arena};
                               ^~~~~~~
res.rs:3:4: 3:19 error: unresolved name
res.rs:3 use foobar::bazqux;
             ^~~~~~~~~~~~~~~
res.rs:3:4: 3:19 error: failed to resolve import: foobar::bazqux
res.rs:3 use foobar::bazqux;
             ^~~~~~~~~~~~~~~
error: failed to resolve imports
error: aborting due to 4 previous errors

So I think this issue can be closed.

@bstrie bstrie closed this as completed Apr 26, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Aug 17, 2023
Avoid unnecessary Vec resize.

If `size > 0` current implementation will first create an empty vec and then push an element into it, which will cause a resize that can be easily avoided.

It's obviously not a big deal, but this also gets rid of `mut` local variable.
jaisnan pushed a commit to jaisnan/rust-dev that referenced this issue Jul 29, 2024
The current method for creating the modifies wrapper requires changing
the `ensures` clause to have `_renamed` variables which are unsafe
copies of the original function arguments. This causes issues with
regards to some possible tests as in rust-lang#3239.

This change removes the `_renamed` variables and instead simply changes
the modifies clauses within the replace to unsafely dereference the
pointer to modify the contents of it unsafely, condensing all instances
of unsafe Rust into a single location.

Resolves rust-lang#3239
Resolves rust-lang#3026
May affect rust-lang#3027. In my attempt to run this example with slight
modification to fit the current implementation, I got the error `CBMC
appears to have run out of memory. You may want to rerun your proof in
an environment with additional memory or use stubbing to reduce the size
of the code the verifier reasons about.` This suggests that the
compilation is working appropriately but the test case is just too large
for CBMC.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

Co-authored-by: Matias Scharager <mscharag@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name/path resolution done by `rustc_resolve` specifically
Projects
None yet
Development

No branches or pull requests

4 participants