Skip to content

Commit

Permalink
Merge pull request #838 from Nadrieril/update-rustc
Browse files Browse the repository at this point in the history
Bump rustc version
  • Loading branch information
W95Psp committed Aug 14, 2024
2 parents bea9074 + 25223de commit 208fbd6
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 12 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/exporter/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
28 changes: 24 additions & 4 deletions frontend/exporter/src/types/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
},
Expand Down Expand Up @@ -2371,7 +2371,8 @@ pub struct AttrItem {
#[cfg(feature = "rustc")]
impl<S> SInto<S, String> 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)
}
}

Expand Down Expand Up @@ -2982,6 +2983,25 @@ pub struct AnonConst<Body: IsBody> {
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<Body: IsBody> {
pub hir_id: HirId,
pub kind: ConstArgKind<Body>,
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<Body: IsBody> {
Path(QPath),
Anon(AnonConst<Body>),
}

/// Reflects [`rustc_hir::GenericParamKind`]
#[derive_group(Serializers)]
#[derive(AdtInto, Clone, Debug, JsonSchema)]
Expand All @@ -2997,7 +3017,7 @@ pub enum GenericParamKind<Body: IsBody> {
},
Const {
ty: Ty,
default: Option<AnonConst<Body>>,
default: Option<ConstArg<Body>>,
},
}

Expand Down Expand Up @@ -3125,7 +3145,7 @@ pub struct Impl<Body: IsBody> {
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()
Expand Down
6 changes: 5 additions & 1 deletion frontend/exporter/src/types/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ pub struct MirBody<KIND> {
pub spread_arg: Option<Local>,
pub var_debug_info: Vec<VarDebugInfo>,
pub span: Span,
pub required_consts: Vec<Constant>,
pub is_polymorphic: bool,
pub injection_phase: Option<MirPhase>,
pub tainted_by_errors: Option<ErrorGuaranteed>,
Expand Down Expand Up @@ -570,6 +569,11 @@ pub enum TerminatorKind {
trait_refs: Vec<ImplExpr>,
trait_info: Option<ImplExpr>,
},
TailCall {
func: Operand,
args: Vec<Spanned<Operand>>,
fn_span: Span,
},
Assert {
cond: Operand,
expected: bool,
Expand Down
1 change: 1 addition & 0 deletions frontend/exporter/src/types/todo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -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" ]
4 changes: 2 additions & 2 deletions test-harness/src/snapshots/toolchain__traits into-fstar.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 208fbd6

Please sign in to comment.