]> git.lizzy.rs Git - rust.git/commit
Fix a bug with statics inside blocks in generic fns
authorAlex Crichton <alex@alexcrichton.com>
Thu, 29 Aug 2013 06:28:06 +0000 (23:28 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 30 Aug 2013 01:51:29 +0000 (18:51 -0700)
commit2c1d6568f253a2310a0b4a06064b2cf0271aa6be
tree1ba72b18a36dc2ae65268bd4abb6642c7726e110
parent89d04009c160b7a88b03f42c633220457bd72a09
Fix a bug with statics inside blocks in generic fns

Whenever a generic function was encountered, only the top-level items were
recursed upon, even though the function could contain items inside blocks or
nested inside of other expressions. This fixes the existing code from traversing
just the top level items to using a Visitor to deeply recurse and find any items
which need to be translated.

This was uncovered when building code with --lib, because the encode_symbol
function would panic once it found that an item hadn't been translated.

Closes #8134
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/meth.rs
src/test/auxiliary/nested_item.rs [new file with mode: 0644]
src/test/run-pass/nested_item_main.rs [new file with mode: 0644]