-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Regression: source code location is bad in nightly (doctests) #134532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@xmppftw can you provide a way for us to reproduce this issue (code and command line instructions) so we can more easily bisect where this was introduced? Thanks! |
I tried make small repro case but failed very bad (did not trigger same bug). Best i have is xso repo. I made new branch for this:
From there (commit e8ed28feb2962344cffc1a95fee3bf8a103f8b79):
|
@xmppftw thanks for the git repository. I've tried your instructions and in both cases (stable and nightly) the error message is:
which doesn't match the output in your report. Am I missing anything? |
So sorry for ocnfusion. It's in xso crate and you cannot compile all workspace with I have new repro looks like same bug on same repo:
Nightly
But in fact in stable same thing is produced so it looks like it's not same bug:
|
I've tried bisecting without a reduced sample of the report. searched nightlies: from nightly-2024-10-01 to nightly-2024-12-22 The bisection point to the rollup merge 4add5e4, namely #132210 as the point where this behaviour started. A minimal reduction would still be welcome, though @rustbot label +E-needs-mcve -S-needs-repro |
I don't think we can easily fix this. It's caused by a single span being used for two purposes:
Changing the relative path resolution was a breaking change, which is why 132210 exists. Changing the error reporting without changing the relative path resolution would require threading a second span through the compiler, which would add a lot of overhead and complexity for a pretty narrow corner case. |
Code
I tried this code in xso/src/from_xml_doc.md :
Example without codec
(i commented extern crate alloc but in start it was just not there)
I expected to see this happen: reporting error produced in xso/src/from_xml_doc.md line ~600
Instead, this happened: reported error produced in xso/src/lib.rs line ~600 (does not exist)
Version it worked on
Works on stable:
Version with regression
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: