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 @@
"dependsOn": {
"ghcr.io/devcontainers/features/rust:1": {
// this should match the `rust-toolchain.toml`
"version": "nightly-2026-05-15",
"version": "nightly-2026-04-02",
"profile": "minimal",
"components": "rustfmt,clippy,rust-analyzer"
}
......
......@@ -1587,7 +1587,7 @@ impl AppEndpoint {
client_relative_path.clone(),
node_root.join(&format!(
"server/app{}/react-loadable-manifest",
app_entry.original_name
&app_entry.original_name
))?,
NextRuntime::Edge,
)
......@@ -1711,7 +1711,7 @@ impl AppEndpoint {
client_relative_path.clone(),
node_root.join(&format!(
"server/app{}/react-loadable-manifest",
app_entry.original_name
&app_entry.original_name
))?,
NextRuntime::NodeJs,
)
......
......@@ -90,7 +90,7 @@ pub(super) async fn get_font_fallback(
title: StyledString::Text(
format!(
"Failed to find font override values for font `{}`",
options.font_family,
&options.font_family,
)
.into(),
)
......
......@@ -441,7 +441,7 @@ impl ImportMappingReplacement for NextFontGoogleFontFileReplacer {
} = font_file_options_from_query_map(query)?;
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.
let mut name = format!("{:016x}", hash_xxh3_hash64(filename.as_bytes()));
......@@ -506,7 +506,7 @@ async fn update_google_stylesheet(
// Update font-family definitions to the scoped name
// TODO: Do this more resiliently, e.g. transforming an swc ast
let mut stylesheet = stylesheet.await?.replace(
&format!("font-family: '{}';", options.font_family),
&format!("font-family: '{}';", &options.font_family),
&format!("font-family: '{scoped_font_family}';"),
);
......
......@@ -111,7 +111,7 @@ async fn get_font_adjustment(
let mut font = Font::new(scope.read::<FontData>()?.table_provider(0)?)?.with_context(|| {
format!(
"Unable to read font metrics from font file at {}",
main_descriptor.path,
&main_descriptor.path,
)
})?;
......@@ -121,7 +121,7 @@ async fn get_font_adjustment(
.with_context(|| {
format!(
"Unable to read font scale from font file at {}",
main_descriptor.path
&main_descriptor.path
)
})?
.units_per_em as f64;
......
......@@ -222,7 +222,7 @@ impl BeforeResolvePlugin for NextFontLocalResolvePlugin {
} = font_file_options_from_query_map(query)?;
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.
let mut name = filename.replace(['-', '.'], "_");
......
......@@ -565,11 +565,17 @@ fn collect_module_info(
}
finished_directives = true;
}
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl { .. })) => {
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultDecl(ExportDefaultDecl {
decl: _,
..
})) => {
export_names.push(atom!("default"));
finished_directives = true;
}
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(ExportDefaultExpr { .. })) => {
ModuleItem::ModuleDecl(ModuleDecl::ExportDefaultExpr(ExportDefaultExpr {
expr: _,
..
})) => {
export_names.push(atom!("default"));
finished_directives = true;
}
......
......@@ -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()));
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!(
"Turbopack Error: {}",
......@@ -408,10 +408,10 @@ pub fn log_internal_error_and_inform(internal_error: &anyhow::Error) {
);
let bug_report_url = format!(
"https://bugs.nextjs.org/search?category=turbopack-error-report&title={}&body={}&labels=Turbopack,Turbopack%20Panic%20Backtrace",
urlencoding::encode(&title),
urlencoding::encode(&format!(
&urlencoding::encode(&title),
&urlencoding::encode(&format!(
"{}\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() {
......@@ -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",
"FATAL".red().bold(),
PANIC_LOG.to_string_lossy(),
bug_report_message
&bug_report_message
);
}
# 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-05-15"
channel = "nightly-2026-04-02"
components = ["rustfmt", "clippy", "rust-analyzer"]
profile = "minimal"
......@@ -547,7 +547,7 @@ impl Error for TurboTasksExecutionError {
impl Display for TurboTasksExecutionError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TurboTasksExecutionError::Panic(panic) => write!(f, "{}", panic),
TurboTasksExecutionError::Panic(panic) => write!(f, "{}", &panic),
TurboTasksExecutionError::Error(error) => {
write!(f, "{}", error.message)
}
......
......@@ -96,7 +96,7 @@ impl EcmascriptModuleEntry {
Ok(EcmascriptModuleEntry {
// Cloning a rope is cheap.
code: code.await?.source_code().clone(),
url: format!("{}?{}", chunk_path, id),
url: format!("{}?{}", chunk_path, &id),
map,
})
}
......
......@@ -130,7 +130,7 @@ impl CssChunk {
}
for external_import in external_imports {
writeln!(code, "{}", external_import)?;
writeln!(code, "{}", &external_import)?;
}
let built = &body.build();
......
......@@ -132,7 +132,7 @@ impl Introspectable for StaticAssetsContentSource {
}
DirectoryEntry::Directory(path) => ResolvedVc::upcast(
StaticAssetsContentSource::with_prefix(
Vc::cell(format!("{}{name}/", prefix).into()),
Vc::cell(format!("{}{name}/", &*prefix).into()),
path.clone(),
)
.to_resolved()
......
......@@ -98,7 +98,7 @@ pub async fn get_browser_runtime_code(
let asset_suffix = asset_suffix.await?;
let chunk_loading_global = chunk_loading_global.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
.runtime_versions()
......
......@@ -1406,7 +1406,10 @@ fn extract_names_from_object_pat(pat: &Pat) -> Option<SmallVec<[RcStr; 1]>> {
match prop {
ObjectPatProp::KeyValue(kv) => match &kv.key {
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
},
ObjectPatProp::Assign(assign) => {
......
......@@ -2315,31 +2315,45 @@ impl JsValue {
break;
}
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;
}
JsValue::WellKnownObject(obj) => {
segments.extend(
obj.as_define_name()?
.iter()
.rev()
.copied()
.map(DefinableNameSegmentRef::Name),
);
break;
if let Some(name) = obj.as_define_name() {
segments.extend(
name.iter()
.rev()
.copied()
.map(DefinableNameSegmentRef::Name),
);
break;
} else {
return None;
}
}
JsValue::WellKnownFunction(func) => {
segments.extend(
func.as_define_name()?
.iter()
.rev()
.copied()
.map(DefinableNameSegmentRef::Name),
);
break;
if let Some(name) = func.as_define_name() {
segments.extend(
name.iter()
.rev()
.copied()
.map(DefinableNameSegmentRef::Name),
);
break;
} else {
return None;
}
}
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();
}
JsValue::TypeOf(_, arg) => {
......
......@@ -328,7 +328,7 @@ async fn module_factory_with_code_generation_issue(
.emit();
let mut code = CodeBuilder::default();
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.build().cell_persisted()
}
......
......@@ -1490,6 +1490,7 @@ async fn handle_call<G: Fn(Vec<Effect>) + Send + Sync>(
url_rewrite_behavior,
collect_affecting_sources,
tracing_only,
allow_project_root_tracing: _,
..
} = state;
......
......@@ -73,7 +73,7 @@ impl EcmascriptModuleEntry {
Ok(EcmascriptModuleEntry {
// Cloning a rope is cheap.
code: code.await?.source_code().clone(),
url: format!("{}?{}", chunk_path, id),
url: format!("{}?{}", chunk_path, &id),
map,
})
}
......
......@@ -435,7 +435,7 @@ async fn resolve_node_bindings_files(
let modules = BINDINGS_TRY
.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()
.await?;
Ok(*ModuleResolveResult::modules(modules))
......
......@@ -326,7 +326,7 @@ async fn prepare_test(resource: RcStr) -> Result<Vc<PreparedTest>> {
let relative_path = resource_path.strip_prefix(&*REPO_ROOT).with_context(|| {
format!(
"stripping repo root {:?} from resource path {:?}",
REPO_ROOT,
&*REPO_ROOT,
resource_path.display()
)
})?;
......
......@@ -614,7 +614,7 @@ impl Display for CommandOutput {
write!(
f,
"---------- Stdout ----------\n{}\n---------- Stderr ----------\n{}",
self.stdout, self.stderr,
&self.stdout, &self.stderr,
)
}
}
......
......@@ -132,7 +132,7 @@ pub fn run_publish(name: &str) {
let dir_name = format!("{}-{}-{}", pkg.crate_name, platform.os, platform.arch);
let target_dir = package_dir.join("npm").join(dir_name);
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(
target_dir.join("../../package.json"),
serde_json::to_string_pretty(&pkg_json).unwrap(),
......@@ -263,7 +263,7 @@ pub fn run_bump(names: FxHashSet<String>, dry_run: bool) {
}
let mut tags_to_apply = Vec::new();
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 version_type = selector.prompt().expect("Get version type failed");
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