]> git.lizzy.rs Git - rust.git/commit
collector: limit pme context note to user-defd fns
authorDavid Wood <david.wood@huawei.com>
Fri, 1 Oct 2021 16:23:07 +0000 (16:23 +0000)
committerDavid Wood <david.wood@huawei.com>
Fri, 1 Oct 2021 16:34:18 +0000 (16:34 +0000)
commit4528b8e581eb1bb24f4f264d43244d7912f812f7
treeb9c362bf67ff29425617cfcd89b819cdec9e004c
parentda2b69b6142725586a41d6db751921043a1786af
collector: limit pme context note to user-defd fns

rustc adds notes to errors which happen post-monomorphization to
provide the user with helpful context (as these errors may rely on the
specific instantiations). To prevent this note being added where it is
not appropriate, the node is checked to originate outwith the current
crate. However, when polymorphization is enabled, this can result in
some errors (produced by `optimized_mir`) to occur earlier in
compilation than they normally would, during the collection of shims.
Some shims have ids that originate in the standard library, but these
should not receive the PME note, so instances for compiler-generated
functions no longer receive this note.

Signed-off-by: David Wood <david.wood@huawei.com>
compiler/rustc_middle/src/mir/mono.rs
compiler/rustc_monomorphize/src/collector.rs