]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #92510 - inquisitivecrystal:foreign-block, r=cjgillot
authorMatthias Krüger <matthias.krueger@famsik.de>
Sun, 9 Jan 2022 12:38:30 +0000 (13:38 +0100)
committerGitHub <noreply@github.com>
Sun, 9 Jan 2022 12:38:30 +0000 (13:38 +0100)
Don't resolve blocks in foreign functions

Although it is an error for a foreign function to have a block, it is still possible at the level of the AST. #74204 made AST lowering skip over blocks belonging to foreign functions, since they're invalid. However, resolve still treated these blocks normally, resulting in a mismatch between the HIR and resolve, which could cause an ICE under certain circumstances. This PR changes resolve to skip over blocks belonging to foreign functions, as AST lowering does.

Fixes #91370.

r? ``@cjgillot``

1  2 
compiler/rustc_resolve/src/late.rs

Simple merge