#152942·Rust

Query depth limit overflow due to nested async fn when building matrix_sdk

Author: ChiffarioCreated Feb 21, 2026Updated Sep 17, 2026
LabelsT-compilerregression-from-stable-to-stableC-bugE-needs-mcveA-query-systemT-types

View all comments

Problem

When using latest nightly (cargo 1.95.0-nightly (ce69df6f7 2026-02-12)), trying to build a project with matrix-sdk causes the following error

error: queries overflow the depth limit!
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`matrix_sdk`)
  = note: query depth increased by 130 when computing layout of `{async fn body of client::<impl at /home/chiffa/.local/share/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/matrix-sdk-0.16.0/src/client/mod.rs:488:1: 488:12>::sync()}`

error: could not compile `matrix-sdk` (lib) due to 1 previous error

building the same project on stable cargo/rustc does not reproduce the error. There are no nightly-specific flags used and no cargo options either

Steps

Simplified

  1. Clone https://github.com/Chiffario/matrix-osu-bot or add matrix-sdk as a dependency to a new project
  2. Attempt building with nightly compiler

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.95.0-nightly (ce69df6f7 2026-02-12)
release: 1.95.0-nightly
commit-hash: ce69df6f72a3b6a2b5c722ba68ddef255344b31c
commit-date: 2026-02-12
host: x86_64-unknown-linux-gnu
libgit2: 1.9.2 (sys:0.20.4 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:OpenSSL/3.5.4)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Arch Linux Rolling Release [64-bit]