Unverified Commit 19006f01 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

Revert "Upgrade rustc to nightly-2026-05-15 (#94021)"

This reverts commit 55b2d3c7.
parent 01c9cbfe
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"dependsOn": { "dependsOn": {
"ghcr.io/devcontainers/features/rust:1": { "ghcr.io/devcontainers/features/rust:1": {
// this should match the `rust-toolchain.toml` // this should match the `rust-toolchain.toml`
"version": "nightly-2026-05-15", "version": "nightly-2026-04-02",
"profile": "minimal", "profile": "minimal",
"components": "rustfmt,clippy,rust-analyzer" "components": "rustfmt,clippy,rust-analyzer"
} }
......
...@@ -1587,7 +1587,7 @@ impl AppEndpoint { ...@@ -1587,7 +1587,7 @@ impl AppEndpoint {
client_relative_path.clone(), client_relative_path.clone(),
node_root.join(&format!( node_root.join(&format!(
"server/app{}/react-loadable-manifest", "server/app{}/react-loadable-manifest",
app_entry.original_name &app_entry.original_name
))?, ))?,
NextRuntime::Edge, NextRuntime::Edge,
) )
...@@ -1711,7 +1711,7 @@ impl AppEndpoint { ...@@ -1711,7 +1711,7 @@ impl AppEndpoint {
client_relative_path.clone(), client_relative_path.clone(),
node_root.join(&format!( node_root.join(&format!(
"server/app{}/react-loadable-manifest", "server/app{}/react-loadable-manifest",
app_entry.original_name &app_entry.original_name
))?, ))?,
NextRuntime::NodeJs, NextRuntime::NodeJs,
) )
......
...@@ -90,7 +90,7 @@ pub(super) async fn get_font_fallback( ...@@ -90,7 +90,7 @@ pub(super) async fn get_font_fallback(
title: StyledString::Text( title: StyledString::Text(
format!( format!(
"Failed to find font override values for font `{}`", "Failed to find font override values for font `{}`",
options.font_family, &options.font_family,
) )
.into(), .into(),
) )
......
...@@ -441,7 +441,7 @@ impl ImportMappingReplacement for NextFontGoogleFontFileReplacer { ...@@ -441,7 +441,7 @@ impl ImportMappingReplacement for NextFontGoogleFontFileReplacer {
} = font_file_options_from_query_map(query)?; } = font_file_options_from_query_map(query)?;
let (filename, ext) = split_extension(&url); let (filename, ext) = split_extension(&url);
let ext = ext.with_context(|| format!("font url {} is missing an extension", url))?; let ext = ext.with_context(|| format!("font url {} is missing an extension", &url))?;
// remove dashes and dots as they might be used for the markers below. // remove dashes and dots as they might be used for the markers below.
let mut name = format!("{:016x}", hash_xxh3_hash64(filename.as_bytes())); let mut name = format!("{:016x}", hash_xxh3_hash64(filename.as_bytes()));
...@@ -506,7 +506,7 @@ async fn update_google_stylesheet( ...@@ -506,7 +506,7 @@ async fn update_google_stylesheet(
// Update font-family definitions to the scoped name // Update font-family definitions to the scoped name
// TODO: Do this more resiliently, e.g. transforming an swc ast // TODO: Do this more resiliently, e.g. transforming an swc ast
let mut stylesheet = stylesheet.await?.replace( let mut stylesheet = stylesheet.await?.replace(
&format!("font-family: '{}';", options.font_family), &format!("font-family: '{}';", &options.font_family),
&format!("font-family: '{scoped_font_family}';"), &format!("font-family: '{scoped_font_family}';"),
); );
......
...@@ -111,7 +111,7 @@ async fn get_font_adjustment( ...@@ -111,7 +111,7 @@ async fn get_font_adjustment(
let mut font = Font::new(scope.read::<FontData>()?.table_provider(0)?)?.with_context(|| { let mut font = Font::new(scope.read::<FontData>()?.table_provider(0)?)?.with_context(|| {
format!( format!(
"Unable to read font metrics from font file at {}", "Unable to read font metrics from font file at {}",
main_descriptor.path, &main_descriptor.path,
) )
})?; })?;
...@@ -121,7 +121,7 @@ async fn get_font_adjustment( ...@@ -121,7 +121,7 @@ async fn get_font_adjustment(
.with_context(|| { .with_context(|| {
format!( format!(
"Unable to read font scale from font file at {}", "Unable to read font scale from font file at {}",
main_descriptor.path &main_descriptor.path
) )
})? })?
.units_per_em as f64; .units_per_em as f64;
......
...@@ -222,7 +222,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin { ...@@ -222,7 +222,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin {
} = font_file_options_from_query_map(query)?; } = font_file_options_from_query_map(query)?;
let (filename, ext) = split_extension(&path); let (filename, ext) = split_extension(&path);
let ext = ext.with_context(|| format!("font {} needs an extension", path))?; let ext = ext.with_context(|| format!("font {} needs an extension", &path))?;
// remove dashes and dots as they might be used for the markers below. // remove dashes and dots as they might be used for the markers below.
let mut name = filename.replace(['-', '.'], "_"); let mut name = filename.replace(['-', '.'], "_");
......
...@@ -565,11 +565,17 @@ fn collect_module_info( ...@@ -565,11 +565,17 @@ fn collect_module_info(
} }
finished_directives = true; finished_directives = true;
} }
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl { .. })) => { ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl {
decl: _,
..
})) => {
export_names.push(atom!("default")); export_names.push(atom!("default"));
finished_directives = true; finished_directives = true;
} }
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { .. })) => { ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(ExportDefaultExpr {
expr: _,
..
})) => {
export_names.push(atom!("default")); export_names.push(atom!("default"));
finished_directives = true; finished_directives = true;
} }
......
...@@ -395,7 +395,7 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) { ...@@ -395,7 +395,7 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
.unwrap_or_else(|_| panic!("Failed to open {}", PANIC_LOG.to_string_lossy())); .unwrap_or_else(|_| panic!("Failed to open {}", PANIC_LOG.to_string_lossy()));
let internal_error_str: String = PrettyPrintError(internal_error).to_string(); let internal_error_str: String = PrettyPrintError(internal_error).to_string();
writeln!(log_file, "{}\n{}", LOG_DIVIDER, internal_error_str).unwrap(); writeln!(log_file, "{}\n{}", LOG_DIVIDER, &internal_error_str).unwrap();
let title = format!( let title = format!(
"Turbopack Error: {}", "Turbopack Error: {}",
...@@ -408,10 +408,10 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) { ...@@ -408,10 +408,10 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
); );
let bug_report_url = format!( let bug_report_url = format!(
"https://bugs.nextjs.org/search?category=turbopack-error-report&title={}&body={}&labels=Turbopack,Turbopack%20Panic%20Backtrace", "https://bugs.nextjs.org/search?category=turbopack-error-report&title={}&body={}&labels=Turbopack,Turbopack%20Panic%20Backtrace",
urlencoding::encode(&title), &urlencoding::encode(&title),
urlencoding::encode(&format!( &urlencoding::encode(&format!(
"{}\n\nError message:\n```\n{}\n```", "{}\n\nError message:\n```\n{}\n```",
version_str, internal_error_str &version_str, &internal_error_str
)) ))
); );
let bug_report_message = if supports_hyperlinks::supports_hyperlinks() { let bug_report_message = if supports_hyperlinks::supports_hyperlinks() {
...@@ -425,6 +425,6 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) { ...@@ -425,6 +425,6 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
{}.\n\nTo help make Turbopack better, report this error by {}\n-----\n", {}.\n\nTo help make Turbopack better, report this error by {}\n-----\n",
"FATAL".red().bold(), "FATAL".red().bold(),
PANIC_LOG.to_string_lossy(), PANIC_LOG.to_string_lossy(),
bug_report_message &bug_report_message
); );
} }
# if you update this, also update `.devcontainer/rust/devcontainer-feature.json` # 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. # if you move the file, also update any turbo.json inputs that references it.
[toolchain] [toolchain]
channel = "nightly-2026-05-15" channel = "nightly-2026-04-02"
components = ["rustfmt", "clippy", "rust-analyzer"] components = ["rustfmt", "clippy", "rust-analyzer"]
profile = "minimal" profile = "minimal"
...@@ -547,7 +547,7 @@ impl Error for TurboTasksExecutionError { ...@@ -547,7 +547,7 @@ impl Error for TurboTasksExecutionError {
impl Display for TurboTasksExecutionError { impl Display for TurboTasksExecutionError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self { match self {
TurboTasksExecutionError::Panic(panic) => write!(f, "{}", panic), TurboTasksExecutionError::Panic(panic) => write!(f, "{}", &panic),
TurboTasksExecutionError::Error(error) => { TurboTasksExecutionError::Error(error) => {
write!(f, "{}", error.message) write!(f, "{}", error.message)
} }
......
...@@ -96,7 +96,7 @@ impl EcmascriptModuleEntry { ...@@ -96,7 +96,7 @@ impl EcmascriptModuleEntry {
Ok(EcmascriptModuleEntry { Ok(EcmascriptModuleEntry {
// Cloning a rope is cheap. // Cloning a rope is cheap.
code: code.await?.source_code().clone(), code: code.await?.source_code().clone(),
url: format!("{}?{}", chunk_path, id), url: format!("{}?{}", chunk_path, &id),
map, map,
}) })
} }
......
...@@ -130,7 +130,7 @@ impl CssChunk { ...@@ -130,7 +130,7 @@ impl CssChunk {
} }
for external_import in external_imports { for external_import in external_imports {
writeln!(code, "{}", external_import)?; writeln!(code, "{}", &external_import)?;
} }
let built = &body.build(); let built = &body.build();
......
...@@ -132,7 +132,7 @@ impl Introspectable for StaticAssetsContentSource { ...@@ -132,7 +132,7 @@ impl Introspectable for StaticAssetsContentSource {
} }
DirectoryEntry::Directory(path) => ResolvedVc::upcast( DirectoryEntry::Directory(path) => ResolvedVc::upcast(
StaticAssetsContentSource::with_prefix( StaticAssetsContentSource::with_prefix(
Vc::cell(format!("{}{name}/", prefix).into()), Vc::cell(format!("{}{name}/", &*prefix).into()),
path.clone(), path.clone(),
) )
.to_resolved() .to_resolved()
......
...@@ -98,7 +98,7 @@ pub async fn get_browser_runtime_code( ...@@ -98,7 +98,7 @@ pub async fn get_browser_runtime_code(
let asset_suffix = asset_suffix.await?; let asset_suffix = asset_suffix.await?;
let chunk_loading_global = chunk_loading_global.await?; let chunk_loading_global = chunk_loading_global.await?;
let cross_origin = *cross_origin.await?; let cross_origin = *cross_origin.await?;
let chunk_lists_global = format!("{}_CHUNK_LISTS", chunk_loading_global); let chunk_lists_global = format!("{}_CHUNK_LISTS", &*chunk_loading_global);
if *environment if *environment
.runtime_versions() .runtime_versions()
......
...@@ -1406,7 +1406,10 @@ fn extract_names_from_object_pat(pat: &Pat) -> Option<SmallVec<[RcStr; 1]>> { ...@@ -1406,7 +1406,10 @@ fn extract_names_from_object_pat(pat: &Pat) -> Option<SmallVec<[RcStr; 1]>> {
match prop { match prop {
ObjectPatProp::KeyValue(kv) => match &kv.key { ObjectPatProp::KeyValue(kv) => match &kv.key {
PropName::Ident(ident) => names.push(ident.sym.as_str().into()), PropName::Ident(ident) => names.push(ident.sym.as_str().into()),
PropName::Str(s) => names.push(s.value.as_str()?.into()), PropName::Str(s) => match s.value.as_str() {
Some(str_val) => names.push(str_val.into()),
None => return None, // non-UTF-8 string key
},
_ => return None, // computed key, can't determine statically _ => return None, // computed key, can't determine statically
}, },
ObjectPatProp::Assign(assign) => { ObjectPatProp::Assign(assign) => {
......
...@@ -2315,31 +2315,45 @@ impl JsValue { ...@@ -2315,31 +2315,45 @@ impl JsValue {
break; break;
} }
JsValue::Member(_, obj, prop) => { JsValue::Member(_, obj, prop) => {
segments.push(DefinableNameSegmentRef::Name(prop.as_str()?)); if let Some(prop) = prop.as_str() {
segments.push(DefinableNameSegmentRef::Name(prop));
} else {
return None;
}
current = obj; current = obj;
} }
JsValue::WellKnownObject(obj) => { JsValue::WellKnownObject(obj) => {
if let Some(name) = obj.as_define_name() {
segments.extend( segments.extend(
obj.as_define_name()? name.iter()
.iter()
.rev() .rev()
.copied() .copied()
.map(DefinableNameSegmentRef::Name), .map(DefinableNameSegmentRef::Name),
); );
break; break;
} else {
return None;
}
} }
JsValue::WellKnownFunction(func) => { JsValue::WellKnownFunction(func) => {
if let Some(name) = func.as_define_name() {
segments.extend( segments.extend(
func.as_define_name()? name.iter()
.iter()
.rev() .rev()
.copied() .copied()
.map(DefinableNameSegmentRef::Name), .map(DefinableNameSegmentRef::Name),
); );
break; break;
} else {
return None;
}
} }
JsValue::MemberCall(_, call) if call.args().is_empty() => { JsValue::MemberCall(_, call) if call.args().is_empty() => {
segments.push(DefinableNameSegmentRef::Call(call.prop().as_str()?)); if let Some(prop) = call.prop().as_str() {
segments.push(DefinableNameSegmentRef::Call(prop));
} else {
return None;
}
current = call.obj(); current = call.obj();
} }
JsValue::TypeOf(_, arg) => { JsValue::TypeOf(_, arg) => {
......
...@@ -328,7 +328,7 @@ async fn module_factory_with_code_generation_issue( ...@@ -328,7 +328,7 @@ async fn module_factory_with_code_generation_issue(
.emit(); .emit();
let mut code = CodeBuilder::default(); let mut code = CodeBuilder::default();
code += "(() => {{\n\n"; code += "(() => {{\n\n";
writeln!(code, "throw new Error({error});", error = js_error_message)?; writeln!(code, "throw new Error({error});", error = &js_error_message)?;
code += "\n}})"; code += "\n}})";
*code.build().cell_persisted() *code.build().cell_persisted()
} }
......
...@@ -1490,6 +1490,7 @@ async fn handle_call<G: Fn(Vec<Effect>) + Send + Sync>( ...@@ -1490,6 +1490,7 @@ async fn handle_call<G: Fn(Vec<Effect>) + Send + Sync>(
url_rewrite_behavior, url_rewrite_behavior,
collect_affecting_sources, collect_affecting_sources,
tracing_only, tracing_only,
allow_project_root_tracing: _,
.. ..
} = state; } = state;
......
...@@ -73,7 +73,7 @@ impl EcmascriptModuleEntry { ...@@ -73,7 +73,7 @@ impl EcmascriptModuleEntry {
Ok(EcmascriptModuleEntry { Ok(EcmascriptModuleEntry {
// Cloning a rope is cheap. // Cloning a rope is cheap.
code: code.await?.source_code().clone(), code: code.await?.source_code().clone(),
url: format!("{}?{}", chunk_path, id), url: format!("{}?{}", chunk_path, &id),
map, map,
}) })
} }
......
...@@ -435,7 +435,7 @@ async fn resolve_node_bindings_files( ...@@ -435,7 +435,7 @@ async fn resolve_node_bindings_files(
let modules = BINDINGS_TRY let modules = BINDINGS_TRY
.iter() .iter()
.map(|try_dir| try_path.clone()(format!("{}/{}", try_dir, file_name).into())) .map(|try_dir| try_path.clone()(format!("{}/{}", try_dir, &file_name).into()))
.try_flat_join() .try_flat_join()
.await?; .await?;
Ok(*ModuleResolveResult::modules(modules)) Ok(*ModuleResolveResult::modules(modules))
......
...@@ -326,7 +326,7 @@ async fn prepare_test(resource: RcStr) -> Result<Vc<PreparedTest>> { ...@@ -326,7 +326,7 @@ async fn prepare_test(resource: RcStr) -> Result<Vc<PreparedTest>> {
let relative_path = resource_path.strip_prefix(&*REPO_ROOT).with_context(|| { let relative_path = resource_path.strip_prefix(&*REPO_ROOT).with_context(|| {
format!( format!(
"stripping repo root {:?} from resource path {:?}", "stripping repo root {:?} from resource path {:?}",
REPO_ROOT, &*REPO_ROOT,
resource_path.display() resource_path.display()
) )
})?; })?;
......
...@@ -614,7 +614,7 @@ impl Display for CommandOutput { ...@@ -614,7 +614,7 @@ impl Display for CommandOutput {
write!( write!(
f, f,
"---------- Stdout ----------\n{}\n---------- Stderr ----------\n{}", "---------- Stdout ----------\n{}\n---------- Stderr ----------\n{}",
self.stdout, self.stderr, &self.stdout, &self.stderr,
) )
} }
} }
......
...@@ -132,7 +132,7 @@ pub fn run_publish(name: &str) { ...@@ -132,7 +132,7 @@ pub fn run_publish(name: &str) {
let dir_name = format!("{}-{}-{}", pkg.crate_name, platform.os, platform.arch); let dir_name = format!("{}-{}-{}", pkg.crate_name, platform.os, platform.arch);
let target_dir = package_dir.join("npm").join(dir_name); let target_dir = package_dir.join("npm").join(dir_name);
fs::create_dir(&target_dir) fs::create_dir(&target_dir)
.unwrap_or_else(|e| panic!("Unable to create dir: {:?}\n{e}", target_dir)); .unwrap_or_else(|e| panic!("Unable to create dir: {:?}\n{e}", &target_dir));
fs::write( fs::write(
target_dir.join("../../package.json"), target_dir.join("../../package.json"),
serde_json::to_string_pretty(&pkg_json).unwrap(), serde_json::to_string_pretty(&pkg_json).unwrap(),
...@@ -263,7 +263,7 @@ pub fn run_bump(names: FxHashSet<String>, dry_run: bool) { ...@@ -263,7 +263,7 @@ pub fn run_bump(names: FxHashSet<String>, dry_run: bool) {
} }
let mut tags_to_apply = Vec::new(); let mut tags_to_apply = Vec::new();
workspaces_to_bump.iter().for_each(|p| { workspaces_to_bump.iter().for_each(|p| {
let title = format!("Version for {}", p.name); let title = format!("Version for {}", &p.name);
let selector = inquire::Select::new(title.as_str(), VERSION_TYPE.to_owned()); let selector = inquire::Select::new(title.as_str(), VERSION_TYPE.to_owned());
let version_type = selector.prompt().expect("Get version type failed"); let version_type = selector.prompt().expect("Get version type failed");
let mut semver_version = Version::parse(&p.version).unwrap_or_else(|e| { let mut semver_version = Version::parse(&p.version).unwrap_or_else(|e| {
......
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