about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/context.rs
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-07-07 19:45:41 +0800
committerGitHub <noreply@github.com>2025-07-07 19:45:41 +0800
commitb6015a68de40d9563ecba7b7310b32ed6cad20dd (patch)
tree1929a1ca439649b1277e254b9b527dcfab114344 /compiler/rustc_codegen_llvm/src/context.rs
parenteed55947accb36fdd2af438aa599804aac7dd96b (diff)
parenta40274d6cc17725d990cf8f3a02d553b5e9100bf (diff)
downloadrust-b6015a68de40d9563ecba7b7310b32ed6cad20dd.tar.gz
rust-b6015a68de40d9563ecba7b7310b32ed6cad20dd.zip
Rollup merge of #143551 - compiler-errors:root-sub, r=cjgillot
Dont resolve instance of root in `mir_callgraph_cyclic`

`Instance::try_resolve` on a default trait body method will always fail, since it's still possible to further substitute. This leads to a cycle, since in `tests/mir-opt/inline_default_trait_body.rs`, both `Trait::a` and `Trait::b` need to consider the other to be cyclical, but since we couldn't resolve a body, we'd just consider *nothing* to be cyclical.

The root instance we care about when computing `mir_callgraph_cyclic` is trivial to compute (it's just `InstanceKind::Item`), so just replace it with a call to `Instance::new_raw`.

r? `@cjgillot` `@oli-obk`

Fixes rust-lang/rust#143534
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/context.rs')
0 files changed, 0 insertions, 0 deletions