-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
the trait bound &[u8]: std::convert::From<&[_; 0]>
is not satisfied
#113238
Comments
This seems to already have been fixed on the |
@hameerabbasi how did you build this? You need to build all the tests to reproduce this, too. |
This seems to have regressed in #106704. From the UI test at the bottom of that PR, it seems to suggest that we've added a new |
Seems plausible, and seems like that trait impl might be removable - though maybe a breaking change for gimli? |
This is reproducible on stable if gimli 0.27.* is pulled in at all: extern crate gimli;
fn main() {
let _ = <&[u8]>::from(&[]);
}
But now that
I didn't look into how it's used, but Reverting #106704 is going to be hard too, because the new gimli is coming from |
Hmm, actually it seems to build ok if I just downgrade to Line 26 in f06c1b8
So I guess it doesn't really need APIs of the newer version, but I don't know if we'll miss fixes or functionality. I can PR this as a release band-aid if others agree that it makes sense... |
Hm, I think some folks have been more actively poking at backtrace lately, I don't know what we'd lose by downgrading there - cc @rust-lang/crate-maintainers (broader group but hopefully reaches the right people). I guess the question is: are we comfortable downgrading addr2line as suggested by @cuviper for 1.70 (releasing next week)? |
What's the plan for the future? I don't think we want to stay on old gimli forever. Hope that gimli removes the impl in a breaking release, which we could then pull in? |
Actually, there were no API changes in addr2line 0.18 to 0.19, only the dependency changes:
That's 1.71.0.
Unknown. I can see if adding |
@Mark-Simulacrum The backtrace crate is going to need that gimli and object to be capable of later supporting AIX and also probably more recent platforms as well, as some object fixes were fixing platforms like watchOS. And it needs that gimli and addr2line to support the new DWARF formats which finally allow split debuginfo so we can maybe finally not have every Rust program be a hugely bloated binary on Linux and other Unix-y platforms. Downgrading is an acceptable hotfix for stopping a regression from hitting stable, not for the long term. |
Also we're actually on addr2line 0.20 now. |
The master branch is, but I'm only thinking about beta -> 1.71.0 at the moment. We can take the next release cycle to figure out a "better" change, or else decide to make everyone eat the inference failure. |
Of course. Anyone who is building for the targets we improved support for (I mean, aside from all Split DWARF, which was part of the 0.19 to 0.20 change) is probably building on nightly anyways, no worry about that. |
FWIW, this one is actually a deref coercion, so it would need explicit |
[INFO] [stdout] error[E0283]: type annotations needed
[INFO] [stdout] --> src/program.rs:131:61
[INFO] [stdout] |
[INFO] [stdout] 131 | camera_position: <[f32; 3]>::from(self.camera.position.into()),
[INFO] [stdout] | ---------------- ^^^^
[INFO] [stdout] | |
[INFO] [stdout] | required by a bound introduced by this call
[INFO] [stdout] |
[INFO] [stdout] = note: multiple `impl`s satisfying `[f32; 3]: From<_>` found in the `core` crate:
[INFO] [stdout] - impl<T> From<!> for T;
[INFO] [stdout] - impl<T> From<(T, T, T)> for [T; 3];
[INFO] [stdout] - impl<T> From<T> for T; This one is a consequence of #97594, because |
I can't figure out what is being exposed to make this a problem: rust-lang/backtrace-rs@ef961e2 Is it really just a failure to wall off private impls in std from inference? |
Is there such a thing as a private impl? Even if these weren't Anyway, this is the gimli change in 0.27, and it was "just" a clippy appeasement: |
Anyways I think we should land the downgrade of the dep for 1.71's sake but I also think that Rust's inference algorithm resolving if there's a single possible impl but not if there's 2, and not finding another way to find the actual impl to use, is a problem. |
This general phenomenon is not new, e.g. #51916. |
Correct, I am mostly saying that it's a problem that we have merely accepted it. |
Though perhaps it was less of a problem when Clippy did not demand as many sacrifices. |
I've included a downgrade to addr2line 1.18 in 1dcfc26 (targeting beta, 1.71). |
This prevents rust-lang#113238 from hitting stable while we sort out options for avoiding it. The downgrade is expected to not affect any users on stable, since it primarily affects tier 3 targets.
Interesting that #111076 fixed similar (observing impls from private deps) issue with miniz_oxide, but not with gimli. miniz_oxide is direct dependency, while gimli indirect (addr2line->gimli). Oh, its beta, so maybe it works here too. |
This prevents rust-lang#113238 from hitting stable while we sort out options for avoiding it. The downgrade is expected to not affect any users on stable, since it primarily affects tier 3 targets.
Sorry, I wasn't aware that trait implementations can could cause this sort of problem. I'm happy to revert that change in gimli if it helps here.
gimli is part of the public API of addr2line, so an API change in gimli is an API change in addr2line. |
I'm updating the milestone so we don't forget that this still needs to be addressed in 1.72. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
Visited during T-compiler's weekly triage meeting. While this doesn't seem to be strictly under our purview, we are a bit concerned that the 1.72 release is coming up and this doesn't seem to have been mitigated in 1.72 yet. Personally, I think if gimli is willing to remove the impl and ship a new major release (and coordinate that into a new addr2line release) that seems like the best medium term option. We may already be too late in the beta release cycle for that though so perhaps backporting the addr2line downgrade to 1.72 to ensure this regression does not accidentally get released makes sense? |
This prevents rust-lang#113238 from hitting stable while we sort out options for avoiding it. The downgrade is expected to not affect any users on stable, since it primarily affects tier 3 targets.
@philipc thanks for gimli-rs/gimli#669. Are you planning to make a release? (with addr2line as well if semver bumped) We need to figure out the mitigation on 1.72-beta soon, but a downgrade to
Maybe those changes can be reverted, but I didn't try. edit: going back to |
gimli release PR is up. I'll do some testing and release gimli and addr2line tomorrow. |
Upgrading beta |
Upgrade std to gimli 0.28.0 Gimli 0.28 removed its `From<EndianSlice> for &[u8]` that was the root cause of rust-lang#113238. This dependency update mirrors rust-lang/backtrace-rs#557, but since that doesn't require any code changes in `backtrace`, we can also apply that right away for our nested `std/backtrace` feature.
impl
s satisfying[f32; 3]: From<_>
found in thecore
crateThe text was updated successfully, but these errors were encountered: