Skip to content

Commit ae44778

Browse files
committed
add a link to the RA bug
1 parent 87950f5 commit ae44778

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

turbopack/crates/turbo-tasks/src/trait_ref.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{fmt::Debug, future::Future, marker::PhantomData};
1+
use std::{fmt::Debug, future::Future, marker::PhantomData, ptr::DynMetadata};
22

33
use anyhow::Result;
44
use serde::{Deserialize, Serialize};
@@ -72,6 +72,9 @@ impl<'de, T> Deserialize<'de> for TraitRef<T> {
7272
}
7373
}
7474

75+
// This is a workaround for https://github.com/rust-lang/rust-analyzer/issues/19971
76+
// that ensures type inference keeps working with ptr_metadata.
77+
7578
#[cfg(rust_analyzer)]
7679
impl<U> std::ops::Deref for TraitRef<Box<U>>
7780
where
@@ -81,7 +84,7 @@ where
8184
type Target = U;
8285

8386
fn deref(&self) -> &Self::Target {
84-
unimplemented!()
87+
unimplemented!("only exists for rust-analyzer type inference")
8588
}
8689
}
8790

turbopack/crates/turbo-tasks/src/value_type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ impl ValueType {
197197
self.traits.insert(trait_type, meta);
198198
}
199199

200+
/// Composes a fat pointer from a `dyn Any` for the given trait_id
200201
pub(crate) fn as_trait_ptr<T>(
201202
&self,
202203
trait_type: TraitTypeId,

turbopack/crates/turbopack-core/src/issue/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ impl PlainIssue {
861861
};
862862
let trait_ref = issue.into_trait_ref().await?;
863863

864-
let severity = (trait_ref).severity();
864+
let severity = trait_ref.severity();
865865

866866
Ok(Self::cell(Self {
867867
severity,

0 commit comments

Comments
 (0)