rust-lang / rust-lang/rust-analyzer

stack overflow: recursive struct

Open
#23,335 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug I-crash
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

struct A {
    m: A,
}
struct B(Box<A>);

fn main() {}

ra @ f3120321073d8046795c6824976be8b0ae92c999

/rust-analyzer analysis-stats .

Database loaded:     664.49ms, 220minstr, 48mb (metadata 314.62ms, 965kinstr, 155kb; build 60.49ms, 172kinstr, 1296b)
  item trees: 1
  dependency lines of code: 1_477_159, item trees: 2_968
  dependency item stats: traits: 858, impl: 9_720, mods: 2_998, macro calls: 5_608, macro rules: 1_062
Item Tree Collection: 4.40s, 23ginstr, 431mb
  Total Statistics:
    crates: 1, mods: 1, decls: 3, bodies: 1, adts: 2, consts: 0, signatures: 3, variants: 2
  Workspace:
    traits: 0, macro_rules macros: 0, proc_macros: 0
    lines of code: 6, item trees: 1
    usages: traits: 0, impl: 0, mods: 0, macro calls: 0, macro rules: 0
  Dependencies:
    lines of code: 1_477_159, item trees: 2_968
    declarations: traits: 858, impl: 9_720, mods: 2_998, macro calls: 5_608, macro rules: 1_062
Item Collection:     2.09s, 11ginstr, 176mb
Crate lang items:    260.52ms, 2522minstr, 31mb
Expression Store Lowering: 149.08µs, 276kinstr, -26kb
  exprs: 1, ??ty: 0 (0%), ?ty: 0 (0%), !ty: 0
  pats: 0, ??ty: 0 (100%), ?ty: 0 (100%), !ty: 0
  panics: 0
Inference:           998.31µs, 705kinstr, 2492kb
MIR lowering:        36.32µs, 45kinstr, 0b
Mir failed bodies: 0 (0%)

thread 'main' (2149086) has overflowed its stack
fatal runtime error: stack overflow, aborting
[1]    2149086 abort      ~/vcs/github/rust-analyzer/target/release/rust-analyzer analysis-stats .

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 checking out rust-analyzer at ra f3120321073d8046795c6824976be8b0ae92c999 and running /rust-analyzer analysis-stats . with the recursive A and Box example from the report. Trace the analysis path that reaches the stack overflow; done means the command no longer aborts on this input.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.