We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
deref
E0308
Playground link (compiles): https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=70ffd01d215fbd49e02bc06970779e2b
Error in rust-analyzer:
expected &HandleScope<'static, u32>, found &CallbackScope<'static, {unknown}>"
This was working previously and seems to have broken recently. It appears that a compilation of:
contribute to a spurious E0308 error that appears in rust-analyzer but not in rust itself, nor any other tools that compile Rust.
rust-analyzer
This code was reduced from errors appearing in rusty_v8:
rusty_v8
use std::{marker::PhantomData, ops::Deref}; #[derive(Default)] pub struct HandleScope<'s, C = u32> { _p: Option<&'s PhantomData<C>> } #[derive(Default)] pub struct CallbackScope<'s, C = u32> { _p: Option<&'s PhantomData<C>> } impl <'s> CallbackScope<'s> { pub fn new() -> CallbackScope<'s> { Self::default() } } impl <'s> Deref for CallbackScope<'s> { type Target = HandleScope<'s>; fn deref(&self) -> &Self::Target { unsafe { std::mem::transmute(self) } } } impl <'s> Deref for CallbackScope<'s, ()> { type Target = HandleScope<'s, ()>; fn deref(&self) -> &Self::Target { unsafe { std::mem::transmute(self) } } } fn y(_: &HandleScope) {} #[test] pub fn test_deref() { let scope = &CallbackScope::new(); y(scope); // "expected &HandleScope<'static, u32>, found &CallbackScope<'static, {unknown}>" }
The text was updated successfully, but these errors were encountered:
Probably due to the lifetime var changes, we seem to struggle with generic param defaults now
Sorry, something went wrong.
Related to #17066
Itertools::collect_tuple
No branches or pull requests
Playground link (compiles): https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=70ffd01d215fbd49e02bc06970779e2b
Error in rust-analyzer:
expected &HandleScope<'static, u32>, found &CallbackScope<'static, {unknown}>"
This was working previously and seems to have broken recently. It appears that a compilation of:
contribute to a spurious
E0308
error that appears inrust-analyzer
but not in rust itself, nor any other tools that compile Rust.This code was reduced from errors appearing in
rusty_v8
:The text was updated successfully, but these errors were encountered: