Unverified Commit 13af7b57 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

Turbopack: remove dead code (#79280)

- `IncludeIdentModule` is unused (and incompatible with the ModuleGraph anyway)
- Cleanup some `todo!()`s
parent 1bc1326d
......@@ -140,8 +140,9 @@ impl Introspectable for StaticAssetsContentSource {
.to_resolved()
.await?,
),
DirectoryEntry::Other(_) => todo!("what's DirectoryContent::Other?"),
DirectoryEntry::Error => todo!(),
DirectoryEntry::Other(_) | DirectoryEntry::Error => {
todo!("unsupported DirectoryContent variant: {entry:?}")
}
};
Ok((ResolvedVc::cell(name.clone()), child))
}
......
......@@ -76,7 +76,7 @@ impl Module for AsyncLoaderModule {
impl Asset for AsyncLoaderModule {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
todo!()
panic!("content() should not be called");
}
}
......
......@@ -152,7 +152,7 @@ impl Module for ManifestAsyncModule {
impl Asset for ManifestAsyncModule {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
todo!()
panic!("content() should not be called");
}
}
......
......@@ -268,35 +268,3 @@ impl EcmascriptChunkItem for CachedExternalModuleChunkItem {
)
}
}
/// A module that only has an ident and no content nor references.
///
/// It is used to include a module's ident in the module graph before the module
/// itself is resolved, as is the case with NextServerComponentModule's
/// "client modules" and "ssr modules".
#[turbo_tasks::value]
pub struct IncludeIdentModule {
ident: ResolvedVc<AssetIdent>,
}
#[turbo_tasks::value_impl]
impl IncludeIdentModule {
#[turbo_tasks::function]
pub fn new(ident: ResolvedVc<AssetIdent>) -> Vc<Self> {
Self { ident }.cell()
}
}
impl Asset for IncludeIdentModule {
fn content(self: Vc<Self>) -> Vc<AssetContent> {
todo!("IncludeIdentModule doesn't implement content()")
}
}
#[turbo_tasks::value_impl]
impl Module for IncludeIdentModule {
#[turbo_tasks::function]
fn ident(&self) -> Vc<AssetIdent> {
*self.ident
}
}
......@@ -62,7 +62,7 @@ impl Module for WorkerLoaderModule {
impl Asset for WorkerLoaderModule {
#[turbo_tasks::function]
fn content(&self) -> Vc<AssetContent> {
todo!()
panic!("content() should not be called");
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment