Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Block style autodetection should take upvars into account #1474

Closed
marijnh opened this issue Jan 9, 2012 · 2 comments
Closed

Block style autodetection should take upvars into account #1474

marijnh opened this issue Jan 9, 2012 · 2 comments
Assignees

Comments

@marijnh
Copy link
Contributor

marijnh commented Jan 9, 2012

This is a slight variation on #1467:

fn main() {
    let x = 3;
    fn blah(_a: fn()) {}
    blah({|| log(error, x); });
}

Compiling that crashes when trans tries to resolve the upvar for x inside the block. I guess typeck should refuse to convert something that has upvars into a bare function. (Or, if we end up dumping bare functions, this would be moot too.)

@ghost ghost assigned nikomatsakis Jan 9, 2012
@jruderman
Copy link
Contributor

'Assertion cx.fcx.llupvars.contains_key(did.node) failed', ../src/comp/middle/trans.rs:2698

@nikomatsakis
Copy link
Contributor

Yes, when I saw #1467 I thought to myself: "I bet block inference gets this wrong." The only reason I didn't fix it yet is that I was thinking of trying to dump bare fn types.

joshtriplett added a commit to joshtriplett/rust that referenced this issue Oct 7, 2022
- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
Kobzol pushed a commit to Kobzol/rust that referenced this issue Dec 30, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants