-
Notifications
You must be signed in to change notification settings - Fork 257
'No span found for use glob' panic in projects using actix-net, rocket #1117
Comments
Tried with
same as #1107. Snippet from the STR repo: use actix_web;
fn main() {
println!("Hello, world!");
} @nrc the most recent code that seems to have touched this is rust-lang/rust@c2bb7ca (part of rust-lang/rust#54145).
|
Feel free to close it as a duplicate. FWIW Rust 2015 crate with actix fails the same way. |
That's because rls disguises itself as |
It seems that the SA chokes on proc-macro output (happened also with a simple Rocket project from #1107). Using a helper debug patch for Rust: diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs
index 9bc3fbe7c2..7b84afb65e 100644
--- a/src/librustc_save_analysis/dump_visitor.rs
+++ b/src/librustc_save_analysis/dump_visitor.rs
@@ -1257,8 +1257,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
let sub_span =
self.span.sub_span_of_token(use_tree.span, token::BinOp(token::Star));
if !self.span.filter_generated(use_tree.span) {
- let span =
- self.span_from_span(sub_span.expect("No span found for use glob"));
+ let span = self.span_from_span(match sub_span {
+ Some(sp) => sp,
+ None => {
+ self.tcx.sess.span_warn(use_tree.span, "Error calculating sub_span_of_token for this `use_tree.span`");
+ return;
+ }
+ });
self.dumper.import(&access, Import {
kind: ImportKind::GlobUse,
ref_id: None,
For actix-net 0.1.1 I got:
mod _impl_act_pauseserver {
use super::*;
extern crate actix;
impl actix::Message for PauseServer {
type
Result
=
();
}
} EDIT: And for pear_codegen 0.20 (failing crate from #1107, switched to errors):
{
use syntax::ext::quote::rt::*;
let ext_cx = &*ecx;
::syntax::ext::quote::parse_expr_panic(&mut new_parser_from_tts(ext_cx.parse_sess(),
::syntax::ext::quote::unflatten({
let _sp =
ext_cx.call_site();
let mut tt =
::std::vec::Vec::new();
tt.push(::syntax::tokenstream::TokenTree::Token(_sp,
::syntax::parse::token::OpenDelim(::syntax::parse::token::Paren)));
tt.push(::syntax::tokenstream::TokenTree::Token(_sp,
::syntax::parse::token::CloseDelim(::syntax::parse::token::Paren)));
tt
})))
} |
This should be fixed by rust-lang/rust#55879 |
save-analysis: Don't panic for macro-generated use globs Follow-up to rust-lang@c2bb7ca - as before, ignore the use globs in macro expansions. Fixes rust-lang/rls#1117. Closes rust-lang#55480. r? @nrc
save-analysis: Don't panic for macro-generated use globs Follow-up to rust-lang@c2bb7ca - as before, ignore the use globs in macro expansions. Fixes rust-lang/rls#1117. Closes rust-lang#55480. r? @nrc
Still broken on I am not able to reopen this.
|
@norru you have to wait for fixed nightly, it was only merged today so the next nightly should be fine. |
The bug was marked closed. This should happen when the fix is released :) |
update last day nightly version vscode rework for me |
@motecshine are you building RLS from source? Because for me |
@norru update with rustup
|
That's
|
same version, I think you should delete projects/targets dir, and reopen vscode |
Did try that before, no luck. I'll double check to be sure. |
In fact, a full update and full build after a a
|
VSCode error:
Following repository fails to build in VSCode/Atom but
cargo check
andcargo build
work fine: https://github.com/mati865/rls_errorThe text was updated successfully, but these errors were encountered: