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

unresolved name conflict #322

Closed
lkuper opened this issue Apr 8, 2011 · 3 comments
Closed

unresolved name conflict #322

lkuper opened this issue Apr 8, 2011 · 3 comments

Comments

@lkuper
Copy link
Contributor

lkuper commented Apr 8, 2011

Here's a fun one!

fn main() {

    fn id(int n) -> int {
        // this should have been 'ret n;'
        ret i;
    }

    let int i = id(5);
    log i;
}

This shouldn't compile, and it doesn't, but instead of the expected "unresolved name: i", I get all the way to trans.rs and then get:
upcall fail '.t4410', ../rust/src/comp/middle/trans.rs:3725

Apologies if this is already a known issue -- I didn't see it in a quick look through the issue tracker.

@espindola
Copy link

That is an interesting case. My understanding is that it should resolve to the variable in main, but should produce an error about capturing an external variable.

@lkuper
Copy link
Contributor Author

lkuper commented Apr 8, 2011

For what it's worth, for the same program in C

#include <stdio.h>

main() {
    int id(int n) { return i; }
    int i = id(5);
    printf("%d\n", i);
}

gcc gives me:
id.c: In function ‘id’:
id.c:4: error: ‘i’ undeclared (first use in this function)

@ghost ghost assigned espindola Apr 11, 2011
@espindola
Copy link

We now produce the same error as rustboot: attempted dynamic environment-capture

oli-obk pushed a commit to oli-obk/rust that referenced this issue Sep 19, 2017
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Add missing consts for Solaris/Illumos
marysaka pushed a commit to sunriseos/rust that referenced this issue Oct 20, 2019
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Define dependencies with an array

Among other things, this will allow us to comment on them in the future.

* Add missing (non-CI) dependency

Running setup scripts on the default Ubuntu AMI results in this error message:

```
+ sudo python3 -m pip install --upgrade cbmc_viewer-2.5-py3-none-any.whl
/usr/bin/python3: No module named pip
```

This fixes the issue.

* Use the downloaded file, if already downloaded

wget has a default behavior that causes downloads like this to get new
unexpected filenames if the file already exists.

The switch to curl is simply personal preference.

* swap back to wget

* keep deps in alpha order for now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants