diff --git a/flake.lock b/flake.lock index cf8bccd66..ba2824fa7 100644 --- a/flake.lock +++ b/flake.lock @@ -110,11 +110,11 @@ ] }, "locked": { - "lastModified": 1719281921, - "narHash": "sha256-LIBMfhM9pMOlEvBI757GOK5l0R58SRi6YpwfYMbf4yc=", + "lastModified": 1723429325, + "narHash": "sha256-4x/32xTCd+xCwFoI/kKSiCr5LQA2ZlyTRYXKEni5HR8=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b6032d3a404d8a52ecfc8571ff0c26dfbe221d07", + "rev": "65e3dc0fe079fe8df087cd38f1fe6836a0373aad", "type": "github" }, "original": { diff --git a/frontend/exporter/src/traits.rs b/frontend/exporter/src/traits.rs index 18078d319..74feb4296 100644 --- a/frontend/exporter/src/traits.rs +++ b/frontend/exporter/src/traits.rs @@ -454,7 +454,7 @@ pub mod rustc { use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::traits::CodegenObligationError; use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; - use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt; + use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::traits::{ Obligation, ObligationCause, ObligationCtxt, ScrubbedTraitError, SelectionContext, Unimplemented, diff --git a/frontend/exporter/src/types/copied.rs b/frontend/exporter/src/types/copied.rs index 1c6eff188..1b5c8ba07 100644 --- a/frontend/exporter/src/types/copied.rs +++ b/frontend/exporter/src/types/copied.rs @@ -1686,7 +1686,7 @@ pub struct GenericParamDef { match self.kind { ty::GenericParamDefKind::Lifetime => GenericParamDefKind::Lifetime, ty::GenericParamDefKind::Type { has_default, synthetic } => GenericParamDefKind::Type { has_default, synthetic }, - ty::GenericParamDefKind::Const { has_default, is_host_effect } => { + ty::GenericParamDefKind::Const { has_default, is_host_effect, .. } => { let ty = s.base().tcx.type_of(self.def_id).instantiate_identity().sinto(s); GenericParamDefKind::Const { has_default, is_host_effect, ty } }, @@ -2371,7 +2371,8 @@ pub struct AttrItem { #[cfg(feature = "rustc")] impl SInto for rustc_ast::tokenstream::LazyAttrTokenStream { fn sinto(&self, st: &S) -> String { - self.to_attr_token_stream().to_tokenstream().sinto(st) + rustc_ast::tokenstream::TokenStream::new(self.to_attr_token_stream().to_token_trees()) + .sinto(st) } } @@ -2982,6 +2983,25 @@ pub struct AnonConst { pub body: Body, } +/// Reflects [`rustc_hir::ConstArg`] +#[derive_group(Serializers)] +#[derive(AdtInto, Clone, Debug, JsonSchema)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: rustc_hir::ConstArg<'tcx>, state: S as s)] +pub struct ConstArg { + pub hir_id: HirId, + pub kind: ConstArgKind, + pub is_desugared_from_effects: bool, +} + +/// Reflects [`rustc_hir::ConstArgKind`] +#[derive_group(Serializers)] +#[derive(AdtInto, Clone, Debug, JsonSchema)] +#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: rustc_hir::ConstArgKind<'tcx>, state: S as s)] +pub enum ConstArgKind { + Path(QPath), + Anon(AnonConst), +} + /// Reflects [`rustc_hir::GenericParamKind`] #[derive_group(Serializers)] #[derive(AdtInto, Clone, Debug, JsonSchema)] @@ -2997,7 +3017,7 @@ pub enum GenericParamKind { }, Const { ty: Ty, - default: Option>, + default: Option>, }, } @@ -3125,7 +3145,7 @@ pub struct Impl { let (tcx, owner_id) = (s.base().tcx, s.owner_id()); let trait_did = tcx.trait_id_of_impl(owner_id); if let Some(trait_did) = trait_did { - tcx.super_predicates_of(trait_did) + tcx.explicit_super_predicates_of(trait_did) .predicates .iter() .copied() diff --git a/frontend/exporter/src/types/mir.rs b/frontend/exporter/src/types/mir.rs index d3789f54b..0ea0ed120 100644 --- a/frontend/exporter/src/types/mir.rs +++ b/frontend/exporter/src/types/mir.rs @@ -153,7 +153,6 @@ pub struct MirBody { pub spread_arg: Option, pub var_debug_info: Vec, pub span: Span, - pub required_consts: Vec, pub is_polymorphic: bool, pub injection_phase: Option, pub tainted_by_errors: Option, @@ -570,6 +569,11 @@ pub enum TerminatorKind { trait_refs: Vec, trait_info: Option, }, + TailCall { + func: Operand, + args: Vec>, + fn_span: Span, + }, Assert { cond: Operand, expected: bool, diff --git a/frontend/exporter/src/types/todo.rs b/frontend/exporter/src/types/todo.rs index 52a656113..c164478e1 100644 --- a/frontend/exporter/src/types/todo.rs +++ b/frontend/exporter/src/types/todo.rs @@ -15,6 +15,7 @@ sinto_todo!(rustc_hir, GenericArgs<'a> as HirGenericArgs); sinto_todo!(rustc_hir, InlineAsm<'a>); sinto_todo!(rustc_target::spec::abi, Abi); sinto_todo!(rustc_hir, MissingLifetimeKind); +sinto_todo!(rustc_hir, QPath<'tcx>); sinto_todo!(rustc_hir, WhereRegionPredicate<'tcx>); sinto_todo!(rustc_hir, WhereEqPredicate<'tcx>); sinto_todo!(rustc_hir, OwnerId); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 09b19906c..9d093adde 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-06-25" +channel = "nightly-2024-08-11" components = [ "rustc-dev", "llvm-tools-preview" , "rust-analysis" , "rust-src" , "rustfmt" ] diff --git a/test-harness/src/snapshots/toolchain__traits into-fstar.snap b/test-harness/src/snapshots/toolchain__traits into-fstar.snap index 5cf9b7b62..cf3903bb6 100644 --- a/test-harness/src/snapshots/toolchain__traits into-fstar.snap +++ b/test-harness/src/snapshots/toolchain__traits into-fstar.snap @@ -329,11 +329,11 @@ let impl (#v_TypeArg: Type0) (v_ConstArg: usize) : t_Trait Prims.unit v_TypeArg } class t_SubTrait (v_Self: Type0) (v_TypeArg: Type0) (v_ConstArg: usize) = { - [@@@ FStar.Tactics.Typeclasses.no_method]_super_9139092951006237722:t_Trait v_Self + [@@@ FStar.Tactics.Typeclasses.no_method]_super_2645671271498264788:t_Trait v_Self v_TypeArg v_ConstArg; f_AssocType:Type0; - f_AssocType_11599353381930848827:t_Trait f_AssocType v_TypeArg v_ConstArg + f_AssocType_1171953828677564027:t_Trait f_AssocType v_TypeArg v_ConstArg } let associated_function_caller