Skip to content

Commit fc5af67

Browse files
committed
Update rustc again
1 parent 75546c3 commit fc5af67

File tree

8 files changed

+17
-45
lines changed

8 files changed

+17
-45
lines changed

engine/lib/import_thir.ml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ and c_item_unwrapped ~ident ~type_only (item : Thir.item) : item list =
16411641
let variants = [ v ] in
16421642
let name = Concrete_ident.of_def_id ~value:false def_id in
16431643
mk @@ Type { name; generics; variants; is_struct }
1644-
| Trait (No, safety, _, generics, _bounds, items) ->
1644+
| Trait (NotConst, No, safety, _, generics, _bounds, items) ->
16451645
let items =
16461646
List.filter
16471647
~f:(fun { attributes; _ } -> not (should_skip attributes))
@@ -1664,8 +1664,10 @@ and c_item_unwrapped ~ident ~type_only (item : Thir.item) : item list =
16641664
let items = List.map ~f:c_trait_item items in
16651665
let safety = csafety safety in
16661666
mk @@ Trait { name; generics; items; safety }
1667-
| Trait (Yes, _, _, _, _, _) ->
1667+
| Trait (_, Yes, _, _, _, _, _) ->
16681668
unimplemented ~issue_id:930 [ item.span ] "Auto trait"
1669+
| Trait (Const, _, _, _, _, _, _) ->
1670+
unimplemented ~issue_id:930 [ item.span ] "Const trait"
16691671
| Impl { of_trait = None; generics; items; _ } ->
16701672
let items =
16711673
List.filter

