Skip to content

Commit a172469

Browse files
Toolchain upgrade to nightly-2025-08-18 (#1249)
* Upgrade to nightly-2025-08-15 * Upgrade to nightly-2025-08-16 * Fix resolution of prelude import * Upgrade to nightly-2025-08-18 * Update z3 for vtock --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Nico Lehmann <[email protected]>
1 parent b091823 commit a172469

File tree

4 files changed

+38
-23
lines changed

4 files changed

+38
-23
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ on:
88
branches: [main]
99
types: [opened, synchronize, reopened, ready_for_review]
1010

11-
concurrency:
12-
group: ${{ github.head_ref || github.run_id }}
13-
cancel-in-progress: true
14-
1511
jobs:
1612
tests:
1713
strategy:
@@ -44,15 +40,11 @@ jobs:
4440
- name: Install fixpoint
4541
uses: ./.github/actions/install-fixpoint
4642

43+
# Older versions hang
4744
- name: Install Z3
4845
uses: cda-tum/[email protected]
4946
with:
50-
version: 4.12.1
51-
52-
- name: Install CVC5
53-
uses: ./.github/actions/install-cvc5
54-
with:
55-
version: 1.2.1
47+
version: 4.15.3
5648

5749
- name: Rust Cache
5850
uses: Swatinem/[email protected]

.github/workflows/upgrade-toolchain.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ jobs:
4444
- name: Cherry pick changes from open PR
4545
run: |
4646
set -eu
47+
cd flux
4748
existing_pr=$(gh pr list --base main --head toolchain-upgrade --state open --json number --jq '.[0].number' || true)
4849
if [ -n "$existing_pr" ]; then
49-
cd flux
5050
git fetch --unshallow origin main toolchain-upgrade
5151
start=$(git merge-base main origin/toolchain-upgrade)
5252
end=origin/toolchain-upgrade

crates/flux-desugar/src/resolver.rs

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ impl<'genv, 'tcx> CrateResolver<'genv, 'tcx> {
121121
let mut definitions = DefinitionMap::default();
122122
for (parent, items) in &self.specs.flux_items_by_parent {
123123
for item in items {
124-
// NOTE: This is putting all items in the same namespace. We could have qualifiers
125-
// in a different namespace.
124+
// NOTE: This is putting all items in the same namespace. In principle, we could have
125+
// qualifiers in a different namespace.
126126
definitions
127127
.define(item.name())
128128
.emit(&self.genv)
@@ -191,8 +191,8 @@ impl<'genv, 'tcx> CrateResolver<'genv, 'tcx> {
191191
hir::UseKind::Glob => {
192192
let is_prelude = is_prelude_import(self.genv.tcx(), item);
193193
for mod_child in self.glob_imports(path) {
194-
if let Some(ns @ (TypeNS | ValueNS)) = mod_child.res.ns()
195-
&& let Ok(res) = fhir::Res::try_from(mod_child.res)
194+
if let Ok(res) = fhir::Res::try_from(mod_child.res)
195+
&& let Some(ns @ (TypeNS | ValueNS)) = res.ns()
196196
{
197197
let name = mod_child.ident.name;
198198
if is_prelude {
@@ -495,14 +495,23 @@ impl<'genv, 'tcx> CrateResolver<'genv, 'tcx> {
495495
}
496496

497497
fn glob_imports(
498-
&self,
498+
&mut self,
499499
path: &hir::UsePath,
500500
) -> impl Iterator<Item = &'tcx ModChild> + use<'tcx> {
501-
let res = path.segments.last().unwrap().res;
502-
501+
// The path for the prelude import is not resolved anymore after <https://github.com/rust-lang/rust/pull/145322>,
502+
// so we resolve all paths here. If this ever causes problems, we could use the resolution in the `UsePath` for
503+
// non-prelude glob imports.
503504
let tcx = self.genv.tcx();
504505
let curr_mod = self.current_module.to_def_id();
505-
if let hir::def::Res::Def(DefKind::Mod, module_id) = res { Some(module_id) } else { None }
506+
self.resolve_path_with_ribs(path.segments, TypeNS)
507+
.and_then(|partial_res| partial_res.full_res())
508+
.and_then(|res| {
509+
if let fhir::Res::Def(DefKind::Mod, module_id) = res {
510+
Some(module_id)
511+
} else {
512+
None
513+
}
514+
})
506515
.into_iter()
507516
.flat_map(move |module_id| visible_module_children(tcx, module_id, curr_mod))
508517
}
@@ -517,8 +526,11 @@ impl<'genv, 'tcx> CrateResolver<'genv, 'tcx> {
517526
match module.kind {
518527
ModuleKind::Mod => {
519528
let module_id = module.def_id;
520-
visible_module_children(tcx, module_id, self.current_module.to_def_id())
521-
.find(|child| child.res.matches_ns(ns) && child.ident == ident)
529+
let current_mod = self.current_module.to_def_id();
530+
visible_module_children(tcx, module_id, current_mod)
531+
.find(|child| {
532+
child.res.matches_ns(ns) && tcx.hygienic_eq(ident, child.ident, current_mod)
533+
})
522534
.and_then(|child| fhir::Res::try_from(child.res).ok())
523535
}
524536
ModuleKind::Trait => {
@@ -702,6 +714,7 @@ impl<'tcx> hir::intravisit::Visitor<'tcx> for CrateResolver<'_, 'tcx> {
702714
}
703715

704716
/// Akin to `rustc_resolve::Module` but specialized to what we support
717+
#[derive(Debug)]
705718
struct Module {
706719
kind: ModuleKind,
707720
def_id: DefId,
@@ -714,6 +727,7 @@ impl Module {
714727
}
715728

716729
/// Akin to `rustc_resolve::ModuleKind` but specialized to what we support
730+
#[derive(Debug)]
717731
enum ModuleKind {
718732
Mod,
719733
Trait,
@@ -767,7 +781,8 @@ fn is_prelude_import(tcx: TyCtxt, item: &hir::Item) -> bool {
767781
.any(|attr| attr.path_matches(&[sym::prelude_import]))
768782
}
769783

770-
/// Abstraction over [`surface::PathSegment`] and [`surface::ExprPathSegment`]
784+
/// Abstraction over a "segment" so we can use [`CrateResolver::resolve_path_with_ribs`] with paths
785+
/// from different sources (e.g., [`surface::PathSegment`], [`surface::ExprPathSegment`])
771786
trait Segment: std::fmt::Debug {
772787
fn record_segment_res(resolver: &mut CrateResolver, segment: &Self, res: fhir::Res);
773788
fn ident(&self) -> Ident;
@@ -802,6 +817,14 @@ impl Segment for Ident {
802817
}
803818
}
804819

820+
impl Segment for hir::PathSegment<'_> {
821+
fn record_segment_res(_resolver: &mut CrateResolver, _segment: &Self, _res: fhir::Res) {}
822+
823+
fn ident(&self) -> Ident {
824+
self.ident
825+
}
826+
}
827+
805828
struct ItemResolver<'a, 'genv, 'tcx> {
806829
resolver: &'a mut CrateResolver<'genv, 'tcx>,
807830
opaque: Option<LocalDefId>, // TODO: HACK! need to generalize to multiple opaque types/impls in a signature.

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2025-08-14"
2+
channel = "nightly-2025-08-18"
33
components = ["rust-src", "rustc-dev", "llvm-tools", "rustfmt", "clippy"]

0 commit comments

Comments
 (0)