mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Update Rust toolchain to nightly-2026-04-02 (#92288)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"dependsOn": {
|
||||
"ghcr.io/devcontainers/features/rust:1": {
|
||||
// this should match the `rust-toolchain.toml`
|
||||
"version": "nightly-2026-02-18",
|
||||
"version": "nightly-2026-04-02",
|
||||
"profile": "minimal",
|
||||
"components": "rustfmt,clippy,rust-analyzer"
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(future_join)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
|
||||
@@ -201,17 +201,14 @@ impl ServerNftJsonAsset {
|
||||
// These are used by packages/next/src/server/require-hook.ts
|
||||
let shared_entries = ["styled-jsx", "styled-jsx/style", "styled-jsx/style.js"];
|
||||
|
||||
let cache_handler_entries = cache_handler
|
||||
.into_iter()
|
||||
.chain(cache_handlers.into_iter())
|
||||
.map(|f| {
|
||||
asset_context
|
||||
.process(
|
||||
Vc::upcast(FileSource::new(f.clone())),
|
||||
ReferenceType::CommonJs(CommonJsReferenceSubType::Undefined),
|
||||
)
|
||||
.module()
|
||||
});
|
||||
let cache_handler_entries = cache_handler.into_iter().chain(cache_handlers).map(|f| {
|
||||
asset_context
|
||||
.process(
|
||||
Vc::upcast(FileSource::new(f.clone())),
|
||||
ReferenceType::CommonJs(CommonJsReferenceSubType::Undefined),
|
||||
)
|
||||
.module()
|
||||
});
|
||||
|
||||
let entries = match self.ty {
|
||||
ServerNftType::Full => Either::Left(
|
||||
|
||||
@@ -102,7 +102,7 @@ pub async fn endpoint_entry_modules(
|
||||
let modules = entries
|
||||
.await?
|
||||
.into_iter()
|
||||
.chain(additional_entries.await?.into_iter())
|
||||
.chain(additional_entries.await?)
|
||||
.flat_map(|e| e.entries())
|
||||
.collect::<FxIndexSet<_>>();
|
||||
Ok(Vc::cell(modules.into_iter().collect()))
|
||||
@@ -128,7 +128,7 @@ pub async fn endpoints_entry_modules(
|
||||
.flat_map(|(entries, additional_entries)| {
|
||||
entries
|
||||
.into_iter()
|
||||
.chain(additional_entries.into_iter())
|
||||
.chain(additional_entries)
|
||||
.flat_map(|e| e.entries())
|
||||
})
|
||||
.collect::<FxIndexSet<_>>();
|
||||
@@ -245,7 +245,7 @@ impl Asset for RoutesHashesManifestAsset {
|
||||
let manifest = serde_json::to_string_pretty(&RoutesHashesManifest {
|
||||
routes: entrypoint_hashes
|
||||
.into_keys()
|
||||
.zip(entrypoint_hashes_values.into_iter())
|
||||
.zip(entrypoint_hashes_values)
|
||||
.map(|(k, (sources_hash, outputs_hash))| {
|
||||
(
|
||||
k,
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(future_join)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
|
||||
@@ -430,15 +430,14 @@ async fn get_directory_tree_internal(
|
||||
},
|
||||
));
|
||||
}
|
||||
DirectoryEntry::Directory(dir) => {
|
||||
DirectoryEntry::Directory(dir)
|
||||
// appDir ignores paths starting with an underscore
|
||||
if !basename.starts_with('_') {
|
||||
if !basename.starts_with('_') => {
|
||||
let result = get_directory_tree(dir.clone(), page_extensions)
|
||||
.to_resolved()
|
||||
.await?;
|
||||
subdirectories.insert(basename.clone(), result);
|
||||
}
|
||||
}
|
||||
// TODO(WEB-952) handle symlinks in app dir
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#![feature(str_split_remainder)]
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![feature(iter_intersperse)]
|
||||
|
||||
mod app_page_loader_tree;
|
||||
pub mod app_structure;
|
||||
|
||||
@@ -54,7 +54,7 @@ impl OutputAssetsReference for BuildManifest {
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.copied()
|
||||
.chain(root_main_files.into_iter())
|
||||
.chain(root_main_files)
|
||||
.chain(self.polyfill_files.iter().copied())
|
||||
.collect();
|
||||
|
||||
@@ -148,7 +148,7 @@ impl Asset for BuildManifest {
|
||||
.await?;
|
||||
|
||||
let manifest = SerializedBuildManifest {
|
||||
pages: FxIndexMap::from_iter(pages.into_iter()),
|
||||
pages: FxIndexMap::from_iter(pages),
|
||||
polyfill_files,
|
||||
root_main_files,
|
||||
..Default::default()
|
||||
|
||||
@@ -161,13 +161,11 @@ impl NextSegmentConfig {
|
||||
name: &str,
|
||||
) -> Result<()> {
|
||||
match (a.as_ref(), b) {
|
||||
(Some(a), Some(b)) => {
|
||||
if *a != *b {
|
||||
bail!(
|
||||
"Sibling segment configs have conflicting values for {}",
|
||||
name
|
||||
)
|
||||
}
|
||||
(Some(a), Some(b)) if *a != *b => {
|
||||
bail!(
|
||||
"Sibling segment configs have conflicting values for {}",
|
||||
name
|
||||
)
|
||||
}
|
||||
(None, Some(b)) => {
|
||||
*a = Some(b.clone());
|
||||
|
||||
@@ -149,10 +149,10 @@ impl Visit for FontImportsGenerator<'_> {
|
||||
|
||||
fn visit_module_item(&mut self, item: &ModuleItem) {
|
||||
match item {
|
||||
ModuleItem::Stmt(Stmt::Decl(Decl::Var(var_decl))) => {
|
||||
if self.check_var_decl(var_decl).is_some() {
|
||||
self.state.removable_module_items.insert(var_decl.span.lo);
|
||||
}
|
||||
ModuleItem::Stmt(Stmt::Decl(Decl::Var(var_decl)))
|
||||
if self.check_var_decl(var_decl).is_some() =>
|
||||
{
|
||||
self.state.removable_module_items.insert(var_decl.span.lo);
|
||||
}
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(export_decl)) => {
|
||||
if let Decl::Var(var_decl) = &export_decl.decl
|
||||
|
||||
@@ -247,10 +247,8 @@ impl VisitMut for Analyzer<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
Decl::Var(d) => {
|
||||
if d.decls.is_empty() {
|
||||
*s = ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
Decl::Var(d) if d.decls.is_empty() => {
|
||||
*s = ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -544,53 +542,45 @@ impl VisitMut for NextSsg {
|
||||
|
||||
if self.in_lhs_of_var {
|
||||
match p {
|
||||
Pat::Ident(name) => {
|
||||
if self.should_remove(name.id.to_id()) {
|
||||
self.state.should_run_again = true;
|
||||
tracing::trace!(
|
||||
"Dropping var `{}{:?}` because it should be removed",
|
||||
name.id.sym,
|
||||
name.id.ctxt
|
||||
);
|
||||
Pat::Ident(name) if self.should_remove(name.id.to_id()) => {
|
||||
self.state.should_run_again = true;
|
||||
tracing::trace!(
|
||||
"Dropping var `{}{:?}` because it should be removed",
|
||||
name.id.sym,
|
||||
name.id.ctxt
|
||||
);
|
||||
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Array(arr) if !arr.elems.is_empty() => {
|
||||
arr.elems.retain(|e| !matches!(e, Some(Pat::Invalid(..))));
|
||||
|
||||
if arr.elems.is_empty() {
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
}
|
||||
Pat::Array(arr) => {
|
||||
if !arr.elems.is_empty() {
|
||||
arr.elems.retain(|e| !matches!(e, Some(Pat::Invalid(..))));
|
||||
Pat::Object(obj) if !obj.props.is_empty() => {
|
||||
obj.props.retain_mut(|prop| match prop {
|
||||
ObjectPatProp::KeyValue(prop) => !prop.value.is_invalid(),
|
||||
ObjectPatProp::Assign(prop) => {
|
||||
if self.should_remove(prop.key.to_id()) {
|
||||
self.mark_as_candidate(&mut prop.value);
|
||||
|
||||
if arr.elems.is_empty() {
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
}
|
||||
}
|
||||
Pat::Object(obj) => {
|
||||
if !obj.props.is_empty() {
|
||||
obj.props.retain_mut(|prop| match prop {
|
||||
ObjectPatProp::KeyValue(prop) => !prop.value.is_invalid(),
|
||||
ObjectPatProp::Assign(prop) => {
|
||||
if self.should_remove(prop.key.to_id()) {
|
||||
self.mark_as_candidate(&mut prop.value);
|
||||
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
false
|
||||
} else {
|
||||
true
|
||||
}
|
||||
ObjectPatProp::Rest(prop) => !prop.arg.is_invalid(),
|
||||
});
|
||||
|
||||
if obj.props.is_empty() {
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
}
|
||||
}
|
||||
Pat::Rest(rest) => {
|
||||
if rest.arg.is_invalid() {
|
||||
ObjectPatProp::Rest(prop) => !prop.arg.is_invalid(),
|
||||
});
|
||||
|
||||
if obj.props.is_empty() {
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
}
|
||||
Pat::Rest(rest) if rest.arg.is_invalid() => {
|
||||
*p = Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -950,31 +950,29 @@ impl ReactServerComponentValidator {
|
||||
}
|
||||
}
|
||||
"dynamicParams" | "dynamic" | "fetchCache" | "revalidate"
|
||||
| "experimental_ppr" => {
|
||||
if self.cache_components_enabled {
|
||||
possibly_invalid_exports.insert(
|
||||
export_name.clone(),
|
||||
(
|
||||
InvalidExportKind::RouteSegmentConfig(
|
||||
NextConfigProperty::CacheComponents,
|
||||
),
|
||||
*span,
|
||||
| "experimental_ppr"
|
||||
if self.cache_components_enabled =>
|
||||
{
|
||||
possibly_invalid_exports.insert(
|
||||
export_name.clone(),
|
||||
(
|
||||
InvalidExportKind::RouteSegmentConfig(
|
||||
NextConfigProperty::CacheComponents,
|
||||
),
|
||||
);
|
||||
}
|
||||
*span,
|
||||
),
|
||||
);
|
||||
}
|
||||
"unstable_instant" => {
|
||||
if !self.cache_components_enabled {
|
||||
possibly_invalid_exports.insert(
|
||||
export_name.clone(),
|
||||
(
|
||||
InvalidExportKind::RequiresRouteSegmentConfig(
|
||||
NextConfigProperty::CacheComponents,
|
||||
),
|
||||
*span,
|
||||
"unstable_instant" if !self.cache_components_enabled => {
|
||||
possibly_invalid_exports.insert(
|
||||
export_name.clone(),
|
||||
(
|
||||
InvalidExportKind::RequiresRouteSegmentConfig(
|
||||
NextConfigProperty::CacheComponents,
|
||||
),
|
||||
);
|
||||
}
|
||||
*span,
|
||||
),
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
};
|
||||
|
||||
@@ -1818,34 +1818,34 @@ impl<C: Comments> VisitMut for ServerActions<C> {
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(named_export)) => {
|
||||
if named_export.src.is_none() {
|
||||
for spec in &named_export.specifiers {
|
||||
match spec {
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(orig),
|
||||
exported: Some(exported),
|
||||
is_type_only: false,
|
||||
..
|
||||
}) => {
|
||||
// export { foo as bar } or export { foo as "📙" }
|
||||
self.export_name_by_local_id
|
||||
.insert(orig.to_id(), exported.clone());
|
||||
}
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(orig),
|
||||
exported: None,
|
||||
is_type_only: false,
|
||||
..
|
||||
}) => {
|
||||
// export { foo }
|
||||
self.export_name_by_local_id.insert(
|
||||
orig.to_id(),
|
||||
ModuleExportName::Ident(orig.clone()),
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(named_export))
|
||||
if named_export.src.is_none() =>
|
||||
{
|
||||
for spec in &named_export.specifiers {
|
||||
match spec {
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(orig),
|
||||
exported: Some(exported),
|
||||
is_type_only: false,
|
||||
..
|
||||
}) => {
|
||||
// export { foo as bar } or export { foo as "📙" }
|
||||
self.export_name_by_local_id
|
||||
.insert(orig.to_id(), exported.clone());
|
||||
}
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(orig),
|
||||
exported: None,
|
||||
is_type_only: false,
|
||||
..
|
||||
}) => {
|
||||
// export { foo }
|
||||
self.export_name_by_local_id.insert(
|
||||
orig.to_id(),
|
||||
ModuleExportName::Ident(orig.clone()),
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1955,14 +1955,13 @@ impl<C: Comments> VisitMut for ServerActions<C> {
|
||||
}
|
||||
}
|
||||
}
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(named)) => {
|
||||
if !named.type_only {
|
||||
if let Some(src) = &named.src {
|
||||
// export { x } from './module'
|
||||
if in_cache_file {
|
||||
// Transform re-exports into imports so we can wrap them with
|
||||
// cache runtime wrappers.
|
||||
let import_specs: Vec<ImportSpecifier> = named
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportNamed(named)) if !named.type_only => {
|
||||
if let Some(src) = &named.src {
|
||||
// export { x } from './module'
|
||||
if in_cache_file {
|
||||
// Transform re-exports into imports so we can wrap them with
|
||||
// cache runtime wrappers.
|
||||
let import_specs: Vec<ImportSpecifier> = named
|
||||
.specifiers
|
||||
.iter()
|
||||
.filter_map(|spec| {
|
||||
@@ -2002,68 +2001,65 @@ impl<C: Comments> VisitMut for ServerActions<C> {
|
||||
})
|
||||
.collect();
|
||||
|
||||
if !import_specs.is_empty() {
|
||||
// Add import statement.
|
||||
self.extra_items.push(ModuleItem::ModuleDecl(
|
||||
ModuleDecl::Import(ImportDecl {
|
||||
span: named.span,
|
||||
specifiers: import_specs,
|
||||
src: src.clone(),
|
||||
type_only: false,
|
||||
with: named.with.clone(),
|
||||
phase: Default::default(),
|
||||
}),
|
||||
));
|
||||
}
|
||||
if !import_specs.is_empty() {
|
||||
// Add import statement.
|
||||
self.extra_items.push(ModuleItem::ModuleDecl(
|
||||
ModuleDecl::Import(ImportDecl {
|
||||
span: named.span,
|
||||
specifiers: import_specs,
|
||||
src: src.clone(),
|
||||
type_only: false,
|
||||
with: named.with.clone(),
|
||||
phase: Default::default(),
|
||||
}),
|
||||
));
|
||||
}
|
||||
|
||||
// Remove value specifiers from the export statement, keeping
|
||||
// only type-only specifiers.
|
||||
named.specifiers.retain(|spec| {
|
||||
matches!(
|
||||
spec,
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
is_type_only: true,
|
||||
..
|
||||
})
|
||||
)
|
||||
});
|
||||
// Remove value specifiers from the export statement, keeping
|
||||
// only type-only specifiers.
|
||||
named.specifiers.retain(|spec| {
|
||||
matches!(
|
||||
spec,
|
||||
ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
is_type_only: true,
|
||||
..
|
||||
})
|
||||
)
|
||||
});
|
||||
|
||||
// If all specifiers were value specifiers (converted to
|
||||
// imports), remove the entire statement.
|
||||
if named.specifiers.is_empty() {
|
||||
should_remove_statement = true;
|
||||
}
|
||||
} else if named.specifiers.iter().any(|s| match s {
|
||||
ExportSpecifier::Namespace(_) | ExportSpecifier::Default(_) => {
|
||||
// If all specifiers were value specifiers (converted to
|
||||
// imports), remove the entire statement.
|
||||
if named.specifiers.is_empty() {
|
||||
should_remove_statement = true;
|
||||
}
|
||||
} else if named.specifiers.iter().any(|s| match s {
|
||||
ExportSpecifier::Namespace(_) | ExportSpecifier::Default(_) => true,
|
||||
ExportSpecifier::Named(s) => !s.is_type_only,
|
||||
}) {
|
||||
disallowed_export_span = named.span;
|
||||
}
|
||||
} else {
|
||||
// For cache files, remove specifiers that need cache runtime
|
||||
// wrappers. Keep type-only specifiers and value specifiers that
|
||||
// don't need wrappers (like function declarations).
|
||||
if in_cache_file {
|
||||
named.specifiers.retain(|spec| {
|
||||
if let ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(ident),
|
||||
is_type_only: false,
|
||||
..
|
||||
}) = spec
|
||||
{
|
||||
!self
|
||||
.local_ids_that_need_cache_runtime_wrapper_if_exported
|
||||
.contains(&ident.to_id())
|
||||
} else {
|
||||
true
|
||||
}
|
||||
ExportSpecifier::Named(s) => !s.is_type_only,
|
||||
}) {
|
||||
disallowed_export_span = named.span;
|
||||
}
|
||||
} else {
|
||||
// For cache files, remove specifiers that need cache runtime
|
||||
// wrappers. Keep type-only specifiers and value specifiers that
|
||||
// don't need wrappers (like function declarations).
|
||||
if in_cache_file {
|
||||
named.specifiers.retain(|spec| {
|
||||
if let ExportSpecifier::Named(ExportNamedSpecifier {
|
||||
orig: ModuleExportName::Ident(ident),
|
||||
is_type_only: false,
|
||||
..
|
||||
}) = spec
|
||||
{
|
||||
!self
|
||||
.local_ids_that_need_cache_runtime_wrapper_if_exported
|
||||
.contains(&ident.to_id())
|
||||
} else {
|
||||
true
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if named.specifiers.is_empty() {
|
||||
should_remove_statement = true;
|
||||
}
|
||||
if named.specifiers.is_empty() {
|
||||
should_remove_statement = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2110,10 +2106,8 @@ impl<C: Comments> VisitMut for ServerActions<C> {
|
||||
span,
|
||||
type_only,
|
||||
..
|
||||
})) => {
|
||||
if !*type_only {
|
||||
disallowed_export_span = *span;
|
||||
}
|
||||
})) if !*type_only => {
|
||||
disallowed_export_span = *span;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
@@ -48,15 +48,11 @@ impl Fold for ExportShaker {
|
||||
|
||||
fn fold_export_decl(&mut self, mut decl: ExportDecl) -> ExportDecl {
|
||||
match &mut decl.decl {
|
||||
Decl::Fn(fn_decl) => {
|
||||
if !self.ignore.contains(&fn_decl.ident.sym) {
|
||||
self.remove_export = true;
|
||||
}
|
||||
Decl::Fn(fn_decl) if !self.ignore.contains(&fn_decl.ident.sym) => {
|
||||
self.remove_export = true;
|
||||
}
|
||||
Decl::Class(class_decl) => {
|
||||
if !self.ignore.contains(&class_decl.ident.sym) {
|
||||
self.remove_export = true;
|
||||
}
|
||||
Decl::Class(class_decl) if !self.ignore.contains(&class_decl.ident.sym) => {
|
||||
self.remove_export = true;
|
||||
}
|
||||
Decl::Var(var_decl) => {
|
||||
var_decl.decls = var_decl
|
||||
|
||||
@@ -657,15 +657,11 @@ impl Fold for NextSsg {
|
||||
n = n.fold_children_with(self);
|
||||
|
||||
match &n {
|
||||
AssignTargetPat::Array(arr) => {
|
||||
if arr.elems.is_empty() {
|
||||
return AssignTargetPat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
AssignTargetPat::Array(arr) if arr.elems.is_empty() => {
|
||||
return AssignTargetPat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
AssignTargetPat::Object(obj) => {
|
||||
if obj.props.is_empty() {
|
||||
return AssignTargetPat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
AssignTargetPat::Object(obj) if obj.props.is_empty() => {
|
||||
return AssignTargetPat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -803,21 +799,19 @@ impl Fold for NextSsg {
|
||||
}
|
||||
}
|
||||
|
||||
Decl::Var(d) => {
|
||||
if d.decls.is_empty() {
|
||||
return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
Decl::Var(d) if d.decls.is_empty() => {
|
||||
return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
|
||||
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(_))
|
||||
| ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(_)) => {
|
||||
if self.state.dropping_export(ExportType::Default) {
|
||||
tracing::trace!("Dropping an export specifier because it's a default export");
|
||||
| ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(_))
|
||||
if self.state.dropping_export(ExportType::Default) =>
|
||||
{
|
||||
tracing::trace!("Dropping an export specifier because it's a default export");
|
||||
|
||||
return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
return ModuleItem::Stmt(Stmt::Empty(EmptyStmt { span: DUMMY_SP }));
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
@@ -922,32 +916,24 @@ impl Fold for NextSsg {
|
||||
|
||||
if self.in_lhs_of_var {
|
||||
match &mut p {
|
||||
Pat::Ident(name) => {
|
||||
if self.should_remove(&name.id.to_id()) {
|
||||
self.state.should_run_again = true;
|
||||
tracing::trace!(
|
||||
"Dropping var `{}{:?}` because it should be removed",
|
||||
name.id.sym,
|
||||
name.id.ctxt
|
||||
);
|
||||
Pat::Ident(name) if self.should_remove(&name.id.to_id()) => {
|
||||
self.state.should_run_again = true;
|
||||
tracing::trace!(
|
||||
"Dropping var `{}{:?}` because it should be removed",
|
||||
name.id.sym,
|
||||
name.id.ctxt
|
||||
);
|
||||
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Array(arr) => {
|
||||
if arr.elems.is_empty() {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Array(arr) if arr.elems.is_empty() => {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Object(obj) => {
|
||||
if obj.props.is_empty() {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Object(obj) if obj.props.is_empty() => {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Rest(rest) => {
|
||||
if rest.arg.is_invalid() {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Rest(rest) if rest.arg.is_invalid() => {
|
||||
return Pat::Invalid(Invalid { span: DUMMY_SP });
|
||||
}
|
||||
Pat::Expr(expr) => {
|
||||
if let Expr::Member(member_expr) = &**expr
|
||||
@@ -1035,11 +1021,9 @@ impl Fold for NextSsg {
|
||||
Stmt::Decl(Decl::Var(v)) if v.decls.is_empty() => {
|
||||
return Stmt::Empty(EmptyStmt { span: DUMMY_SP });
|
||||
}
|
||||
Stmt::Expr(_) => {
|
||||
if self.remove_expression {
|
||||
self.remove_expression = false;
|
||||
return Stmt::Empty(EmptyStmt { span: DUMMY_SP });
|
||||
}
|
||||
Stmt::Expr(_) if self.remove_expression => {
|
||||
self.remove_expression = false;
|
||||
return Stmt::Empty(EmptyStmt { span: DUMMY_SP });
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# if you update this, also update `.devcontainer/rust/devcontainer-feature.json`
|
||||
# if you move the file, also update any turbo.json inputs that references it.
|
||||
[toolchain]
|
||||
channel = "nightly-2026-02-18"
|
||||
channel = "nightly-2026-04-02"
|
||||
components = ["rustfmt", "clippy", "rust-analyzer"]
|
||||
profile = "minimal"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![feature(once_cell_try)]
|
||||
#![feature(sync_unsafe_cell)]
|
||||
#![feature(iter_collect_into)]
|
||||
|
||||
mod arc_bytes;
|
||||
pub(crate) mod be;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#![feature(anonymous_lifetime_in_impl_trait)]
|
||||
#![feature(associated_type_defaults)]
|
||||
#![feature(iter_collect_into)]
|
||||
#![feature(box_patterns)]
|
||||
|
||||
mod backend;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
use std::{
|
||||
fmt::Debug,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![allow(clippy::needless_return)] // tokio macro-generated code doesn't respect this
|
||||
|
||||
use anyhow::Result;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
use anyhow::Result;
|
||||
use turbo_tasks::{TaskInput, TransientValue, Vc};
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![feature(btree_cursors)] // needed for the `InvalidatorMap` and watcher, reduces time complexity
|
||||
#![feature(io_error_more)]
|
||||
#![feature(iter_advance_by)]
|
||||
#![feature(min_specialization)]
|
||||
// if `normalize_lexically` isn't eventually stabilized, we can copy the implementation from the
|
||||
// stdlib into our source tree
|
||||
#![feature(normalize_lexically)]
|
||||
#![feature(trivial_bounds)]
|
||||
#![feature(downcast_unchecked)]
|
||||
// Junction points are used on Windows. We could use a third-party crate for this if the junction
|
||||
// API isn't eventually stabilized.
|
||||
#![cfg_attr(windows, feature(junction_point))]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#![allow(internal_features)]
|
||||
#![feature(proc_macro_diagnostic)]
|
||||
#![feature(allow_internal_unstable)]
|
||||
#![feature(box_patterns)]
|
||||
|
||||
mod assert_fields;
|
||||
mod derive;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
use criterion::{Criterion, criterion_group, criterion_main};
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
#![doc = include_str!("../README.md")]
|
||||
#![feature(trivial_bounds)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(try_trait_v2)]
|
||||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
#![feature(error_generic_member_access)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![feature(never_type)]
|
||||
#![feature(downcast_unchecked)]
|
||||
#![feature(ptr_metadata)]
|
||||
#![feature(sync_unsafe_cell)]
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(int_roundings)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(min_specialization)]
|
||||
#![feature(thread_id_value)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#![feature(future_join)]
|
||||
#![feature(min_specialization)]
|
||||
|
||||
use std::{cell::RefCell, path::Path, thread::available_parallelism, time::Instant};
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
|
||||
@@ -196,7 +196,7 @@ impl ChunkGroupResult {
|
||||
self.assets
|
||||
.await?
|
||||
.into_iter()
|
||||
.chain(self.referenced_assets.await?.into_iter())
|
||||
.chain(self.referenced_assets.await?)
|
||||
.copied()
|
||||
.map(ExpandOutputAssetsInput::Asset)
|
||||
.chain(
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#![feature(min_specialization)]
|
||||
#![feature(type_alias_impl_trait)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(map_try_insert)]
|
||||
#![feature(hash_set_entry)]
|
||||
|
||||
|
||||
@@ -483,7 +483,7 @@ pub async fn compute_chunk_group_info(graph: &ModuleGraph) -> Result<Vc<ChunkGro
|
||||
.0;
|
||||
|
||||
ChunkGroupKey::IsolatedMerged {
|
||||
parent: ChunkGroupId(*parent as u32),
|
||||
parent: ChunkGroupId(*parent),
|
||||
merge_tag,
|
||||
}
|
||||
}
|
||||
@@ -500,7 +500,7 @@ pub async fn compute_chunk_group_info(graph: &ModuleGraph) -> Result<Vc<ChunkGro
|
||||
.0;
|
||||
|
||||
ChunkGroupKey::SharedMerged {
|
||||
parent: ChunkGroupId(*parent as u32),
|
||||
parent: ChunkGroupId(*parent),
|
||||
merge_tag,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ impl OutputAssetsWithReferenced {
|
||||
self.assets
|
||||
.await?
|
||||
.into_iter()
|
||||
.chain(self.referenced_assets.await?.into_iter())
|
||||
.chain(self.referenced_assets.await?)
|
||||
.map(|&asset| ExpandOutputAssetsInput::Asset(asset))
|
||||
.chain(
|
||||
self.references
|
||||
@@ -263,7 +263,7 @@ async fn get_referenced_assets(
|
||||
.assets
|
||||
.await?
|
||||
.into_iter()
|
||||
.chain(refs.referenced_assets.await?.into_iter())
|
||||
.chain(refs.referenced_assets.await?)
|
||||
.map(|&asset| ExpandOutputAssetsInput::Asset(asset))
|
||||
.chain(
|
||||
refs.references
|
||||
|
||||
@@ -1593,22 +1593,14 @@ pub async fn resolve_raw(
|
||||
path,
|
||||
)
|
||||
.await?;
|
||||
results.extend(
|
||||
collect_matches(&matches, collect_affecting_sources)
|
||||
.await?
|
||||
.into_iter(),
|
||||
);
|
||||
results.extend(collect_matches(&matches, collect_affecting_sources).await?);
|
||||
}
|
||||
|
||||
{
|
||||
let matches =
|
||||
read_matches(lookup_dir.clone(), rcstr!(""), force_in_lookup_dir, path).await?;
|
||||
|
||||
results.extend(
|
||||
collect_matches(&matches, collect_affecting_sources)
|
||||
.await?
|
||||
.into_iter(),
|
||||
);
|
||||
results.extend(collect_matches(&matches, collect_affecting_sources).await?);
|
||||
}
|
||||
|
||||
Ok(merge_results(results))
|
||||
|
||||
@@ -576,8 +576,8 @@ impl ImportMap {
|
||||
|
||||
let results = lookup_rel
|
||||
.into_iter()
|
||||
.chain(lookup_rel_parent.into_iter())
|
||||
.chain(lookup.into_iter())
|
||||
.chain(lookup_rel_parent)
|
||||
.chain(lookup)
|
||||
.map(async |result| {
|
||||
import_mapping_to_result(*result?.output.await?, lookup_path.clone(), request).await
|
||||
})
|
||||
|
||||
@@ -427,7 +427,7 @@ impl SourceMap {
|
||||
.collect::<Vec<_>>();
|
||||
let mut new_sources = Vec::with_capacity(count);
|
||||
let mut new_source_contents = Vec::with_capacity(count);
|
||||
for (source, source_content) in sources.into_iter().zip(source_contents.into_iter()) {
|
||||
for (source, source_content) in sources.into_iter().zip(source_contents) {
|
||||
let (source, source_content) =
|
||||
resolve_source(source, source_content, origin.clone()).await?;
|
||||
new_sources.push(source);
|
||||
|
||||
@@ -308,7 +308,7 @@ impl OutputAssetsReference for CssChunk {
|
||||
.copied()
|
||||
.chain(single_css_chunk.iter().copied())
|
||||
})
|
||||
.chain(source_map.into_iter())
|
||||
.chain(source_map)
|
||||
.collect(),
|
||||
),
|
||||
referenced_assets: ResolvedVc::cell(
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#![feature(min_specialization)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(int_roundings)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
#![feature(min_specialization)]
|
||||
#![feature(trait_alias)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(str_split_remainder)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
@@ -135,7 +135,7 @@ async fn expand(
|
||||
.assets
|
||||
.await?
|
||||
.into_iter()
|
||||
.chain(refs.referenced_assets.await?.into_iter());
|
||||
.chain(refs.referenced_assets.await?);
|
||||
for &asset in ref_assets {
|
||||
if assets_set.insert(asset) {
|
||||
let path = asset.path().await?;
|
||||
|
||||
@@ -347,7 +347,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
|
||||
if let Some(str) = prop.as_str() {
|
||||
match str {
|
||||
// The Array.prototype.concat method
|
||||
"concat" => {
|
||||
"concat"
|
||||
if args.iter().all(|arg| {
|
||||
matches!(
|
||||
arg,
|
||||
@@ -360,7 +360,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
|
||||
| JsValue::WellKnownFunction(_)
|
||||
| JsValue::Function(..)
|
||||
)
|
||||
}) {
|
||||
}) => {
|
||||
for arg in args {
|
||||
match arg {
|
||||
JsValue::Array {
|
||||
@@ -389,7 +389,6 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
|
||||
*value = take(obj);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// The Array.prototype.map method
|
||||
"map" => {
|
||||
if let Some(func) = args.first() {
|
||||
@@ -483,12 +482,12 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
|
||||
true
|
||||
}
|
||||
// match object literals
|
||||
JsValue::Object { parts, mutable, .. } => {
|
||||
JsValue::Object { parts, mutable, .. }
|
||||
// If the object contains any spread, we might be able to flatten that
|
||||
if parts
|
||||
.iter()
|
||||
.any(|part| matches!(part, ObjectPart::Spread(JsValue::Object { .. })))
|
||||
{
|
||||
=> {
|
||||
let old_parts = take(parts);
|
||||
for part in old_parts {
|
||||
if let ObjectPart::Spread(JsValue::Object {
|
||||
@@ -505,10 +504,7 @@ pub fn replace_builtin(value: &mut JsValue) -> bool {
|
||||
}
|
||||
value.update_total_nodes();
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
// match logical expressions like `a && b` or `a || b || c` or `a ?? b`
|
||||
// Reduce logical expressions to their final value(s)
|
||||
JsValue::Logical(_, op, parts) => {
|
||||
|
||||
@@ -3034,7 +3034,7 @@ impl JsValue {
|
||||
self.update_total_nodes();
|
||||
}
|
||||
}
|
||||
JsValue::Logical(_, op, list) => {
|
||||
JsValue::Logical(_, op, list)
|
||||
// Nested logical expressions can be normalized: e. g. `a && (b && c)` => `a &&
|
||||
// b && c`
|
||||
if list.iter().any(|v| {
|
||||
@@ -3043,7 +3043,7 @@ impl JsValue {
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}) {
|
||||
}) => {
|
||||
// Taking the old list and constructing a new merged list
|
||||
for mut v in take(list).into_iter() {
|
||||
if let JsValue::Logical(_, inner_op, inner_list) = &mut v {
|
||||
@@ -3058,7 +3058,6 @@ impl JsValue {
|
||||
}
|
||||
self.update_total_nodes();
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -751,17 +751,14 @@ impl<'a> Visit for SideEffectVisitor<'a> {
|
||||
Expr::Yield(e) => {
|
||||
e.arg.visit_with(self);
|
||||
}
|
||||
Expr::TaggedTpl(tagged_tpl) => {
|
||||
Expr::TaggedTpl(tagged_tpl)
|
||||
// Tagged template literals are function calls
|
||||
// But some are known to be pure, like String.raw
|
||||
if self.is_known_pure_builtin_function(&tagged_tpl.tag) {
|
||||
if self.is_known_pure_builtin_function(&tagged_tpl.tag) => {
|
||||
for arg in &tagged_tpl.tpl.exprs {
|
||||
arg.visit_with(self);
|
||||
}
|
||||
} else {
|
||||
self.mark_side_effect();
|
||||
}
|
||||
}
|
||||
Expr::OptChain(opt_chain) => {
|
||||
// Optional chaining can be pure if it's just member access
|
||||
// But if it's an optional call, it has side effects
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(int_roundings)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
#![recursion_limit = "256"]
|
||||
@@ -1001,9 +1000,9 @@ impl EcmascriptModuleContentOptions {
|
||||
anyhow::Ok(
|
||||
part_code_gens
|
||||
.into_iter()
|
||||
.chain(esm_code_gens.into_iter())
|
||||
.chain(esm_code_gens)
|
||||
.chain(additional_code_gens.into_iter().flatten())
|
||||
.chain(code_gens.into_iter())
|
||||
.chain(code_gens)
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#![feature(future_join)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
pub mod nft;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(future_join)]
|
||||
#![feature(min_specialization)]
|
||||
|
||||
use std::env::current_dir;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
|
||||
@@ -315,8 +315,7 @@ async fn resolve_node_gyp_build_files(
|
||||
))
|
||||
})
|
||||
.try_join()
|
||||
.await?
|
||||
.into_iter(),
|
||||
.await?,
|
||||
merged_affecting_sources,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(bufreader_peek)]
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(bufreader_peek)]
|
||||
|
||||
|
||||
@@ -1,8 +1,2 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(trivial_bounds)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(map_try_insert)]
|
||||
#![feature(hash_set_entry)]
|
||||
#![recursion_limit = "256"]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#![allow(clippy::items_after_test_module)]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
mod helpers;
|
||||
use std::{path::PathBuf, sync::LazyLock};
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
#![feature(box_patterns)]
|
||||
#![feature(trivial_bounds)]
|
||||
#![feature(min_specialization)]
|
||||
#![feature(map_try_insert)]
|
||||
#![feature(hash_set_entry)]
|
||||
#![recursion_limit = "256"]
|
||||
#![feature(arbitrary_self_types)]
|
||||
#![feature(arbitrary_self_types_pointers)]
|
||||
|
||||
Reference in New Issue
Block a user