Skip to content

Commit 886b48c

Browse files
authored
Merge pull request #1214 from soteria-tools/update-rustc
Bump rustc to 2026-04-18
2 parents 8e3f8c4 + 42836b3 commit 886b48c

55 files changed

Lines changed: 2207 additions & 2370 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

charon-ml/src/CharonVersion.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
(* This is an automatically generated file, generated from `charon/Cargo.toml`. *)
22
(* To re-generate this file, rune `make` in the root directory *)
3-
let supported_charon_version = "0.1.207"
3+
let supported_charon_version = "0.1.208"

charon-ml/src/generated/Generated_Meta.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ and attribute =
5757
| AttrVariantsSuffix of string
5858
(** Same as [VariantsPrefix], but appends to the name instead of
5959
pre-pending. *)
60+
| AttrTransparent
61+
(** The structure is treated as a transparent wrapper around its sole
62+
field. Written [#[charon::transparent]]. *)
6063
| AttrDocComment of string (** A doc-comment such as [/// ...]. *)
6164
| AttrUnknown of raw_attribute (** A non-charon-specific attribute. *)
6265

charon-ml/src/generated/Generated_OfJson.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,7 @@ and attribute_of_json (ctx : of_json_ctx) (js : json) :
19541954
| `Assoc [ ("VariantsSuffix", variants_suffix) ] ->
19551955
let* variants_suffix = string_of_json ctx variants_suffix in
19561956
Ok (AttrVariantsSuffix variants_suffix)
1957+
| `String "Transparent" -> Ok AttrTransparent
19571958
| `Assoc [ ("DocComment", doc_comment) ] ->
19581959
let* doc_comment = string_of_json ctx doc_comment in
19591960
Ok (AttrDocComment doc_comment)

charon-ml/src/generated/Generated_OfPostcard.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,10 +1714,11 @@ and attribute_of_postcard (ctx : of_postcard_ctx) (st : postcard_state) :
17141714
| 4 ->
17151715
let* x_0 = string_of_postcard ctx st in
17161716
Ok (AttrVariantsSuffix x_0)
1717-
| 5 ->
1717+
| 5 -> Ok AttrTransparent
1718+
| 6 ->
17181719
let* x_0 = string_of_postcard ctx st in
17191720
Ok (AttrDocComment x_0)
1720-
| 6 ->
1721+
| 7 ->
17211722
let* x_0 = raw_attribute_of_postcard ctx st in
17221723
Ok (AttrUnknown x_0)
17231724
| _ -> Error ("unknown enum variant tag: " ^ string_of_int __tag))

charon/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charon/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tracing = { version = "0.1", features = ["max_level_trace"] }
2525

2626
[package]
2727
name = "charon"
28-
version = "0.1.207"
28+
version = "0.1.208"
2929
authors.workspace = true
3030
edition.workspace = true
3131
license.workspace = true

charon/rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2026-02-22"
2+
channel = "nightly-2026-04-18"
33
components = [ "rustc-dev", "llvm-tools-preview", "rust-src", "miri" ]
44
targets = [ "x86_64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-pc-windows-msvc", "aarch64-apple-darwin", "i686-unknown-linux-gnu", "powerpc64-unknown-linux-gnu", "riscv64gc-unknown-none-elf" ]

charon/rustc_trait_elaboration/src/elaboration.rs

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ impl<'tcx> PredicateSearcher<'tcx> {
120120
let initial_self_pred = initial_self_pred(tcx, owner_id);
121121
let mut out = Self {
122122
elab_ctx,
123-
typing_env: TypingEnv {
124-
param_env: tcx.param_env(owner_id),
125-
typing_mode: TypingMode::PostAnalysis,
126-
},
123+
typing_env: TypingEnv::new(tcx.param_env(owner_id), TypingMode::PostAnalysis),
127124
candidates: Default::default(),
128125
implicit_self_clause: initial_self_pred.is_some(),
129126
item_refs_cache: Default::default(),
@@ -219,25 +216,32 @@ impl<'tcx> PredicateSearcher<'tcx> {
219216
let elab_ctx = self.elab_ctx;
220217
let tcx = self.elab_ctx.tcx;
221218
// Note: We skip a binder but rebind it just after.
222-
let TyKind::Alias(AliasTyKind::Projection, alias_ty) = ty.skip_binder().kind() else {
219+
let TyKind::Alias(
220+
alias @ ty::AliasTy {
221+
kind: AliasTyKind::Projection { def_id, .. },
222+
args,
223+
..
224+
},
225+
) = ty.skip_binder().kind()
226+
else {
223227
return;
224228
};
225-
let trait_ref = ty.rebind(alias_ty.trait_ref(tcx)).upcast(tcx);
229+
let trait_ref = ty.rebind(alias.trait_ref(tcx)).upcast(tcx);
226230

227231
// The predicate we're looking for is is `<T as Trait>::Type: OtherTrait`. We try to solve
228232
// `T as Trait` and add all the bounds on `Trait::Type` to our context.
229233
let proof = self.resolve(&trait_ref);
230234
if matches!(proof.kind, TraitProofKind::Error(_)) {
231235
return;
232236
}
233-
let item_ref = self.resolve_item_reference(alias_ty.def_id, alias_ty.args, true);
237+
let item_ref = self.resolve_item_reference(*def_id, args, true);
234238

235239
// The bounds that hold on the associated type.
236-
let item_bounds = ItemPredicates::implied(self.elab_ctx, alias_ty.def_id);
240+
let item_bounds = ItemPredicates::implied(self.elab_ctx, *def_id);
237241
let item_bounds = item_bounds
238242
.iter_trait_clauses()
239243
// Substitute the item generics
240-
.map(|(_, tref)| EarlyBinder::bind(tref).instantiate(tcx, alias_ty.args))
244+
.map(|(_, tref)| EarlyBinder::bind(tref).instantiate(tcx, args))
241245
.enumerate();
242246

243247
// Add all the bounds on the corresponding associated item.
@@ -345,8 +349,8 @@ impl<'tcx> PredicateSearcher<'tcx> {
345349
let ty =
346350
Ty::new_projection(tcx, assoc.def_id, erased_tref.skip_binder().args);
347351
let ty = crate::erase_and_norm(tcx, self.typing_env, ty);
348-
if let TyKind::Alias(_, alias_ty) = ty.kind()
349-
&& alias_ty.def_id == assoc.def_id
352+
if let TyKind::Alias(alias_ty) = ty.kind()
353+
&& alias_ty.kind.def_id() == assoc.def_id
350354
{
351355
// Couldn't normalize the type to anything different than itself;
352356
// this must be a built-in associated type such as

charon/rustc_trait_elaboration/src/predicates.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ impl<'tcx> ItemPredicates<'tcx> {
212212
let options = elab_ctx.bounds_options();
213213
let def_kind = tcx.def_kind(def_id);
214214
let mut predicates = match def_kind {
215-
AssocConst
215+
AssocConst { .. }
216216
| AssocFn
217217
| AssocTy
218-
| Const
218+
| Const { .. }
219219
| Enum
220220
| Fn
221221
| ForeignTy
@@ -398,6 +398,13 @@ fn inherits_parent_clauses<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> bool {
398398
use DefKind::*;
399399
matches!(
400400
tcx.def_kind(def_id),
401-
AnonConst | AssocConst | AssocFn | AssocTy | Closure | Ctor(..) | InlineConst | Variant
401+
AnonConst
402+
| AssocConst { .. }
403+
| AssocFn
404+
| AssocTy
405+
| Closure
406+
| Ctor(..)
407+
| InlineConst
408+
| Variant
402409
)
403410
}

charon/src/ast/meta.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ pub enum Attribute {
127127
VariantsPrefix(String),
128128
/// Same as `VariantsPrefix`, but appends to the name instead of pre-pending.
129129
VariantsSuffix(String),
130+
/// The structure is treated as a transparent wrapper around its sole field.
131+
/// Written `#[charon::transparent]`.
132+
Transparent,
130133
/// A doc-comment such as `/// ...`.
131134
DocComment(String),
132135
/// A non-charon-specific attribute.

0 commit comments

Comments
 (0)