From 96c3598682ae198d44a0c1be070dc86f999c6d2c Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 14:07:02 -0300 Subject: [PATCH 01/36] Upgrade to nightly-2025-12-06 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 028feb5f21d..020a52b489e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-11-25" +channel = "nightly-2025-12-06" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From d724c048ebc8f24f22877b3c397fba887fac2726 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 9 Dec 2025 17:10:44 -0300 Subject: [PATCH 02/36] ReifyFnPointer --- crates/flux-refineck/src/checker.rs | 2 +- crates/flux-rustc-bridge/src/lowering.rs | 4 ++-- crates/flux-rustc-bridge/src/mir.rs | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/flux-refineck/src/checker.rs b/crates/flux-refineck/src/checker.rs index 165305a6c90..8a45f0ce8fc 100644 --- a/crates/flux-refineck/src/checker.rs +++ b/crates/flux-refineck/src/checker.rs @@ -1773,7 +1773,7 @@ impl<'ck, 'genv, 'tcx, M: Mode> Checker<'ck, 'genv, 'tcx, M> { | CastKind::PtrToPtr | CastKind::PointerCoercion(mir::PointerCast::ClosureFnPointer) | CastKind::PointerWithExposedProvenance => self.refine_default(to)?, - CastKind::PointerCoercion(mir::PointerCast::ReifyFnPointer) => { + CastKind::PointerCoercion(mir::PointerCast::ReifyFnPointer(_)) => { let to = self.refine_default(to)?; if let TyKind::Indexed(BaseTy::FnDef(def_id, args), _) = from.kind() && let TyKind::Indexed(BaseTy::FnPtr(super_sig), _) = to.kind() diff --git a/crates/flux-rustc-bridge/src/lowering.rs b/crates/flux-rustc-bridge/src/lowering.rs index c743a1d5d23..874b4a642c7 100644 --- a/crates/flux-rustc-bridge/src/lowering.rs +++ b/crates/flux-rustc-bridge/src/lowering.rs @@ -539,8 +539,8 @@ impl<'sess, 'tcx> MirLoweringCtxt<'_, 'sess, 'tcx> { rustc_adjustment::PointerCoercion::ClosureFnPointer(_) => { Some(crate::mir::PointerCast::ClosureFnPointer) } - rustc_adjustment::PointerCoercion::ReifyFnPointer => { - Some(crate::mir::PointerCast::ReifyFnPointer) + rustc_adjustment::PointerCoercion::ReifyFnPointer(safety) => { + Some(crate::mir::PointerCast::ReifyFnPointer(safety)) } rustc_adjustment::PointerCoercion::UnsafeFnPointer | rustc_adjustment::PointerCoercion::ArrayToPointer => None, diff --git a/crates/flux-rustc-bridge/src/mir.rs b/crates/flux-rustc-bridge/src/mir.rs index 428774ad7c9..dc22d1a9588 100644 --- a/crates/flux-rustc-bridge/src/mir.rs +++ b/crates/flux-rustc-bridge/src/mir.rs @@ -12,7 +12,7 @@ use rustc_data_structures::{ graph::{self, DirectedGraph, StartNode, dominators::Dominators}, unord::UnordMap, }; -use rustc_hir::def_id::DefId; +use rustc_hir::{self as hir, def_id::DefId}; use rustc_index::IndexSlice; use rustc_macros::{TyDecodable, TyEncodable}; use rustc_middle::mir::{Promoted, VarDebugInfoContents}; @@ -292,7 +292,7 @@ pub enum PointerCast { MutToConstPointer, Unsize, ClosureFnPointer, - ReifyFnPointer, + ReifyFnPointer(hir::Safety), } #[derive(Debug)] @@ -777,7 +777,7 @@ impl fmt::Debug for PointerCast { PointerCast::MutToConstPointer => write!(f, "MutToConstPointer"), PointerCast::Unsize => write!(f, "Unsize"), PointerCast::ClosureFnPointer => write!(f, "ClosureFnPointer"), - PointerCast::ReifyFnPointer => write!(f, "ReifyFnPointer"), + PointerCast::ReifyFnPointer(safety) => write!(f, "ReifyFnPointer({safety})"), } } } From 26a0e0ebeef6eb667e45baacaf92c230222779c3 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 14:08:55 -0300 Subject: [PATCH 03/36] Upgrade to nightly-2025-12-09 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 020a52b489e..02768330b23 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-06" +channel = "nightly-2025-12-09" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 5b3cde128b2864367092114f70b68b4fcf8bdf09 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Thu, 11 Dec 2025 16:43:14 -0300 Subject: [PATCH 04/36] BlobDecoder --- crates/flux-metadata/src/decoder.rs | 73 +++++++++++++++-------------- 1 file changed, 38 insertions(+), 35 deletions(-) diff --git a/crates/flux-metadata/src/decoder.rs b/crates/flux-metadata/src/decoder.rs index 6896dde0648..1834babe4bc 100644 --- a/crates/flux-metadata/src/decoder.rs +++ b/crates/flux-metadata/src/decoder.rs @@ -20,7 +20,8 @@ use rustc_serialize::{ }; use rustc_session::StableCrateId; use rustc_span::{ - BytePos, ByteSymbol, DUMMY_SP, SourceFile, Span, SpanDecoder, Symbol, SyntaxContext, + BlobDecoder, BytePos, ByteSymbol, DUMMY_SP, SourceFile, Span, SpanDecoder, Symbol, + SyntaxContext, def_id::{CrateNum, DefIndex}, hygiene::{HygieneDecodeContext, SyntaxContextKey}, }; @@ -122,6 +123,42 @@ fn catch_decode(decode: impl FnOnce() -> R) -> Result { implement_ty_decoder!(DecodeContext<'a, 'tcx>); +impl BlobDecoder for DecodeContext<'_, '_> { + fn decode_symbol(&mut self) -> Symbol { + let tag = self.read_u8(); + + match tag { + SYMBOL_STR => { + let s = self.read_str(); + Symbol::intern(s) + } + SYMBOL_OFFSET => { + // read str offset + let pos = self.read_usize(); + + // move to str offset and read + self.opaque.with_position(pos, |d| { + let s = d.read_str(); + Symbol::intern(s) + }) + } + SYMBOL_PREDEFINED => { + let symbol_index = self.read_u32(); + Symbol::new(symbol_index) + } + _ => unreachable!(), + } + } + + fn decode_byte_symbol(&mut self) -> ByteSymbol { + ByteSymbol::intern(self.read_byte_str()) + } + + fn decode_def_index(&mut self) -> DefIndex { + DefIndex::from_u32(self.read_u32()) + } +} + impl SpanDecoder for DecodeContext<'_, '_> { fn decode_attr_id(&mut self) -> rustc_ast::AttrId { self.tcx.sess.psess.attr_id_generator.mk_attr_id() @@ -132,10 +169,6 @@ impl SpanDecoder for DecodeContext<'_, '_> { self.tcx.stable_crate_id_to_crate_num(stable_id) } - fn decode_def_index(&mut self) -> DefIndex { - DefIndex::from_u32(self.read_u32()) - } - fn decode_def_id(&mut self) -> DefId { DefId { krate: Decodable::decode(self), index: Decodable::decode(self) } } @@ -184,36 +217,6 @@ impl SpanDecoder for DecodeContext<'_, '_> { Span::new(lo, hi, ctxt, None) } - - fn decode_symbol(&mut self) -> rustc_span::Symbol { - let tag = self.read_u8(); - - match tag { - SYMBOL_STR => { - let s = self.read_str(); - Symbol::intern(s) - } - SYMBOL_OFFSET => { - // read str offset - let pos = self.read_usize(); - - // move to str offset and read - self.opaque.with_position(pos, |d| { - let s = d.read_str(); - Symbol::intern(s) - }) - } - SYMBOL_PREDEFINED => { - let symbol_index = self.read_u32(); - Symbol::new(symbol_index) - } - _ => unreachable!(), - } - } - - fn decode_byte_symbol(&mut self) -> ByteSymbol { - ByteSymbol::intern(self.read_byte_str()) - } } impl<'tcx> TyDecoder<'tcx> for DecodeContext<'_, 'tcx> { From 4a61c3f24ffd4526e4fd02af58038d47053befd8 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 14:07:30 -0300 Subject: [PATCH 05/36] Upgrade to nightly-2025-12-11 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 02768330b23..7974a52ee68 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-09" +channel = "nightly-2025-12-11" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 6752fc7887d5e56515426ca5dd10598c8873aa37 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Fri, 12 Dec 2025 10:59:23 -0300 Subject: [PATCH 06/36] proc_macro_tracked_path --- crates/flux-macros/src/diagnostics/fluent.rs | 24 ++++++++++++-------- crates/flux-macros/src/lib.rs | 8 ++++++- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/crates/flux-macros/src/diagnostics/fluent.rs b/crates/flux-macros/src/diagnostics/fluent.rs index 51806d4196e..e3a13c9b5ac 100644 --- a/crates/flux-macros/src/diagnostics/fluent.rs +++ b/crates/flux-macros/src/diagnostics/fluent.rs @@ -1,15 +1,19 @@ -use std::collections::{HashMap, HashSet}; -use std::fs::read_to_string; -use std::path::{Path, PathBuf}; +use std::{ + collections::{HashMap, HashSet}, + fs::read_to_string, + path::{Path, PathBuf}, +}; use annotate_snippets::{Renderer, Snippet}; use fluent_bundle::{FluentBundle, FluentError, FluentResource}; -use fluent_syntax::ast::{ - Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, PatternElement, +use fluent_syntax::{ + ast::{ + Attribute, Entry, Expression, Identifier, InlineExpression, Message, Pattern, + PatternElement, + }, + parser::ParserError, }; -use fluent_syntax::parser::ParserError; -use proc_macro::tracked_path::path; -use proc_macro::{Diagnostic, Level, Span}; +use proc_macro::{Diagnostic, Level, Span, tracked::path}; use proc_macro2::TokenStream; use quote::quote; use syn::{Ident, LitStr, parse_macro_input}; @@ -158,7 +162,9 @@ pub(crate) fn fluent_messages(input: proc_macro::TokenStream) -> proc_macro::Tok for entry in resource.entries() { if let Entry::Message(msg) = entry { let Message { id: Identifier { name }, attributes, value, .. } = msg; - let _ = previous_defns.entry((*name).to_string()).or_insert(resource_span); + let _ = previous_defns + .entry((*name).to_string()) + .or_insert(resource_span); if name.contains('-') { Diagnostic::spanned( resource_span, diff --git a/crates/flux-macros/src/lib.rs b/crates/flux-macros/src/lib.rs index 13c7d5d7a31..e3f98fdd649 100644 --- a/crates/flux-macros/src/lib.rs +++ b/crates/flux-macros/src/lib.rs @@ -1,4 +1,10 @@ -#![feature(proc_macro_diagnostic, never_type, proc_macro_span, if_let_guard, track_path)] +#![feature( + proc_macro_diagnostic, + never_type, + proc_macro_span, + if_let_guard, + proc_macro_tracked_path +)] mod diagnostics; mod fold; From 0edec7ff4bc8e006168bbdc3bd29d816f8aec1dc Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 14:08:37 -0300 Subject: [PATCH 07/36] Upgrade to nightly-2025-12-14 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7974a52ee68..ccfe1b72c50 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-11" +channel = "nightly-2025-12-14" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From b9aa6a1574f57d22cfc9be33a360ef79b973420b Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Thu, 18 Dec 2025 16:03:05 -0300 Subject: [PATCH 08/36] RealFileName --- crates/flux-metadata/src/encoder.rs | 7 ++----- crates/flux-middle/src/global_env.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/crates/flux-metadata/src/encoder.rs b/crates/flux-metadata/src/encoder.rs index 0c6d759d862..9ac5f403224 100644 --- a/crates/flux-metadata/src/encoder.rs +++ b/crates/flux-metadata/src/encoder.rs @@ -77,8 +77,6 @@ fn file_indices( let mut file_index_to_stable_id = FxHashMap::with_capacity_and_hasher(files.len(), Default::default()); use rustc_span::def_id::LOCAL_CRATE; - let source_map = tcx.sess.source_map(); - let working_directory = &tcx.sess.opts.working_dir; let local_crate_stable_id = tcx.stable_crate_id(LOCAL_CRATE); // This portion of the code is adapted from the rustc metadata encoder, while the rest of @@ -95,9 +93,8 @@ fn file_indices( use rustc_span::FileName; match file.name { FileName::Real(ref original_file_name) => { - let adapted_file_name = source_map - .path_mapping() - .to_embeddable_absolute_path(original_file_name.clone(), working_directory); + let mut adapted_file_name = original_file_name.clone(); + adapted_file_name.update_for_crate_metadata(); adapted_source_file.name = FileName::Real(adapted_file_name); } diff --git a/crates/flux-middle/src/global_env.rs b/crates/flux-middle/src/global_env.rs index 884582a4ffc..a419e413903 100644 --- a/crates/flux-middle/src/global_env.rs +++ b/crates/flux-middle/src/global_env.rs @@ -657,11 +657,11 @@ impl<'genv, 'tcx> GlobalEnv<'genv, 'tcx> { let span = tcx.def_span(def_id); let sm = tcx.sess.source_map(); let FileName::Real(file_name) = sm.span_to_filename(span) else { return true }; - let mut file_path = file_name.local_path_if_available(); + let Some(mut file_path) = file_name.local_path() else { return true }; // If the path is absolute try to normalize it to be relative to the working_dir if file_path.is_absolute() { - let working_dir = tcx.sess.opts.working_dir.local_path_if_available(); + let Some(working_dir) = sm.working_dir().local_path() else { return true }; let Ok(p) = file_path.strip_prefix(working_dir) else { return true }; file_path = p; } @@ -938,9 +938,9 @@ impl ErrorEmitter for GlobalEnv<'_, '_> { fn lean_parent_dir(tcx: TyCtxt) -> PathBuf { tcx.sess - .opts - .working_dir - .local_path_if_available() - .to_path_buf() + .source_map() + .working_dir() + .local_path() + .unwrap() .join(config::lean_dir()) } From 05ce778bab6dcd511e19467c63d9b9eec143693b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 18 Dec 2025 19:31:19 +0000 Subject: [PATCH 09/36] Upgrade to nightly-2025-12-15 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ccfe1b72c50..ec3f6a42711 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-14" +channel = "nightly-2025-12-15" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 80d095b6f323af89d2ee96feff2ce126da4c1bf3 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Mon, 22 Dec 2025 09:42:54 -0300 Subject: [PATCH 10/36] CrateSource::rmeta --- crates/flux-metadata/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/flux-metadata/src/lib.rs b/crates/flux-metadata/src/lib.rs index 14a31421554..54f0a974a4b 100644 --- a/crates/flux-metadata/src/lib.rs +++ b/crates/flux-metadata/src/lib.rs @@ -601,7 +601,7 @@ fn flux_metadata_extern_location(tcx: TyCtxt, crate_num: CrateNum) -> Option Date: Tue, 23 Dec 2025 14:08:18 -0300 Subject: [PATCH 11/36] Upgrade to nightly-2025-12-18 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ec3f6a42711..ddf06a5a71a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-15" +channel = "nightly-2025-12-18" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From eb1a4dcdecf2422ac981266be83af8db986aa54b Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 13:03:41 -0300 Subject: [PATCH 12/36] AnnotateSnippetEmitter --- crates/flux-errors/src/lib.rs | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/crates/flux-errors/src/lib.rs b/crates/flux-errors/src/lib.rs index 5d54a93b977..c4e88c6319c 100644 --- a/crates/flux-errors/src/lib.rs +++ b/crates/flux-errors/src/lib.rs @@ -13,7 +13,7 @@ pub use rustc_errors::ErrorGuaranteed; use rustc_errors::{ Diagnostic, ErrCode, FatalAbort, FatalError, LazyFallbackBundle, TerminalUrl, annotate_snippet_emitter_writer::AnnotateSnippetEmitter, - emitter::{Emitter, HumanEmitter, HumanReadableErrorType, OutputTheme, stderr_destination}, + emitter::{Emitter, HumanReadableErrorType, OutputTheme, stderr_destination}, json::JsonEmitter, translation::Translator, }; @@ -100,7 +100,7 @@ fn emitter( match sopts.error_format { config::ErrorOutputType::HumanReadable { kind, color_config } => { match kind { - HumanReadableErrorType::AnnotateSnippet { short, unicode } => { + HumanReadableErrorType { short, unicode } => { let emitter = AnnotateSnippetEmitter::new(stderr_destination(color_config), translator) .sm(source_map) @@ -118,23 +118,6 @@ fn emitter( ); Box::new(emitter.ui_testing(sopts.unstable_opts.ui_testing)) } - HumanReadableErrorType::Default { short } => { - let emitter = HumanEmitter::new(stderr_destination(color_config), translator) - .sm(source_map) - .short_message(short) - .diagnostic_width(sopts.diagnostic_width) - .macro_backtrace(macro_backtrace) - .track_diagnostics(track_diagnostics) - .terminal_url(terminal_url) - .theme(OutputTheme::Ascii) - .ignored_directories_in_source_blocks( - sopts - .unstable_opts - .ignore_directory_in_diagnostics_source_blocks - .clone(), - ); - Box::new(emitter.ui_testing(sopts.unstable_opts.ui_testing)) - } } } config::ErrorOutputType::Json { pretty, json_rendered, color_config } => { From aa2f7a7a1d5f55d2f5492fdd4ac2bc6d70aa656b Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 23 Dec 2025 14:07:54 -0300 Subject: [PATCH 13/36] Upgrade to nightly-2025-12-23 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ddf06a5a71a..cac6f099858 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-18" +channel = "nightly-2025-12-23" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From b06aa401670415012452e2b4fbb80a057e3205a0 Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Mon, 19 Jan 2026 10:15:58 -0300 Subject: [PATCH 14/36] NullOp -> Runtimechecks --- crates/flux-refineck/src/ghost_statements/points_to.rs | 2 +- crates/flux-rustc-bridge/src/lowering.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/flux-refineck/src/ghost_statements/points_to.rs b/crates/flux-refineck/src/ghost_statements/points_to.rs index 6f9257f3650..089319bf094 100644 --- a/crates/flux-refineck/src/ghost_statements/points_to.rs +++ b/crates/flux-refineck/src/ghost_statements/points_to.rs @@ -131,12 +131,12 @@ impl<'a> PointsToAnalysis<'a> { fn handle_operand(&self, operand: &mir::Operand) -> Option { match operand { - mir::Operand::Constant(..) => None, mir::Operand::Copy(place) | mir::Operand::Move(place) => { // On move, we would ideally flood the place with bottom. But with the current // framework this is not possible (similar to `InterpCx::eval_operand`). self.map.find(place.as_ref()) } + mir::Operand::Constant(..) | mir::Operand::RuntimeChecks(_) => None, } } diff --git a/crates/flux-rustc-bridge/src/lowering.rs b/crates/flux-rustc-bridge/src/lowering.rs index 874b4a642c7..b84f699465d 100644 --- a/crates/flux-rustc-bridge/src/lowering.rs +++ b/crates/flux-rustc-bridge/src/lowering.rs @@ -519,7 +519,6 @@ impl<'sess, 'tcx> MirLoweringCtxt<'_, 'sess, 'tcx> { Ok(Rvalue::ShallowInitBox(self.lower_operand(op)?, ty.lower(self.tcx)?)) } rustc_mir::Rvalue::ThreadLocalRef(_) - | rustc_mir::Rvalue::NullaryOp(..) | rustc_mir::Rvalue::CopyForDeref(_) | rustc_mir::Rvalue::WrapUnsafeBinder(..) => { Err(UnsupportedReason::new(format!("unsupported rvalue `{rvalue:?}`"))) @@ -644,6 +643,9 @@ impl<'sess, 'tcx> MirLoweringCtxt<'_, 'sess, 'tcx> { rustc_mir::Operand::Copy(place) => Ok(Operand::Copy(lower_place(self.tcx, place)?)), rustc_mir::Operand::Move(place) => Ok(Operand::Move(lower_place(self.tcx, place)?)), rustc_mir::Operand::Constant(c) => Ok(Operand::Constant(self.lower_constant(c)?)), + rustc_mir::Operand::RuntimeChecks(..) => { + Err(UnsupportedReason::new(format!("unsupported operand `{op:?}`"))) + } } } From d12a677ee8f55f8dbf3a4f84ec233a841c29720a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jan 2026 13:03:44 +0000 Subject: [PATCH 15/36] Upgrade to nightly-2025-12-28 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index cac6f099858..e1c4cefbd34 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-23" +channel = "nightly-2025-12-28" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 311281815860242752326af322be2b7e22b12099 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 05:49:20 -0800 Subject: [PATCH 16/36] Fix ValTree API changes --- crates/flux-rustc-bridge/src/lowering.rs | 14 +++++++------- crates/flux-rustc-bridge/src/ty/mod.rs | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/flux-rustc-bridge/src/lowering.rs b/crates/flux-rustc-bridge/src/lowering.rs index b84f699465d..ffb810dcf0d 100644 --- a/crates/flux-rustc-bridge/src/lowering.rs +++ b/crates/flux-rustc-bridge/src/lowering.rs @@ -732,14 +732,14 @@ impl<'tcx> Lower<'tcx> for &'tcx rustc_ty::List { } impl<'tcx> Lower<'tcx> for rustc_ty::ValTree<'tcx> { - type R = crate::ty::ValTree; + type R = Result; - fn lower(self, _tcx: TyCtxt<'tcx>) -> Self::R { + fn lower(self, tcx: TyCtxt<'tcx>) -> Self::R { match &*self { - rustc_ty::ValTreeKind::Leaf(scalar_int) => crate::ty::ValTree::Leaf(*scalar_int), - rustc_ty::ValTreeKind::Branch(trees) => { - let trees = trees.iter().map(|tree| tree.lower(_tcx)).collect(); - crate::ty::ValTree::Branch(trees) + rustc_ty::ValTreeKind::Leaf(scalar_int) => Ok(crate::ty::ValTree::Leaf(*scalar_int)), + rustc_ty::ValTreeKind::Branch(consts) => { + let trees = consts.iter().map(|c| c.lower(tcx)).try_collect()?; + Ok(crate::ty::ValTree::Branch(trees)) } } } @@ -754,7 +754,7 @@ impl<'tcx> Lower<'tcx> for rustc_ty::Const<'tcx> { ConstKind::Param(ParamConst { name: param_const.name, index: param_const.index }) } rustc_type_ir::ConstKind::Value(value) => { - ConstKind::Value(value.ty.lower(tcx)?, value.valtree.lower(tcx)) + ConstKind::Value(value.ty.lower(tcx)?, value.valtree.lower(tcx)?) } rustc_type_ir::ConstKind::Unevaluated(c) => { // TODO: raise unsupported if c.args is not empty? diff --git a/crates/flux-rustc-bridge/src/ty/mod.rs b/crates/flux-rustc-bridge/src/ty/mod.rs index bb3776de337..a4f3597b760 100644 --- a/crates/flux-rustc-bridge/src/ty/mod.rs +++ b/crates/flux-rustc-bridge/src/ty/mod.rs @@ -317,9 +317,9 @@ impl<'tcx> ToRustc<'tcx> for ValTree { fn to_rustc(&self, tcx: TyCtxt<'tcx>) -> Self::T { match self { ValTree::Leaf(scalar) => rustc_middle::ty::ValTree::from_scalar_int(tcx, *scalar), - ValTree::Branch(trees) => { - let trees = trees.iter().map(|tree| tree.to_rustc(tcx)); - rustc_middle::ty::ValTree::from_branches(tcx, trees) + ValTree::Branch(consts) => { + let consts = consts.iter().map(|c| c.to_rustc(tcx)); + rustc_middle::ty::ValTree::from_branches(tcx, consts) } } } @@ -354,7 +354,7 @@ pub struct UnevaluatedConst { #[derive(Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] pub enum ValTree { Leaf(ScalarInt), - Branch(List), + Branch(List), } #[derive(Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] @@ -990,7 +990,7 @@ impl_slice_internable!( GenericParamDef, BoundVariableKind, Clause, - ValTree, + Const, Binder, ); From db6a39f85f63d25effba203874acb6bc6a04dc82 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jan 2026 14:05:20 +0000 Subject: [PATCH 17/36] Upgrade to nightly-2026-01-02 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e1c4cefbd34..1edd3e566e8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-12-28" +channel = "nightly-2026-01-02" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 8e4abf921a8093a8cc345a35da711cba388dbb01 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jan 2026 14:15:14 +0000 Subject: [PATCH 18/36] Upgrade to nightly-2026-01-07 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1edd3e566e8..b67aedd657f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-02" +channel = "nightly-2026-01-07" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 84fd87507e99b0ffa69a95100504cd99c94b1adc Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 Jan 2026 10:12:48 -0800 Subject: [PATCH 19/36] Fix toolchain upgrade issues for nightly-2026-01-07 (#1457) --- .gitignore | 3 ++- crates/flux-middle/src/fhir.rs | 2 +- lib/flux-alloc/src/vec/mod.rs | 3 +++ tests/tests/neg/surface/vec01.rs | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e137664393e..a594fbc9762 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ log sysroot/ fixpoint -.DS_Store \ No newline at end of file +.DS_Store +fixpoint diff --git a/crates/flux-middle/src/fhir.rs b/crates/flux-middle/src/fhir.rs index d65a13e5814..d3c2021c4b9 100644 --- a/crates/flux-middle/src/fhir.rs +++ b/crates/flux-middle/src/fhir.rs @@ -1300,7 +1300,7 @@ impl TryFrom> for Res { match res { rustc_hir::def::Res::Def(kind, did) => Ok(Res::Def(kind, did)), rustc_hir::def::Res::PrimTy(prim_ty) => Ok(Res::PrimTy(prim_ty)), - rustc_hir::def::Res::SelfTyAlias { alias_to, forbid_generic: false, is_trait_impl } => { + rustc_hir::def::Res::SelfTyAlias { alias_to, is_trait_impl } => { Ok(Res::SelfTyAlias { alias_to, is_trait_impl }) } rustc_hir::def::Res::SelfTyParam { trait_ } => Ok(Res::SelfTyParam { trait_ }), diff --git a/lib/flux-alloc/src/vec/mod.rs b/lib/flux-alloc/src/vec/mod.rs index 5cde6bf5409..2d1b69b4de5 100644 --- a/lib/flux-alloc/src/vec/mod.rs +++ b/lib/flux-alloc/src/vec/mod.rs @@ -24,7 +24,10 @@ impl Vec { impl Vec { #[spec(fn(self: &mut Vec[@n], T) ensures self: Vec[n+1])] fn push(v: &mut Vec, value: T); +} +#[extern_spec] +impl Vec { #[spec(fn(&Vec[@n]) -> usize[n])] fn len(v: &Vec) -> usize; diff --git a/tests/tests/neg/surface/vec01.rs b/tests/tests/neg/surface/vec01.rs index d073407e68c..592e70145e8 100644 --- a/tests/tests/neg/surface/vec01.rs +++ b/tests/tests/neg/surface/vec01.rs @@ -47,7 +47,10 @@ impl Vec { impl Vec { #[flux::sig(fn(self: &strg Vec[@n], T) ensures self: Vec[n+1])] fn push(v: &mut Vec, value: T); +} +#[extern_spec] +impl Vec { #[flux::sig(fn(&Vec[@n]) -> usize[n])] fn len(v: &Vec) -> usize; } From f1f34b6e66560995e7147b58dfb60adc5dd931bc Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 27 Jan 2026 15:30:17 -0300 Subject: [PATCH 20/36] Patch libs for lean demo --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5003603f658..4b24f166c6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,6 +115,14 @@ jobs: run: | git clone https://github.com/flux-rs/flux-to-lean-demo + - name: Patch flux-rs dependency if in pull request + if: github.event_name == 'pull_request' + run: | + echo '[patch."https://github.com/flux-rs/flux.git"]' >> flux-to-lean-demo/Cargo.toml + echo 'flux-rs = { path = "../lib/flux-rs" }' >> flux-to-lean-demo/Cargo.toml + echo 'flux-core = { path = "../lib/flux-core" }' >> flux-to-lean-demo/Cargo.toml + echo 'flux-alloc = { path = "../lib/flux-alloc" }' >> flux-to-lean-demo/Cargo.toml + - name: Run lean demo working-directory: flux-to-lean-demo run: | From 7f587e0cf5345c56a66b1ade8359742944970beb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 27 Jan 2026 18:47:50 +0000 Subject: [PATCH 21/36] Upgrade to nightly-2026-01-12 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b67aedd657f..0dadaaa8ebb 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-07" +channel = "nightly-2026-01-12" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 7bda87ef41ff23ede4e8ea940670165cb44ce8e4 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 04:38:30 -0800 Subject: [PATCH 22/36] Fix ConstArg::span API change --- crates/flux-desugar/src/desugar/lift.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/flux-desugar/src/desugar/lift.rs b/crates/flux-desugar/src/desugar/lift.rs index 322d0a8df8d..2fa270b7af1 100644 --- a/crates/flux-desugar/src/desugar/lift.rs +++ b/crates/flux-desugar/src/desugar/lift.rs @@ -513,7 +513,7 @@ impl<'genv> RustItemCtxt<'_, 'genv, '_> { } fn lift_const_arg(&mut self, const_arg: &hir::ConstArg) -> fhir::ConstArg { - fhir::ConstArg { kind: fhir::ConstArgKind::Infer, span: const_arg.span() } + fhir::ConstArg { kind: fhir::ConstArgKind::Infer, span: const_arg.span } } #[track_caller] From 1903359acc22f833afef641cd9d852ad24f1e97b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jan 2026 12:49:50 +0000 Subject: [PATCH 23/36] Upgrade to nightly-2026-01-17 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0dadaaa8ebb..5f510717d6b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-12" +channel = "nightly-2026-01-17" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 443d30978c0687d8b5bc57249a5983bb1f97e5f2 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Wed, 28 Jan 2026 05:23:57 -0800 Subject: [PATCH 24/36] Fix Providers field access --- crates/flux-driver/src/callbacks.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/flux-driver/src/callbacks.rs b/crates/flux-driver/src/callbacks.rs index ab33795d66a..d2a2035755b 100644 --- a/crates/flux-driver/src/callbacks.rs +++ b/crates/flux-driver/src/callbacks.rs @@ -24,7 +24,7 @@ use rustc_hir::{ def_id::{LOCAL_CRATE, LocalDefId}, }; use rustc_interface::interface::Compiler; -use rustc_middle::{query, ty::TyCtxt}; +use rustc_middle::{query, ty::TyCtxt, util}; use rustc_session::config::OutputType; use crate::{DEFAULT_LOCALE_RESOURCES, collector::SpecCollector}; @@ -37,7 +37,7 @@ impl Callbacks for FluxCallbacks { assert!(config.override_queries.is_none()); config.override_queries = Some(|_, local| { - local.mir_borrowck = mir_borrowck; + local.queries.mir_borrowck = mir_borrowck; }); // this should always be empty otherwise something changed in rustc and all our assumptions // about symbol interning are wrong. @@ -391,8 +391,8 @@ fn mir_borrowck<'tcx>( flux_common::mir_storage::store_mir_body(tcx, def_id, body_with_facts); } } - let mut providers = query::Providers::default(); - rustc_borrowck::provide(&mut providers); - let original_mir_borrowck = providers.mir_borrowck; + let mut providers = util::Providers::default(); + rustc_borrowck::provide(&mut providers.queries); + let original_mir_borrowck = providers.queries.mir_borrowck; original_mir_borrowck(tcx, def_id) } From 35b2dae954f3b952151162c0876cdb4c2b46c258 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jan 2026 13:46:01 +0000 Subject: [PATCH 25/36] Upgrade to nightly-2026-01-22 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5f510717d6b..3d1cac94c6e 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-17" +channel = "nightly-2026-01-22" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From d2edf6c8f26fac6c5e944d22192af24513fd76c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jan 2026 13:56:02 +0000 Subject: [PATCH 26/36] Upgrade to nightly-2026-01-27 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 3d1cac94c6e..5b1fee5bc93 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-22" +channel = "nightly-2026-01-27" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From dcbb91ca00cdad04b0fbc8d088b6ba4911c39ab8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 28 Jan 2026 14:08:03 +0000 Subject: [PATCH 27/36] Upgrade to nightly-2026-01-28 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 5b1fee5bc93..a804b095fa0 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-27" +channel = "nightly-2026-01-28" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 3d53946ead2595d9a7164d61b3643b4d348e49d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 29 Jan 2026 13:56:24 +0000 Subject: [PATCH 28/36] Upgrade to nightly-2026-01-29 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index a804b095fa0..6d5a283b618 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-28" +channel = "nightly-2026-01-29" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 183f37476ea1db53e6e1d970d6fd6302bbae1e73 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 30 Jan 2026 15:12:36 +0000 Subject: [PATCH 29/36] Upgrade to nightly-2026-01-30 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 6d5a283b618..2464d06438a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-29" +channel = "nightly-2026-01-30" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 8cfbbeea9a70149007969edb2abb4798d3f3a16f Mon Sep 17 00:00:00 2001 From: Nico Lehmann Date: Tue, 10 Feb 2026 11:07:27 -0300 Subject: [PATCH 30/36] BoundVariableKind --- crates/flux-middle/src/rty/binder.rs | 8 ++-- crates/flux-middle/src/rty/pretty.rs | 2 +- crates/flux-rustc-bridge/src/lowering.rs | 27 ++++++++++--- crates/flux-rustc-bridge/src/ty/mod.rs | 50 +++++++++++++++++++----- 4 files changed, 66 insertions(+), 21 deletions(-) diff --git a/crates/flux-middle/src/rty/binder.rs b/crates/flux-middle/src/rty/binder.rs index f8ba5073f28..e44d0ae5625 100644 --- a/crates/flux-middle/src/rty/binder.rs +++ b/crates/flux-middle/src/rty/binder.rs @@ -5,12 +5,12 @@ use flux_common::tracked_span_bug; use flux_macros::{TypeFoldable, TypeVisitable}; use flux_rustc_bridge::{ ToRustc, - ty::{BoundRegion, Region}, + ty::{BoundRegion, BoundRegionKind, Region}, }; use itertools::Itertools; use rustc_data_structures::unord::UnordMap; use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable}; -use rustc_middle::ty::{BoundRegionKind, TyCtxt}; +use rustc_middle::ty::TyCtxt; use rustc_span::Symbol; use super::{ @@ -263,11 +263,11 @@ impl BoundVariableKind { fn to_rustc<'tcx>( vars: &[Self], tcx: TyCtxt<'tcx>, - ) -> &'tcx rustc_middle::ty::List { + ) -> &'tcx rustc_middle::ty::List> { tcx.mk_bound_variable_kinds_from_iter(vars.iter().flat_map(|kind| { match kind { BoundVariableKind::Region(brk) => { - Some(rustc_middle::ty::BoundVariableKind::Region(*brk)) + Some(rustc_middle::ty::BoundVariableKind::Region(brk.to_rustc(tcx))) } BoundVariableKind::Refine(..) => None, } diff --git a/crates/flux-middle/src/rty/pretty.rs b/crates/flux-middle/src/rty/pretty.rs index 4627e78e30a..b6b114785c9 100644 --- a/crates/flux-middle/src/rty/pretty.rs +++ b/crates/flux-middle/src/rty/pretty.rs @@ -31,7 +31,7 @@ impl Pretty for BoundRegionKind { fn fmt(&self, _cx: &PrettyCx, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { BoundRegionKind::Anon => w!(cx, f, "'"), - BoundRegionKind::NamedAnon(sym) => w!(cx, f, "'{sym}"), + BoundRegionKind::NamedForPrinting(sym) => w!(cx, f, "'{sym}"), BoundRegionKind::Named(def_id) => w!(cx, f, "'{def_id:?}"), BoundRegionKind::ClosureEnv => w!(cx, f, "'"), } diff --git a/crates/flux-rustc-bridge/src/lowering.rs b/crates/flux-rustc-bridge/src/lowering.rs index ffb810dcf0d..a9b4f0b7202 100644 --- a/crates/flux-rustc-bridge/src/lowering.rs +++ b/crates/flux-rustc-bridge/src/lowering.rs @@ -39,7 +39,7 @@ use super::{ use crate::{ mir::{BodyKind, BodyRoot, CallKind, ConstOperand}, ty::{ - AliasTy, ExistentialTraitRef, GenericArgs, ProjectionPredicate, Region, + AliasTy, BoundRegionKind, ExistentialTraitRef, GenericArgs, ProjectionPredicate, Region, RegionOutlivesPredicate, }, }; @@ -710,15 +710,15 @@ impl<'tcx> Lower<'tcx> for rustc_ty::FnSig<'tcx> { } } -impl<'tcx> Lower<'tcx> for &'tcx rustc_ty::List { +impl<'tcx> Lower<'tcx> for &'tcx rustc_ty::List> { type R = Result, UnsupportedReason>; - fn lower(self, _tcx: TyCtxt<'tcx>) -> Self::R { + fn lower(self, tcx: TyCtxt<'tcx>) -> Self::R { let mut vars = vec![]; for var in self { match var { rustc_ty::BoundVariableKind::Region(kind) => { - vars.push(BoundVariableKind::Region(kind)); + vars.push(BoundVariableKind::Region(kind.lower(tcx))); } _ => { return Err(UnsupportedReason { @@ -731,6 +731,21 @@ impl<'tcx> Lower<'tcx> for &'tcx rustc_ty::List { } } +impl<'tcx> Lower<'tcx> for rustc_ty::BoundRegionKind<'tcx> { + type R = BoundRegionKind; + + fn lower(self, _tcx: TyCtxt<'tcx>) -> Self::R { + match self { + rustc_ty::BoundRegionKind::Anon => BoundRegionKind::Anon, + rustc_ty::BoundRegionKind::NamedForPrinting(name) => { + BoundRegionKind::NamedForPrinting(name) + } + rustc_ty::BoundRegionKind::Named(def_id) => BoundRegionKind::Named(def_id), + rustc_ty::BoundRegionKind::ClosureEnv => BoundRegionKind::ClosureEnv, + } + } +} + impl<'tcx> Lower<'tcx> for rustc_ty::ValTree<'tcx> { type R = Result; @@ -958,14 +973,14 @@ impl<'tcx> Lower<'tcx> for rustc_middle::ty::GenericArg<'tcx> { impl<'tcx> Lower<'tcx> for rustc_middle::ty::Region<'tcx> { type R = Result; - fn lower(self, _tcx: TyCtxt<'tcx>) -> Self::R { + fn lower(self, tcx: TyCtxt<'tcx>) -> Self::R { use rustc_middle::ty; match self.kind() { ty::ReVar(rvid) => Ok(Region::ReVar(rvid)), ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn), bregion) => { Ok(Region::ReBound( debruijn, - Ok(BoundRegion { kind: bregion.kind, var: bregion.var })?, + Ok(BoundRegion { kind: bregion.kind.lower(tcx), var: bregion.var })?, )) } ty::ReEarlyParam(bregion) => Ok(Region::ReEarlyParam(bregion)), diff --git a/crates/flux-rustc-bridge/src/ty/mod.rs b/crates/flux-rustc-bridge/src/ty/mod.rs index a4f3597b760..c881ce5b759 100644 --- a/crates/flux-rustc-bridge/src/ty/mod.rs +++ b/crates/flux-rustc-bridge/src/ty/mod.rs @@ -12,12 +12,12 @@ use rustc_abi; pub use rustc_abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; use rustc_hir::{Safety, def_id::DefId}; use rustc_index::{IndexSlice, IndexVec}; -use rustc_macros::{TyDecodable, TyEncodable, extension}; +use rustc_macros::{Decodable, Encodable, TyDecodable, TyEncodable, extension}; pub use rustc_middle::{ mir::Mutability, ty::{ - BoundRegionKind, BoundVar, ConstVid, DebruijnIndex, EarlyParamRegion, FloatTy, IntTy, - LateParamRegion, LateParamRegionKind, ParamTy, RegionVid, ScalarInt, UintTy, + BoundVar, ConstVid, DebruijnIndex, EarlyParamRegion, FloatTy, IntTy, LateParamRegion, + LateParamRegionKind, ParamTy, RegionVid, ScalarInt, UintTy, }, }; use rustc_middle::{ @@ -43,7 +43,22 @@ pub struct EarlyBinder(pub T); #[derive(Clone, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] pub struct Binder(T, List); -#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, TyEncodable, TyDecodable)] +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable)] +pub enum BoundRegionKind { + /// An anonymous region parameter for a given fn (&T) + Anon, + /// An anonymous region parameter with a `Symbol` name. + /// + /// Used to give late-bound regions names for things like pretty printing. + NamedForPrinting(Symbol), + /// Late-bound regions that appear in the AST. + Named(DefId), + /// Anonymous region for the implicit env pointer parameter + /// to a closure + ClosureEnv, +} + +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encodable, Decodable)] pub enum BoundVariableKind { Region(BoundRegionKind), } @@ -54,17 +69,32 @@ impl BoundVariableKind { fn to_rustc<'tcx>( vars: &[Self], tcx: TyCtxt<'tcx>, - ) -> &'tcx rustc_middle::ty::List { + ) -> &'tcx rustc_middle::ty::List> { tcx.mk_bound_variable_kinds_from_iter(vars.iter().flat_map(|kind| { match kind { BoundVariableKind::Region(brk) => { - Some(rustc_middle::ty::BoundVariableKind::Region(*brk)) + Some(rustc_middle::ty::BoundVariableKind::Region(brk.to_rustc(tcx))) } } })) } } +impl<'tcx> ToRustc<'tcx> for BoundRegionKind { + type T = rustc_middle::ty::BoundRegionKind<'tcx>; + + fn to_rustc(&self, _tcx: TyCtxt<'tcx>) -> Self::T { + match *self { + BoundRegionKind::Anon => rustc_middle::ty::BoundRegionKind::Anon, + BoundRegionKind::NamedForPrinting(name) => { + rustc_middle::ty::BoundRegionKind::NamedForPrinting(name) + } + BoundRegionKind::Named(def_id) => rustc_middle::ty::BoundRegionKind::Named(def_id), + BoundRegionKind::ClosureEnv => rustc_middle::ty::BoundRegionKind::ClosureEnv, + } + } +} + #[derive(Debug, Hash, Eq, PartialEq, TyEncodable, TyDecodable)] pub struct GenericParamDef { pub def_id: DefId, @@ -455,10 +485,10 @@ pub struct BoundRegion { } impl<'tcx> ToRustc<'tcx> for BoundRegion { - type T = rustc_middle::ty::BoundRegion; + type T = rustc_middle::ty::BoundRegion<'tcx>; - fn to_rustc(&self, _tcx: TyCtxt<'tcx>) -> Self::T { - rustc_middle::ty::BoundRegion { var: self.var, kind: self.kind } + fn to_rustc(&self, tcx: TyCtxt<'tcx>) -> Self::T { + rustc_middle::ty::BoundRegion { var: self.var, kind: self.kind.to_rustc(tcx) } } } @@ -1171,7 +1201,7 @@ pub fn region_to_string(region: Region) -> String { format!("{debruijn:?}{region:?}") } BoundRegionKind::ClosureEnv => "'".to_string(), - BoundRegionKind::NamedAnon(sym) => format!("{sym}"), + BoundRegionKind::NamedForPrinting(sym) => format!("{sym}"), } } Region::ReEarlyParam(region) => region.name.to_string(), From aab11d34eca073e3dfe5f0a87b74bfab40db3886 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Feb 2026 14:37:41 +0000 Subject: [PATCH 31/36] Upgrade to nightly-2026-02-01 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2464d06438a..ac019db4c51 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-01-30" +channel = "nightly-2026-02-01" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 9ca0f28e87eca9f1380ec2be2c87ab4d45baf953 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Feb 2026 14:46:52 +0000 Subject: [PATCH 32/36] Upgrade to nightly-2026-02-03 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ac019db4c51..7de4a44edc1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-02-01" +channel = "nightly-2026-02-03" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From 9182f00d433fe0f87440652dc786b5f1ea35286c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Feb 2026 14:58:20 +0000 Subject: [PATCH 33/36] Upgrade to nightly-2026-02-05 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7de4a44edc1..fa8e50a663a 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-02-03" +channel = "nightly-2026-02-05" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From e63d7cb9ae734d98377724b690c146f8f3d3f1fc Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 08:22:20 -0800 Subject: [PATCH 34/36] Fix rustc API change for queries module in nightly-2026-02-05 (#1471) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- crates/flux-driver/src/callbacks.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/flux-driver/src/callbacks.rs b/crates/flux-driver/src/callbacks.rs index d2a2035755b..d4f48515e4e 100644 --- a/crates/flux-driver/src/callbacks.rs +++ b/crates/flux-driver/src/callbacks.rs @@ -24,7 +24,7 @@ use rustc_hir::{ def_id::{LOCAL_CRATE, LocalDefId}, }; use rustc_interface::interface::Compiler; -use rustc_middle::{query, ty::TyCtxt, util}; +use rustc_middle::{queries, ty::TyCtxt, util}; use rustc_session::config::OutputType; use crate::{DEFAULT_LOCALE_RESOURCES, collector::SpecCollector}; @@ -378,7 +378,7 @@ fn trigger_queries(genv: GlobalEnv, def_id: MaybeExternId) -> QueryResult { fn mir_borrowck<'tcx>( tcx: TyCtxt<'tcx>, def_id: LocalDefId, -) -> query::queries::mir_borrowck::ProvidedValue<'tcx> { +) -> queries::mir_borrowck::ProvidedValue<'tcx> { let bodies_with_facts = rustc_borrowck::consumers::get_bodies_with_borrowck_facts( tcx, def_id, From 80d6b28d1555d2b4b55ced5ada20df0b6a75a294 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Feb 2026 16:51:17 +0000 Subject: [PATCH 35/36] Upgrade to nightly-2026-02-07 --- rust-toolchain.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index fa8e50a663a..29e64d0631c 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2026-02-05" +channel = "nightly-2026-02-09" components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"] From fcc31801de18f0a63533db2ebe42744508233b01 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Feb 2026 11:14:19 -0800 Subject: [PATCH 36/36] Adapt flux-driver to rustc ExitCode API changes (#1472) --- crates/flux-driver/src/bin/main.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/flux-driver/src/bin/main.rs b/crates/flux-driver/src/bin/main.rs index 762644d0172..d05d1159275 100644 --- a/crates/flux-driver/src/bin/main.rs +++ b/crates/flux-driver/src/bin/main.rs @@ -2,7 +2,7 @@ extern crate rustc_driver; -use std::{env, io, process::exit}; +use std::{env, io, process::{ExitCode, exit}}; use flux_config::{ self as config, @@ -10,7 +10,7 @@ use flux_config::{ }; use flux_driver::callbacks::FluxCallbacks; use flux_middle::metrics; -use rustc_driver::{EXIT_SUCCESS, catch_with_exit_code, run_compiler}; +use rustc_driver::{catch_with_exit_code, run_compiler}; mod logger; @@ -49,8 +49,12 @@ fn main() -> io::Result<()> { let exit_code = catch_with_exit_code(move || { run_compiler(&args, &mut FluxCallbacks); }); - if config::summary() && exit_code == EXIT_SUCCESS { + if config::summary() && exit_code == ExitCode::SUCCESS { metrics::print_summary(start.elapsed())?; }; - exit(exit_code) + exit(if exit_code == ExitCode::SUCCESS { + rustc_driver::EXIT_SUCCESS + } else { + rustc_driver::EXIT_FAILURE + }) }