Skip to content

Commit 46aae25

Browse files
committed
Revert to d60b29d
1 parent ea09825 commit 46aae25

File tree

1,027 files changed

+19997
-25940
lines changed

Some content is hidden

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

1,027 files changed

+19997
-25940
lines changed

.editorconfig

-21
This file was deleted.

Cargo.lock

+14-19
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
496496

497497
[[package]]
498498
name = "chalk-derive"
499-
version = "0.55.0"
499+
version = "0.36.0"
500500
source = "registry+https://github.com/rust-lang/crates.io-index"
501-
checksum = "3983193cacd81f0f924acb666b7fe5e1a0d81db9f113fa69203eda7ea8ce8b6c"
501+
checksum = "9f88ce4deae1dace71e49b7611cfae2d5489de3530d6daba5758043c47ac3a10"
502502
dependencies = [
503503
"proc-macro2",
504504
"quote",
@@ -508,9 +508,9 @@ dependencies = [
508508

509509
[[package]]
510510
name = "chalk-engine"
511-
version = "0.55.0"
511+
version = "0.36.0"
512512
source = "registry+https://github.com/rust-lang/crates.io-index"
513-
checksum = "05a171ce5abbf0fbd06f221ab80ab182c7ef78603d23b858bc44e7ce8a86a396"
513+
checksum = "0e34c9b1b10616782143d7f49490f91ae94afaf2202de3ab0b2835e78b4f0ccc"
514514
dependencies = [
515515
"chalk-derive",
516516
"chalk-ir",
@@ -521,20 +521,19 @@ dependencies = [
521521

522522
[[package]]
523523
name = "chalk-ir"
524-
version = "0.55.0"
524+
version = "0.36.0"
525525
source = "registry+https://github.com/rust-lang/crates.io-index"
526-
checksum = "a522f53af971e7678f472d687e053120157b3ae26e2ebd5ecbc0f5ab124f2cb6"
526+
checksum = "63362c629c2014ab639b04029070763fb8224df136d1363d30e9ece4c8877da3"
527527
dependencies = [
528-
"bitflags",
529528
"chalk-derive",
530529
"lazy_static",
531530
]
532531

533532
[[package]]
534533
name = "chalk-solve"
535-
version = "0.55.0"
534+
version = "0.36.0"
536535
source = "registry+https://github.com/rust-lang/crates.io-index"
537-
checksum = "cdf79fb77a567e456a170f7ec84ea6584163d4ba3f13660cd182013d34ca667c"
536+
checksum = "cac338a67af52a7f50bb2f8232e730a3518ce432dbe303246acfe525ddd838c7"
538537
dependencies = [
539538
"chalk-derive",
540539
"chalk-ir",
@@ -576,7 +575,7 @@ dependencies = [
576575

577576
[[package]]
578577
name = "clippy"
579-
version = "0.1.52"
578+
version = "0.1.51"
580579
dependencies = [
581580
"cargo_metadata 0.12.0",
582581
"clippy-mini-macro-test",
@@ -597,7 +596,7 @@ version = "0.2.0"
597596

598597
[[package]]
599598
name = "clippy_lints"
600-
version = "0.1.52"
599+
version = "0.1.51"
601600
dependencies = [
602601
"cargo_metadata 0.12.0",
603602
"if_chain",
@@ -726,9 +725,9 @@ dependencies = [
726725

727726
[[package]]
728727
name = "const_fn"
729-
version = "0.4.3"
728+
version = "0.4.2"
730729
source = "registry+https://github.com/rust-lang/crates.io-index"
731-
checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab"
730+
checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
732731

733732
[[package]]
734733
name = "constant_time_eq"
@@ -1784,9 +1783,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
17841783

17851784
[[package]]
17861785
name = "libc"
1787-
version = "0.2.85"
1786+
version = "0.2.79"
17881787
source = "registry+https://github.com/rust-lang/crates.io-index"
1789-
checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
1788+
checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743"
17901789
dependencies = [
17911790
"rustc-std-workspace-core",
17921791
]
@@ -3582,7 +3581,6 @@ dependencies = [
35823581
"rustc_errors",
35833582
"rustc_expand",
35843583
"rustc_feature",
3585-
"rustc_lexer",
35863584
"rustc_parse",
35873585
"rustc_parse_format",
35883586
"rustc_session",
@@ -3627,7 +3625,6 @@ version = "0.0.0"
36273625
dependencies = [
36283626
"bitflags",
36293627
"cc",
3630-
"itertools 0.9.0",
36313628
"jobserver",
36323629
"libc",
36333630
"memmap",
@@ -3914,7 +3911,6 @@ dependencies = [
39143911
"rustc_index",
39153912
"rustc_middle",
39163913
"rustc_parse_format",
3917-
"rustc_serialize",
39183914
"rustc_session",
39193915
"rustc_span",
39203916
"rustc_target",
@@ -4317,7 +4313,6 @@ dependencies = [
43174313
"chalk-ir",
43184314
"chalk-solve",
43194315
"rustc_ast",
4320-
"rustc_attr",
43214316
"rustc_data_structures",
43224317
"rustc_hir",
43234318
"rustc_index",

compiler/rustc_ast/src/ast.rs

+35-64
Original file line numberDiff line numberDiff line change
@@ -2655,36 +2655,6 @@ impl Default for FnHeader {
26552655
}
26562656
}
26572657

2658-
#[derive(Clone, Encodable, Decodable, Debug)]
2659-
pub struct TraitKind(
2660-
pub IsAuto,
2661-
pub Unsafe,
2662-
pub Generics,
2663-
pub GenericBounds,
2664-
pub Vec<P<AssocItem>>,
2665-
);
2666-
2667-
#[derive(Clone, Encodable, Decodable, Debug)]
2668-
pub struct TyAliasKind(pub Defaultness, pub Generics, pub GenericBounds, pub Option<P<Ty>>);
2669-
2670-
#[derive(Clone, Encodable, Decodable, Debug)]
2671-
pub struct ImplKind {
2672-
pub unsafety: Unsafe,
2673-
pub polarity: ImplPolarity,
2674-
pub defaultness: Defaultness,
2675-
pub constness: Const,
2676-
pub generics: Generics,
2677-
2678-
/// The trait being implemented, if any.
2679-
pub of_trait: Option<TraitRef>,
2680-
2681-
pub self_ty: P<Ty>,
2682-
pub items: Vec<P<AssocItem>>,
2683-
}
2684-
2685-
#[derive(Clone, Encodable, Decodable, Debug)]
2686-
pub struct FnKind(pub Defaultness, pub FnSig, pub Generics, pub Option<P<Block>>);
2687-
26882658
#[derive(Clone, Encodable, Decodable, Debug)]
26892659
pub enum ItemKind {
26902660
/// An `extern crate` item, with the optional *original* crate name if the crate was renamed.
@@ -2706,7 +2676,7 @@ pub enum ItemKind {
27062676
/// A function declaration (`fn`).
27072677
///
27082678
/// E.g., `fn foo(bar: usize) -> usize { .. }`.
2709-
Fn(Box<FnKind>),
2679+
Fn(Defaultness, FnSig, Generics, Option<P<Block>>),
27102680
/// A module declaration (`mod`).
27112681
///
27122682
/// E.g., `mod foo;` or `mod foo { .. }`.
@@ -2720,7 +2690,7 @@ pub enum ItemKind {
27202690
/// A type alias (`type`).
27212691
///
27222692
/// E.g., `type Foo = Bar<u8>;`.
2723-
TyAlias(Box<TyAliasKind>),
2693+
TyAlias(Defaultness, Generics, GenericBounds, Option<P<Ty>>),
27242694
/// An enum definition (`enum`).
27252695
///
27262696
/// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
@@ -2736,15 +2706,27 @@ pub enum ItemKind {
27362706
/// A trait declaration (`trait`).
27372707
///
27382708
/// E.g., `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`.
2739-
Trait(Box<TraitKind>),
2709+
Trait(IsAuto, Unsafe, Generics, GenericBounds, Vec<P<AssocItem>>),
27402710
/// Trait alias
27412711
///
27422712
/// E.g., `trait Foo = Bar + Quux;`.
27432713
TraitAlias(Generics, GenericBounds),
27442714
/// An implementation.
27452715
///
27462716
/// E.g., `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`.
2747-
Impl(Box<ImplKind>),
2717+
Impl {
2718+
unsafety: Unsafe,
2719+
polarity: ImplPolarity,
2720+
defaultness: Defaultness,
2721+
constness: Const,
2722+
generics: Generics,
2723+
2724+
/// The trait being implemented, if any.
2725+
of_trait: Option<TraitRef>,
2726+
2727+
self_ty: P<Ty>,
2728+
items: Vec<P<AssocItem>>,
2729+
},
27482730
/// A macro invocation.
27492731
///
27502732
/// E.g., `foo!(..)`.
@@ -2754,9 +2736,6 @@ pub enum ItemKind {
27542736
MacroDef(MacroDef),
27552737
}
27562738

2757-
#[cfg(target_arch = "x86_64")]
2758-
rustc_data_structures::static_assert_size!(ItemKind, 112);
2759-
27602739
impl ItemKind {
27612740
pub fn article(&self) -> &str {
27622741
use ItemKind::*;
@@ -2791,14 +2770,14 @@ impl ItemKind {
27912770

27922771
pub fn generics(&self) -> Option<&Generics> {
27932772
match self {
2794-
Self::Fn(box FnKind(_, _, generics, _))
2795-
| Self::TyAlias(box TyAliasKind(_, generics, ..))
2773+
Self::Fn(_, _, generics, _)
2774+
| Self::TyAlias(_, generics, ..)
27962775
| Self::Enum(_, generics)
27972776
| Self::Struct(_, generics)
27982777
| Self::Union(_, generics)
2799-
| Self::Trait(box TraitKind(_, _, generics, ..))
2778+
| Self::Trait(_, _, generics, ..)
28002779
| Self::TraitAlias(generics, _)
2801-
| Self::Impl(box ImplKind { generics, .. }) => Some(generics),
2780+
| Self::Impl { generics, .. } => Some(generics),
28022781
_ => None,
28032782
}
28042783
}
@@ -2821,22 +2800,17 @@ pub enum AssocItemKind {
28212800
/// If `def` is parsed, then the constant is provided, and otherwise required.
28222801
Const(Defaultness, P<Ty>, Option<P<Expr>>),
28232802
/// An associated function.
2824-
Fn(Box<FnKind>),
2803+
Fn(Defaultness, FnSig, Generics, Option<P<Block>>),
28252804
/// An associated type.
2826-
TyAlias(Box<TyAliasKind>),
2805+
TyAlias(Defaultness, Generics, GenericBounds, Option<P<Ty>>),
28272806
/// A macro expanding to associated items.
28282807
MacCall(MacCall),
28292808
}
28302809

2831-
#[cfg(target_arch = "x86_64")]
2832-
rustc_data_structures::static_assert_size!(AssocItemKind, 72);
2833-
28342810
impl AssocItemKind {
28352811
pub fn defaultness(&self) -> Defaultness {
28362812
match *self {
2837-
Self::Const(def, ..)
2838-
| Self::Fn(box FnKind(def, ..))
2839-
| Self::TyAlias(box TyAliasKind(def, ..)) => def,
2813+
Self::Const(def, ..) | Self::Fn(def, ..) | Self::TyAlias(def, ..) => def,
28402814
Self::MacCall(..) => Defaultness::Final,
28412815
}
28422816
}
@@ -2846,8 +2820,8 @@ impl From<AssocItemKind> for ItemKind {
28462820
fn from(assoc_item_kind: AssocItemKind) -> ItemKind {
28472821
match assoc_item_kind {
28482822
AssocItemKind::Const(a, b, c) => ItemKind::Const(a, b, c),
2849-
AssocItemKind::Fn(fn_kind) => ItemKind::Fn(fn_kind),
2850-
AssocItemKind::TyAlias(ty_alias_kind) => ItemKind::TyAlias(ty_alias_kind),
2823+
AssocItemKind::Fn(a, b, c, d) => ItemKind::Fn(a, b, c, d),
2824+
AssocItemKind::TyAlias(a, b, c, d) => ItemKind::TyAlias(a, b, c, d),
28512825
AssocItemKind::MacCall(a) => ItemKind::MacCall(a),
28522826
}
28532827
}
@@ -2859,8 +2833,8 @@ impl TryFrom<ItemKind> for AssocItemKind {
28592833
fn try_from(item_kind: ItemKind) -> Result<AssocItemKind, ItemKind> {
28602834
Ok(match item_kind {
28612835
ItemKind::Const(a, b, c) => AssocItemKind::Const(a, b, c),
2862-
ItemKind::Fn(fn_kind) => AssocItemKind::Fn(fn_kind),
2863-
ItemKind::TyAlias(ty_alias_kind) => AssocItemKind::TyAlias(ty_alias_kind),
2836+
ItemKind::Fn(a, b, c, d) => AssocItemKind::Fn(a, b, c, d),
2837+
ItemKind::TyAlias(a, b, c, d) => AssocItemKind::TyAlias(a, b, c, d),
28642838
ItemKind::MacCall(a) => AssocItemKind::MacCall(a),
28652839
_ => return Err(item_kind),
28662840
})
@@ -2872,23 +2846,20 @@ impl TryFrom<ItemKind> for AssocItemKind {
28722846
pub enum ForeignItemKind {
28732847
/// A foreign static item (`static FOO: u8`).
28742848
Static(P<Ty>, Mutability, Option<P<Expr>>),
2875-
/// An foreign function.
2876-
Fn(Box<FnKind>),
2877-
/// An foreign type.
2878-
TyAlias(Box<TyAliasKind>),
2849+
/// A foreign function.
2850+
Fn(Defaultness, FnSig, Generics, Option<P<Block>>),
2851+
/// A foreign type.
2852+
TyAlias(Defaultness, Generics, GenericBounds, Option<P<Ty>>),
28792853
/// A macro expanding to foreign items.
28802854
MacCall(MacCall),
28812855
}
28822856

2883-
#[cfg(target_arch = "x86_64")]
2884-
rustc_data_structures::static_assert_size!(ForeignItemKind, 72);
2885-
28862857
impl From<ForeignItemKind> for ItemKind {
28872858
fn from(foreign_item_kind: ForeignItemKind) -> ItemKind {
28882859
match foreign_item_kind {
28892860
ForeignItemKind::Static(a, b, c) => ItemKind::Static(a, b, c),
2890-
ForeignItemKind::Fn(fn_kind) => ItemKind::Fn(fn_kind),
2891-
ForeignItemKind::TyAlias(ty_alias_kind) => ItemKind::TyAlias(ty_alias_kind),
2861+
ForeignItemKind::Fn(a, b, c, d) => ItemKind::Fn(a, b, c, d),
2862+
ForeignItemKind::TyAlias(a, b, c, d) => ItemKind::TyAlias(a, b, c, d),
28922863
ForeignItemKind::MacCall(a) => ItemKind::MacCall(a),
28932864
}
28942865
}
@@ -2900,8 +2871,8 @@ impl TryFrom<ItemKind> for ForeignItemKind {
29002871
fn try_from(item_kind: ItemKind) -> Result<ForeignItemKind, ItemKind> {
29012872
Ok(match item_kind {
29022873
ItemKind::Static(a, b, c) => ForeignItemKind::Static(a, b, c),
2903-
ItemKind::Fn(fn_kind) => ForeignItemKind::Fn(fn_kind),
2904-
ItemKind::TyAlias(ty_alias_kind) => ForeignItemKind::TyAlias(ty_alias_kind),
2874+
ItemKind::Fn(a, b, c, d) => ForeignItemKind::Fn(a, b, c, d),
2875+
ItemKind::TyAlias(a, b, c, d) => ForeignItemKind::TyAlias(a, b, c, d),
29052876
ItemKind::MacCall(a) => ForeignItemKind::MacCall(a),
29062877
_ => return Err(item_kind),
29072878
})

compiler/rustc_ast/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
test(attr(deny(warnings)))
1010
)]
1111
#![feature(box_syntax)]
12-
#![feature(box_patterns)]
1312
#![feature(const_fn)] // For the `transmute` in `P::new`
1413
#![feature(const_fn_transmute)]
1514
#![feature(const_panic)]
1615
#![feature(crate_visibility_modifier)]
16+
#![feature(iterator_fold_self)]
1717
#![feature(label_break_value)]
1818
#![feature(nll)]
1919
#![feature(or_patterns)]

0 commit comments

Comments
 (0)