-
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
remove the into_vec method from &[T] #17916
Comments
Looks like priority_queue.rs:
I'll try to do this. |
@JIghtuse I think you're looking at the wrong method ( The |
Ah, I see. Thanks for the explanation, @aturon! So, simply saying, I need to remove |
@JIghtuse Please leave (We can remove the You'll need to write |
@aturon, ah, yep. I already see problems with removing into_vec now. At least libgraphviz will be broken. Thanks again! |
@JIghtuse No problem! Once you mark it deprecated, you should go ahead and update uses within the rust distribution to use |
I don't know if change in |
Ah, it was my change to fix #14416. My fault. Rerun check now. |
Using Is there anything in the standard lib that replaces this for |
@BurntSushi The For now, probably best to define your own trait. Thanks for the heads-up about the use case! |
@aturon I had read your collections reform RFC and I largely think it to be beautiful. :-) I believe you're right that |
fix: Wrong BoundVar index when lowering impl trait parameter of parent generics Fixes rust-lang#17711 From the following test code; ```rust //- minicore: deref use core::ops::Deref; struct Struct<'a, T>(&'a T); trait Trait {} impl<'a, T: Deref<Target = impl Trait>> Struct<'a, T> { fn foo(&self) -> &Self { self } fn bar(&self) { let _ = self.foo(); } } ``` when we call `register_obligations_for_call` for `let _ = self.foo();`, https://github.com/rust-lang/rust-analyzer/blob/07659783fdfd4ec0a0bffa93017e33e31e567e42/crates/hir-ty/src/infer/expr.rs#L1939-L1952 we are querying `generic_predicates` and it has `T: Deref<Target = impl Trait>` predicate from the parent `impl Struct`; https://github.com/rust-lang/rust-analyzer/blob/07659783fdfd4ec0a0bffa93017e33e31e567e42/crates/hir-ty/src/lower.rs#L375-L399 but as we can see above, lowering `TypeRef = impl Trait` doesn't take into account the parent generic parameters, so the `BoundVar` index here is `0`, as `fn foo` has no generic args other than parent's, But this `BoundVar` is pointing at `'a` in `<'a, T: Deref<Target = impl Trait>>`. So, in the first code reference `register_obligations_for_call`'s L:1948 - `.substitute(Interner, parameters)`, we are substituting `'a` with `Ty`, not `Lifetime` and this makes panic inside the chalk. This PR fixes this wrong `BoundVar` index in such cases
The corresponding method is deprecated on
Vec<T>
and always does the same thing asto_vec
on slices. There's no reason to keep this around.The text was updated successfully, but these errors were encountered: