rust-lang / rust-lang/rust

rustc doesn't finish stuck at rustc_trait_selection::traits::normalize::normalize_with_depth_to

Open
#132,032 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-trait-system C-bug E-needs-mcve I-hang T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

After a re factoring, moving some structs into different crates the build won't finish.
Raphtory

These finish

cargo check -p raphtory-api
cargo check -p raphtory-memstorage

This doesn't

cargo check -p raphtory

I need some help to track down what causes this?
I suspect our use of traits is the cause of this but I don't know how to find out which ones are causing this issue.

I expected to see this happen: cargo would finish compiling

Instead, this happened: cargo doesn't finish compiling

Meta

rustc --version --verbose:

rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1
The end of Rustc LOG where depth seems to degenerate

rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=0, value=ImplHeader { impl_def_id: DefId(2:2820 ~ core[d898]::ptr::{impl#0}), impl_args: [?0t], self
_ty: ?0t, trait_ref: Some(<_ as std::cmp::PartialEq>), predicates: [Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder {
value: TraitPredicate(<_ as std::marker::FnPtr>, polarity:Positive), bound_vars: [] }] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=0, value=ImplHeader { impl_def_id: DefId(0:5278 ~ raphtory[29e2]::db::graph::graph::{impl#1}), impl_
args: ['?0, ?1t], self_ty: raphtory_memstorage::db::graph::views::graph::Graph, trait_ref: Some(<raphtory_memstorage::db::graph::views::graph::Graph as std::cmp::PartialEq<_
>>), predicates: [Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<_ as db::api::view::graph::
GraphViewOps<'_>>, polarity:Positive), bound_vars: [] }, Binder { value: OutlivesPredicate(raphtory_memstorage::db::graph::views::graph::Graph, '?0), bound_vars: [] }] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=<_ as db::api::view::graph::GraphViewOps<'_>>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=<_ as db::api::view::graph::GraphViewOps<'_>>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as std::marker::Sized>, polarity:Positive), bound_vars: [
] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as db::api::view::internal::BoxableGraphView>, polarity:P
ositive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<_ as std::clone::Clone>, polarity:Positive), bound_vars: []
 }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(?2t, '?1), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(?2t, '?1), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=3, value=<_ as db::api::view::internal::BoxableGraphView>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=3, value=<_ as db::api::view::internal::BoxableGraphView>
...
 
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=Binder { value: TraitPredicate(<alloc::raw_vec::RawVecInner as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=std::ptr::Unique<u8>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=alloc::raw_vec::Cap
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=std::alloc::Global
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=<std::ptr::Unique<_> as std::marker::Sync>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=<std::ptr::Unique<_> as std::marker::Sync>
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<_ as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=68, value=Binder { value: TraitPredicate(<u8 as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<alloc::raw_vec::Cap as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=usize
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=68, value=Binder { value: TraitPredicate(<usize as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=67, value=Binder { value: TraitPredicate(<std::alloc::Global as std::marker::Sync>, polarity:Positive), bound_vars: [] }
 rustc_trait_selection::traits::normalize::normalize_with_depth_to depth=66, value=Binder { value: TraitPredicate(<std::marker::PhantomData<u8> as std::marker::Sync>, polarity:Positive), bound_vars: [] }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the hang with cargo check -p raphtory on the Raphtory memstorage branch, comparing it with the two package checks that finish. Use the supplied rustc version and inspect the rustc_trait_selection::traits::normalize::normalize_with_depth_to log, especially the repeated GraphViewOps, BoxableGraphView, and Sync predicates. Done means identifying a minimal cause or reproducer and making the full package check finish.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.