You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Definition#deprecated? returns true for plain constants on x86_64 when built with rustc 1.99.0 #1089
Update: the cause is a rustc 1.99.0 miscompilation on x86_64 (rust-lang/rust#163911), not ruby-head or the 4.1 headers. See this comment. The original report is kept below for context, and its "Question" section is wrong.
On ruby-head on Linux x86_64, Definition#deprecated? returns true for constants that have no @deprecated tag. Definition identity is intact: location and comments return correct values; only the flag is wrong. The same rubydex builds behave correctly on Ruby 3.2 through 4.0, and on darwin-arm64 ruby-head.
Wrongly flagged: constants assigned a String, Regexp, Array, Hash, Set, or Pathname. Correct: Integer, Symbol, Float, true, nil, Bignum, Range, and a genuinely @deprecated constant.
The wrong value shows on the first query and is unchanged by GC.start + GC.compact. The same fixture written to disk and indexed via index_all fails identically.
Both 0.4.1 and 0.4.2 fail from a fresh source install, so this is not a recent rubydex regression.
Green on ruby-head 2026-10-17 (ruby/ruby@5b1c373522), red since 2026-10-21 (ruby/ruby@b4ae8a7189, 82 commits), still red on 2026-10-24. Linux x86_64 only; clean on darwin-arm64, including ruby-dev-builder's own prebuilt tarball.
Your ci.yml matrix (3.3, 3.4, 4.0) does not test ruby-head, which is why this goes unnoticed. Adding ruby-head should reproduce it in your existing deprecation tests.
Question
deprecated? is computed in Rust at index time, and the definition's location and comments cross into Ruby correctly. Only the flag is wrong, so the corruption must happen in the native extension that bridges Rust and Ruby, which on ruby-head is compiled from source against the 4.1 headers.
Correction: the cause is a rustc 1.99.0 miscompilation on x86_64 (rust-lang/rust#163911, fixed in 1.99.1). It isn't specific to ruby-head, and the 4.1 headers have nothing to do with it.
rdx_definition_is_deprecated is missing the and $0x1 before ret, so it returns the raw DefinitionFlags byte. Constants with PROMOTABLE set (e.g. X = 'x'.freeze) then report deprecated? == true.
The prebuilt 0.4.3 x86_64-linux gem was built with rustc 1.99.0. 0.4.2 was built with 1.99.1 and is correct. readelf -p .comment librubydex_sys.so shows this.
On ruby-head the gem is compiled from source with the CI runner's rustc, which is 1.99.0 on current ubuntu-24.04 images.
Rebuilding with rustc 1.99.1 or later should fix it. Pinning the toolchain in the release workflow would prevent a repeat.
changed the title [-]`Definition#deprecated?` returns true for plain constants on ruby-head (4.1.0dev), Linux x86_64[/-][+]`Definition#deprecated?` returns true for plain constants on x86_64 when built with rustc 1.99.0[/+]on Oct 27, 2026
Activity
bquorning commentedon Oct 27, 2026
Update: parts of this report are wrong, and I’m still investigating.
The lockfiles move
ruby-prismfrom 2.0.0-rc.2 in 0.4.2 to 2.0.0 in 0.4.3, so that bump is my main suspect for now. I’ll follow up when I know more.bquorning commentedon Oct 27, 2026
Correction: the cause is a rustc 1.99.0 miscompilation on x86_64 (rust-lang/rust#163911, fixed in 1.99.1). It isn't specific to ruby-head, and the 4.1 headers have nothing to do with it.
rdx_definition_is_deprecatedis missing theand $0x1beforeret, so it returns the rawDefinitionFlagsbyte. Constants withPROMOTABLEset (e.g.X = 'x'.freeze) then reportdeprecated? == true.readelf -p .comment librubydex_sys.soshows this.Rebuilding with rustc 1.99.1 or later should fix it. Pinning the toolchain in the release workflow would prevent a repeat.
Written with the help of Claude Code.
[-]`Definition#deprecated?` returns true for plain constants on ruby-head (4.1.0dev), Linux x86_64[/-][+]`Definition#deprecated?` returns true for plain constants on x86_64 when built with rustc 1.99.0[/+]Avoid rubydex v0.4.3