-
Notifications
You must be signed in to change notification settings - Fork 255
gstreamer fails to build with RLS #1390
Comments
I can reproduce the same issue from the command-line
|
Here is a link to the line causing the error https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/blob/e0c0c7d4172ef401c4e2c96405cf4d8d139a7334/gstreamer/src/tags.rs#L830 |
I can confirm the error with:
Interestingly enough, the RLS rustc shim seems to be at fault here somehow (:man_shrugging: )
exits with the aforementioned message and exit code 130, meanwhile regular rustc call: (only executable and
succeeds. I'll poke around and see if I can fix this |
Same issue here with $ rls --version
rls-preview 1.33.0 (9f3c906 2019-01-20)
$ rustc --version
rustc 1.33.0 (2aa4c46cf 2019-02-28) @Xanewok did you find out anything? I've created a matching bug report over at the gstreamer-rs repo: https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/194 |
I'm having the same error with one of my own crates. Reduced the code down to an small test case. trait Test<'a> {
type Thing: Test2;
}
trait Test2 {
fn print();
}
#[allow(unused)]
fn example<T>(t: T)
where T: for<'a> Test<'a>
{
T::Thing::print();
} |
Sorry it took so long, managed to come back to this issue today. Hopefully I found the culprit; the issue seems to be in the save-analysis lib in the Rust compiler. Things seem to work as expected with the fix applied, so - fingers crossed 🤞 |
save-analysis: Pull associated type definition using `qpath_def` Closes rust-lang/rls#1390 This (probably?) fixes the case where we run the save-analysis code on the following snippet: ```rust trait Test<'a> { type Thing: Test2; } trait Test2 { fn print(); } #[allow(unused)] fn example<T>(t: T) where T: for<'a> Test<'a> { T::Thing::print(); //~ ERROR cannot extract an associated type from a higher-ranked trait bound in this context // ^ only errors in save-analysis mode } ``` The chain is as follows: - culprit is `hir_ty_to_ty` - which calls `ast_ty_to_ty` in the `ItemCtxt` - which calls `associated_path_to_ty` - which finally fails on `projected_ty_from_poly_trait_ref` https://github.com/rust-lang/rust/blob/3de0106789468b211bcc3a25c09c0cf07119186d/src/librustc_typeck/collect.rs#L212-L224 I'm not exactly sure why `hir_ty_to_ty` fails - is it because it needs more setup from typeck to work correctly? I'm guessing the fix is okay since we just pull the already typeck'd data (we run save-analysis after all the analysis passes are complete) from the tables. With this change we can 'go to def' on all segments in the `T::Thing::print()` path.
Is there a chance of this being backported to 1.34, in e.g. 1.34.1? |
@Xanewok Any idea when this will hit stable? |
Hi. I'm having a problem with the gstreamer crate. Adding it to my dependencies causes the RLS to emit build errors, while the regular
cargo build
from the command line works fine.This happens even without any code of mine (simple demo).
The error in the Visual Studio Code console (formatted):
This is the line the error reports, but the level of Rust I feel like is necessary to understand the error is a little beyond me.
I'm sorry if this is a user error, I'm still fairly new to Rust in general.
The text was updated successfully, but these errors were encountered: