Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
2a5202f
Upgrade to nightly-2025-10-10
github-actions[bot] Oct 21, 2025
889a598
Upgrade to nightly-2025-10-11
github-actions[bot] Oct 21, 2025
162dbd5
Upgrade to nightly-2025-10-12
github-actions[bot] Oct 21, 2025
262a491
Remove StatementKind::Deinit
nilehmann Oct 21, 2025
1b5dc6d
Upgrade to nightly-2025-10-13
github-actions[bot] Oct 21, 2025
2f6f218
Upgrade to nightly-2025-10-14
github-actions[bot] Oct 21, 2025
0493bc7
Upgrade to nightly-2025-10-15
github-actions[bot] Oct 21, 2025
6f6e337
Upgrade to nightly-2025-10-16
github-actions[bot] Oct 21, 2025
defd504
Upgrade to nightly-2025-10-17
github-actions[bot] Oct 21, 2025
bce6fa5
Upgrade to nightly-2025-10-18
github-actions[bot] Oct 21, 2025
ba9c412
Upgrade to nightly-2025-10-19
github-actions[bot] Oct 21, 2025
f53f701
impl_trait_ref
nilehmann Oct 21, 2025
d410cac
Upgrade to nightly-2025-10-20
github-actions[bot] Oct 22, 2025
fb2bf09
Upgrade to nightly-2025-10-21
github-actions[bot] Oct 22, 2025
3b80a32
Upgrade to nightly-2025-10-22
github-actions[bot] Oct 30, 2025
2558430
Upgrade to nightly-2025-10-23
github-actions[bot] Oct 30, 2025
80c280b
Upgrade to nightly-2025-10-24
github-actions[bot] Oct 30, 2025
e8d511d
Remove NullOp
nilehmann Oct 30, 2025
532b060
Upgrade to nightly-2025-10-25
github-actions[bot] Oct 30, 2025
b90467a
Upgrade to nightly-2025-10-26
github-actions[bot] Oct 30, 2025
fe88fa0
AnnotateSnippetEmitter
nilehmann Nov 4, 2025
fb58ec8
Upgrade to nightly-2025-10-27
github-actions[bot] Nov 4, 2025
f310862
Upgrade to nightly-2025-10-28
github-actions[bot] Nov 4, 2025
637a941
Upgrade to nightly-2025-10-29
github-actions[bot] Nov 4, 2025
c0acdd5
Upgrade to nightly-2025-10-30
github-actions[bot] Nov 4, 2025
0c1727c
Upgrade to nightly-2025-10-31
github-actions[bot] Nov 4, 2025
c3b27bd
Remove hir::QPath::LangItem
nilehmann Nov 6, 2025
6367bc1
Upgrade to nightly-2025-11-01
github-actions[bot] Nov 6, 2025
467f436
Mutability DataflowAnalysis
nilehmann Nov 6, 2025
54ab3c6
Upgrade to nightly-2025-11-02
github-actions[bot] Nov 6, 2025
f22379d
Upgrade to nightly-2025-11-03
github-actions[bot] Nov 6, 2025
fd262fa
Upgrade to nightly-2025-11-04
github-actions[bot] Nov 6, 2025
a31100a
Upgrade to nightly-2025-11-05
github-actions[bot] Nov 6, 2025
0aad7e3
Upgrade to nightly-2025-11-06
github-actions[bot] Nov 6, 2025
ef7ce0f
Upgrade to nightly-2025-11-07
github-actions[bot] Nov 7, 2025
af6a527
Fix emitter creation
nilehmann Nov 11, 2025
1dcbd11
Upgrade to nightly-2025-11-08
github-actions[bot] Nov 11, 2025
57108b7
Upgrade to nightly-2025-11-09
github-actions[bot] Nov 11, 2025
6ff263c
Upgrade to nightly-2025-11-10
github-actions[bot] Nov 11, 2025
1ec7110
ConstItemRhs
nilehmann Nov 11, 2025
80c834b
Upgrade to nightly-2025-11-11
github-actions[bot] Nov 11, 2025
4380444
Upgrade to nightly-2025-11-12
github-actions[bot] Nov 12, 2025
2511587
Upgrade to nightly-2025-11-13
github-actions[bot] Nov 13, 2025
42853dd
Upgrade to nightly-2025-11-14
github-actions[bot] Nov 14, 2025
7eb8194
Upgrade to nightly-2025-11-15
github-actions[bot] Nov 16, 2025
ac279ce
Upgrade to nightly-2025-11-16
github-actions[bot] Nov 16, 2025
0ce1fd9
Upgrade to nightly-2025-11-17
github-actions[bot] Nov 17, 2025
89158b3
Upgrade to nightly-2025-11-18
github-actions[bot] Nov 18, 2025
b2f3de0
Upgrade to nightly-2025-11-19
github-actions[bot] Nov 19, 2025
54db26c
Upgrade to nightly-2025-11-20
github-actions[bot] Nov 21, 2025
aca0528
Upgrade to nightly-2025-11-21
github-actions[bot] Nov 21, 2025
a0bd3cb
Upgrade to nightly-2025-11-22
github-actions[bot] Nov 24, 2025
6f565b6
Upgrade to nightly-2025-11-23
github-actions[bot] Nov 24, 2025
c046111
Upgrade to nightly-2025-11-24
github-actions[bot] Nov 24, 2025
1f10694
Upgrade to nightly-2025-11-25
github-actions[bot] Nov 25, 2025
41a8752
Upgrade to nightly-2025-11-26
github-actions[bot] Dec 3, 2025
4c40425
Upgrade to nightly-2025-11-27
github-actions[bot] Dec 3, 2025
d747220
Upgrade to nightly-2025-11-28
github-actions[bot] Dec 3, 2025
9410ea4
Upgrade to nightly-2025-11-29
github-actions[bot] Dec 3, 2025
109d999
Upgrade to nightly-2025-11-30
github-actions[bot] Dec 3, 2025
20ddd19
Upgrade to nightly-2025-12-01
github-actions[bot] Dec 3, 2025
5b33047
Upgrade to nightly-2025-12-02
github-actions[bot] Dec 4, 2025
d614950
Upgrade to nightly-2025-12-03
github-actions[bot] Dec 4, 2025
18f2e6f
Upgrade to nightly-2025-12-04
github-actions[bot] Dec 4, 2025
e2e773e
Upgrade to nightly-2025-12-05
github-actions[bot] Dec 5, 2025
68f61b6
Upgrade to nightly-2025-12-06
github-actions[bot] Dec 9, 2025
a9ab4d4
ReifyFnPointer
nilehmann Dec 9, 2025
ed85606
Upgrade to nightly-2025-12-07
github-actions[bot] Dec 10, 2025
7399305
Upgrade to nightly-2025-12-08
github-actions[bot] Dec 10, 2025
91385d5
Upgrade to nightly-2025-12-09
github-actions[bot] Dec 10, 2025
d2448b0
BlobDecoder
nilehmann Dec 11, 2025
a6e0b3d
Upgrade to nightly-2025-12-10
github-actions[bot] Dec 12, 2025
8d77c4c
Upgrade to nightly-2025-12-11
github-actions[bot] Dec 12, 2025
90c907a
proc_macro_tracked_path
nilehmann Dec 12, 2025
36f1707
Upgrade to nightly-2025-12-12
github-actions[bot] Dec 15, 2025
672feaa
Upgrade to nightly-2025-12-13
github-actions[bot] Dec 15, 2025
d29722a
Upgrade to nightly-2025-12-14
github-actions[bot] Dec 15, 2025
0ab7eaa
RealFileName
nilehmann Dec 18, 2025
6d955d4
Upgrade to nightly-2025-12-15
github-actions[bot] Dec 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions crates/flux-desugar/src/desugar/lift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,6 @@ impl<'genv> RustItemCtxt<'_, 'genv, '_> {
let segment = self.lift_path_segment(segment)?;
Ok(fhir::QPath::TypeRelative(self.genv.alloc(qself), self.genv.alloc(segment)))
}
hir::QPath::LangItem(_, _) => {
Err(self.emit_unsupported(&format!(
"unsupported type: `{}`",
rustc_hir_pretty::qpath_to_string(&self.genv.tcx(), &qpath)
)))
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/flux-driver/src/callbacks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,11 @@ impl<'genv, 'tcx> CrateChecker<'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;
}
Expand Down
11 changes: 5 additions & 6 deletions crates/flux-driver/src/collector/detached_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,11 @@ impl TraitImplResolver {
for (trait_id, impl_ids) in tcx.all_local_trait_impls(()) {
let trait_ = LookupRes::DefId(*trait_id);
for impl_id in impl_ids {
if let Some(poly_trait_ref) = tcx.impl_trait_ref(*impl_id) {
let self_ty = poly_trait_ref.instantiate_identity().self_ty();
let self_ty = LookupRes::new(&self_ty);
let key = TraitImplKey { trait_, self_ty };
items.insert(key, *impl_id);
}
let poly_trait_ref = tcx.impl_trait_ref(*impl_id);
let self_ty = poly_trait_ref.instantiate_identity().self_ty();
let self_ty = LookupRes::new(&self_ty);
let key = TraitImplKey { trait_, self_ty };
items.insert(key, *impl_id);
}
}
Self { items }
Expand Down
2 changes: 1 addition & 1 deletion crates/flux-driver/src/collector/extern_specs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ impl<'a, 'sess, 'tcx> ExternSpecCollector<'a, 'sess, 'tcx> {
} else {
let opt_extern_impl_id = self.tcx().impl_of_assoc(callee_id);
if let Some(extern_impl_id) = opt_extern_impl_id {
debug_assert!(self.tcx().trait_id_of_impl(extern_impl_id).is_none());
debug_assert!(!self.tcx().impl_is_of_trait(extern_impl_id));
Ok(ExternImplItem { impl_id: extern_impl_id, item_id: callee_id })
} else {
Err(self.invalid_item_in_inherent_impl(item.owner_id, callee_id))
Expand Down
6 changes: 4 additions & 2 deletions crates/flux-driver/src/collector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<'a, 'tcx> SpecCollector<'a, 'tcx> {
ItemKind::TyAlias(..) => self.collect_type_alias(owner_id, attrs)?,
ItemKind::Impl(..) => self.collect_impl(owner_id, attrs)?,
ItemKind::Trait(..) => self.collect_trait(owner_id, attrs)?,
ItemKind::Const(.., body_id) => {
ItemKind::Const(.., rhs) => {
// The flux-rs macro puts defs as an outer attribute on a `const _: () = { }`. We
// consider these defs to be defined in the parent of the const.
self.specs
Expand All @@ -148,7 +148,9 @@ impl<'a, 'tcx> SpecCollector<'a, 'tcx> {
.or_default()
.extend(attrs.items());

if attrs.extern_spec() {
if attrs.extern_spec()
&& let hir::ConstItemRhs::Body(body_id) = rhs
{
return ExternSpecCollector::collect(self, *body_id);
}

Expand Down
102 changes: 74 additions & 28 deletions crates/flux-errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ use flux_common::result::{ErrorCollector, ErrorEmitter};
use rustc_data_structures::sync;
pub use rustc_errors::ErrorGuaranteed;
use rustc_errors::{
Diagnostic, ErrCode, FatalAbort, FatalError, LazyFallbackBundle,
Diagnostic, ErrCode, FatalAbort, FatalError, LazyFallbackBundle, TerminalUrl,
annotate_snippet_emitter_writer::AnnotateSnippetEmitter,
emitter::{Emitter, HumanEmitter, HumanReadableErrorType, stderr_destination},
emitter::{Emitter, HumanEmitter, HumanReadableErrorType, OutputTheme, stderr_destination},
json::JsonEmitter,
translation::Translator,
};
use rustc_session::{
config::{self, ErrorOutputType},
parse::ParseSess,
};
use rustc_session::{config, parse::ParseSess};
use rustc_span::source_map::SourceMap;

pub struct FluxSession {
Expand Down Expand Up @@ -75,43 +72,92 @@ impl FluxSession {
}

fn emitter(
opts: &config::Options,
sopts: &config::Options,
source_map: Arc<SourceMap>,
fallback_fluent_bundle: LazyFallbackBundle,
) -> Box<dyn Emitter + sync::DynSend> {
let track_diagnostics = opts.unstable_opts.track_diagnostics;

let translator = Translator { fluent_bundle: None, fallback_fluent_bundle };
match opts.error_format {
ErrorOutputType::HumanReadable { kind, color_config } => {
if let HumanReadableErrorType::AnnotateSnippet = kind {
let emitter =
AnnotateSnippetEmitter::new(Some(source_map), translator, false, false);
Box::new(emitter)
} else {
let dst = stderr_destination(color_config);
let emitter = HumanEmitter::new(dst, translator)
.sm(Some(source_map))
.short_message(kind.short())
.diagnostic_width(opts.diagnostic_width)
.track_diagnostics(track_diagnostics)
.terminal_url(opts.unstable_opts.terminal_urls);
Box::new(emitter)

// All the code below is copied from rustc_session::session::default_emitter
let macro_backtrace = sopts.unstable_opts.macro_backtrace;
let track_diagnostics = sopts.unstable_opts.track_diagnostics;
let terminal_url = match sopts.unstable_opts.terminal_urls {
TerminalUrl::Auto => {
match (std::env::var("COLORTERM").as_deref(), std::env::var("TERM").as_deref()) {
(Ok("truecolor"), Ok("xterm-256color"))
if sopts.unstable_features.is_nightly_build() =>
{
TerminalUrl::Yes
}
_ => TerminalUrl::No,
}
}
ErrorOutputType::Json { pretty, json_rendered, color_config } => {
t => t,
};

let source_map = if sopts.unstable_opts.link_only { None } else { Some(source_map) };

match sopts.error_format {
config::ErrorOutputType::HumanReadable { kind, color_config } => {
match kind {
HumanReadableErrorType::AnnotateSnippet { short, unicode } => {
let emitter =
AnnotateSnippetEmitter::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(if unicode { OutputTheme::Unicode } else { 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))
}
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 } => {
Box::new(
JsonEmitter::new(
Box::new(io::BufWriter::new(io::stderr())),
Some(source_map),
source_map,
translator,
pretty,
json_rendered,
color_config,
)
.ui_testing(sopts.unstable_opts.ui_testing)
.ignored_directories_in_source_blocks(
sopts
.unstable_opts
.ignore_directory_in_diagnostics_source_blocks
.clone(),
)
.diagnostic_width(sopts.diagnostic_width)
.macro_backtrace(macro_backtrace)
.track_diagnostics(track_diagnostics)
.diagnostic_width(opts.diagnostic_width)
.terminal_url(opts.unstable_opts.terminal_urls),
.terminal_url(terminal_url),
)
}
}
Expand Down
22 changes: 6 additions & 16 deletions crates/flux-fhir-analysis/src/conv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
let assoc_segment =
fhir::PathSegment { args: &[], constraints: &[], ident, res: fhir::Res::Err };
let mut env = Env::empty();
let alias_ty =
self.conv_type_relative_type_path(&mut env, ident.span, res, &assoc_segment)?;
let alias_ty = self.conv_type_relative_type_path(&mut env, res, &assoc_segment)?;
return Ok(rty::Sort::Alias(rty::AliasKind::Projection, alias_ty));
}
fhir::SortRes::PrimSort(fhir::PrimSort::Set) => {
Expand Down Expand Up @@ -1433,7 +1432,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
let qself_res =
if let Some(path) = qself.as_path() { path.res } else { fhir::Res::Err };
let alias_ty = self
.conv_type_relative_type_path(env, qself.span, qself_res, segment)?
.conv_type_relative_type_path(env, qself_res, segment)?
.shift_in_escaping(1);
let bty = rty::BaseTy::Alias(rty::AliasKind::Projection, alias_ty);
let sort = bty.sort();
Expand All @@ -1454,18 +1453,14 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
fn conv_type_relative_path<Tag: AssocItemTag>(
&mut self,
tag: Tag,
qself_span: Span,
qself_res: fhir::Res,
assoc_ident: Ident,
) -> QueryResult<(Tag::AssocItem<'tcx>, rty::TraitRef)> {
let tcx = self.tcx();

let bound = match qself_res {
fhir::Res::SelfTyAlias { alias_to: impl_def_id, is_trait_impl: true } => {
let Some(trait_ref) = tcx.impl_trait_ref(impl_def_id) else {
// A cycle error occurred most likely (comment copied from rustc)
span_bug!(qself_span, "expected cycle error");
};
let trait_ref = tcx.impl_trait_ref(impl_def_id);

self.probe_single_bound_for_assoc_item(
|| {
Expand Down Expand Up @@ -1525,16 +1520,11 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
fn conv_type_relative_type_path(
&mut self,
env: &mut Env,
qself_span: Span,
qself_res: fhir::Res,
assoc_segment: &fhir::PathSegment,
) -> QueryResult<rty::AliasTy> {
let (assoc_item, trait_ref) = self.conv_type_relative_path(
AssocTag::Type,
qself_span,
qself_res,
assoc_segment.ident,
)?;
let (assoc_item, trait_ref) =
self.conv_type_relative_path(AssocTag::Type, qself_res, assoc_segment.ident)?;

let assoc_id = assoc_item.def_id;
let mut args = trait_ref.args.to_vec();
Expand Down Expand Up @@ -2475,7 +2465,7 @@ impl<'genv, 'tcx: 'genv, P: ConvPhase<'genv, 'tcx>> ConvCtxt<P> {
let qself_res =
if let Some(path) = qself.as_path() { path.res } else { fhir::Res::Err };
let (assoc_reft, trait_ref) =
self.conv_type_relative_path(AssocReftTag, qself.span, qself_res, *name)?;
self.conv_type_relative_path(AssocReftTag, qself_res, *name)?;
rty::AliasReft { assoc_id: assoc_reft.def_id, args: trait_ref.args }
}
};
Expand Down
8 changes: 4 additions & 4 deletions crates/flux-infer/src/lean_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ impl<'genv, 'tcx> LeanEncoder<'genv, 'tcx> {
let path = genv
.tcx()
.sess
.opts
.working_dir
.local_path_if_available()
.to_path_buf()
.source_map()
.working_dir()
.local_path()
.unwrap()
.join(config::lean_dir());
let project = config::lean_project().to_string();
Self { genv, path, project, defs_file_name, pretty_var_map }
Expand Down
6 changes: 1 addition & 5 deletions crates/flux-infer/src/projections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,7 @@ impl<'a, 'infcx, 'genv, 'tcx> Normalizer<'a, 'infcx, 'genv, 'tcx> {
// IntoIter<{v. i32[v] | v > 0}, Global> MATCH IntoIter<T, A>
// => {T -> {v. i32[v] | v > 0}, A -> Global}

let impl_trait_ref = self
.genv()
.impl_trait_ref(impl_def_id)?
.unwrap()
.skip_binder();
let impl_trait_ref = self.genv().impl_trait_ref(impl_def_id)?.skip_binder();

let generics = self.tcx().generics_of(impl_def_id);

Expand Down
24 changes: 15 additions & 9 deletions crates/flux-macros/src/diagnostics/fluent.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 7 additions & 1 deletion crates/flux-macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Loading