frontend/exporter/src/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub fn comments_of_file(path: PathBuf) -> std::io::Result<Vec<(Span, String)>> {
2121

2222
let mut comments = vec![];
2323
let (mut pos, mut line, mut col) = (0, 0, 0);
24-
for token in rustc_lexer::tokenize(source) {
24+
for token in rustc_lexer::tokenize(source, rustc_lexer::FrontmatterAllowed::Yes) {
2525
let len = token.len as usize;
2626
let sub = &source[pos..(pos + len)];
2727
let lo = Loc { line, col };

frontend/exporter/src/sinto.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use crate::prelude::{derive_group, JsonSchema};
2-
31
#[cfg(not(feature = "rustc"))]
42
pub trait SInto<S, To> {
53
fn sinto(&self, s: &S) -> To;
@@ -45,20 +43,6 @@ macro_rules! sinto_as_usize {
4543
}
4644
}
4745

48-
#[allow(dead_code)]
49-
mod test {
50-
#[derive(Debug)]
51-
pub struct Foo(usize);
52-
impl Foo {
53-
pub fn as_usize(&self) -> usize {
54-
self.0
55-
}
56-
}
57-
}
58-
59-
sinto_todo!(test, Foo);
60-
// sinto_as_usize!(test, Foo);
61-
6246
impl<S, LL, RR, L: SInto<S, LL>, R: SInto<S, RR>> SInto<S, (LL, RR)> for (L, R) {
6347
fn sinto(&self, s: &S) -> (LL, RR) {
6448
(self.0.sinto(s), self.1.sinto(s))

frontend/exporter/src/types/hir.rs

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ pub struct Generics<Body: IsBody> {
225225
}
226226

227227
#[cfg(feature = "rustc")]
228-
impl<'tcx, S: UnderOwnerState<'tcx>, Body: IsBody> SInto<S, ImplItem<Body>> for hir::ImplItemRef {
228+
impl<'tcx, S: UnderOwnerState<'tcx>, Body: IsBody> SInto<S, ImplItem<Body>> for hir::ImplItemId {
229229
fn sinto(&self, s: &S) -> ImplItem<Body> {
230230
let tcx: rustc_middle::ty::TyCtxt = s.base().tcx;
231-
let impl_item = tcx.hir_impl_item(self.id);
231+
let impl_item = tcx.hir_impl_item(*self);
232232
let s = with_owner_id(s.base(), (), (), impl_item.owner_id.to_def_id());
233233
impl_item.sinto(&s)
234234
}
@@ -393,17 +393,6 @@ pub enum ImplItemKind<Body: IsBody> {
393393
},
394394
}
395395

396-
/// Reflects [`hir::AssocItemKind`]
397-
#[derive(AdtInto)]
398-
#[args(<'tcx, S: UnderOwnerState<'tcx>>, from: hir::AssocItemKind, state: S as tcx)]
399-
#[derive_group(Serializers)]
400-
#[derive(Clone, Debug, JsonSchema)]
401-
pub enum AssocItemKind {
402-
Const,
403-
Fn { has_self: bool },
404-
Type,
405-
}
406-
407396
/// Reflects [`hir::Impl`].
408397
#[derive(AdtInto)]
409398
#[args(<'tcx, S: UnderOwnerState<'tcx> >, from: hir::Impl<'tcx>, state: S as s)]
@@ -674,6 +663,7 @@ pub enum ItemKind<Body: IsBody> {
674663
Struct(Ident, Generics<Body>, VariantData),
675664
Union(Ident, Generics<Body>, VariantData),
676665
Trait(
666+
Constness,
677667
IsAuto,
678668
Safety,
679669
Ident,
@@ -741,11 +731,11 @@ impl<'tcx, S: UnderOwnerState<'tcx>, Body: IsBody> SInto<S, EnumDef<Body>> for h
741731
}
742732

743733
#[cfg(feature = "rustc")]
744-
impl<'a, S: UnderOwnerState<'a>, Body: IsBody> SInto<S, TraitItem<Body>> for hir::TraitItemRef {
734+
impl<'a, S: UnderOwnerState<'a>, Body: IsBody> SInto<S, TraitItem<Body>> for hir::TraitItemId {
745735
fn sinto(&self, s: &S) -> TraitItem<Body> {
746-
let s = with_owner_id(s.base(), (), (), self.id.owner_id.to_def_id());
736+
let s = with_owner_id(s.base(), (), (), self.owner_id.to_def_id());
747737
let tcx: rustc_middle::ty::TyCtxt = s.base().tcx;
748-
tcx.hir_trait_item(self.id).sinto(&s)
738+
tcx.hir_trait_item(*self).sinto(&s)
749739
}
750740
}
751741

@@ -785,10 +775,10 @@ pub struct ForeignItem<Body: IsBody> {
785775
}
786776

787777
#[cfg(feature = "rustc")]
788-
impl<'a, S: UnderOwnerState<'a>, Body: IsBody> SInto<S, ForeignItem<Body>> for hir::ForeignItemRef {
778+
impl<'a, S: UnderOwnerState<'a>, Body: IsBody> SInto<S, ForeignItem<Body>> for hir::ForeignItemId {
789779
fn sinto(&self, s: &S) -> ForeignItem<Body> {
790780
let tcx: rustc_middle::ty::TyCtxt = s.base().tcx;
791-
tcx.hir_foreign_item(self.id).sinto(s)
781+
tcx.hir_foreign_item(*self).sinto(s)
792782
}
793783
}
794784

@@ -925,7 +915,7 @@ impl<'tcx, S: BaseState<'tcx>, Body: IsBody> SInto<S, Item<Body>> for hir::Item<
925915
| Enum(i, ..)
926916
| Struct(i, ..)
927917
| Union(i, ..)
928-
| Trait(_, _, i, ..)
918+
| Trait(_, _, _, i, ..)
929919
| TraitAlias(i, ..) => i.name.to_ident_string(),
930920
Use(..) | ForeignMod { .. } | GlobalAsm { .. } | Impl { .. } => String::new(),
931921
};

frontend/exporter/src/types/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// There's a conflict between `mir::ScalarInt`and `todo::ScalarInt` but it doesn't matter.
2-
#![allow(ambiguous_glob_reexports)]
3-
41
mod def_id;
52
mod hir;
63
mod mir;

frontend/exporter/src/types/new/full_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ fn get_foreign_mod_children<'tcx>(tcx: ty::TyCtxt<'tcx>, def_id: RDefId) -> Vec<
735735
.expect_foreign_mod()
736736
.1
737737
.iter()
738-
.map(|foreign_item_ref| foreign_item_ref.id.owner_id.to_def_id())
738+
.map(|foreign_item_ref| foreign_item_ref.owner_id.to_def_id())
739739
.collect(),
740740
None => vec![],
741741
}

frontend/exporter/src/types/ty.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,8 +1085,6 @@ pub enum PointerCoercion {
10851085
Unsize,
10861086
}
10871087

1088-
sinto_todo!(rustc_middle::ty, ScalarInt);
1089-
10901088
/// Reflects [`ty::FnSig`]
10911089
#[derive_group(Serializers)]
10921090
#[derive(AdtInto, Clone, Debug, JsonSchema, Hash, PartialEq, Eq, PartialOrd, Ord)]
@@ -1231,6 +1229,7 @@ pub enum ClauseKind {
12311229
WellFormed(Term),
12321230
ConstEvaluatable(ConstantExpr),
12331231
HostEffect(HostEffectPredicate),
1232+
UnstableFeature(Symbol),
12341233
}
12351234

12361235
sinto_todo!(rustc_middle::ty, HostEffectPredicate<'tcx>);

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-07-08"
2+
channel = "nightly-2025-07-20"
33
components = [ "rustc-dev", "llvm-tools-preview" , "rust-analysis" , "rust-src" , "rustfmt" ]

0 commit comments

Comments
 (0)