Skip to content

Commit c427cd4

Browse files
CoAlloc: compiler/rustc_arena: specialization; using Allocator::CoAllocMeta in rustc validations.
1 parent 4821cb2 commit c427cd4

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

compiler/rustc_arena/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1212
test(no_crate_inject, attr(deny(warnings)))
1313
)]
14+
#![allow(incomplete_features)]
1415
#![feature(dropck_eyepatch)]
1516
#![feature(new_uninit)]
1617
#![feature(maybe_uninit_slice)]
17-
#![feature(min_specialization)]
18+
//#![feature(min_specialization)]
19+
#![feature(specialization)]
1820
#![feature(decl_macro)]
1921
#![feature(pointer_byte_offsets)]
2022
#![feature(rustc_attrs)]

compiler/rustc_ast/src/ast.rs

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ pub use UnsafeSource::*;
2626
use crate::ptr::P;
2727
use crate::token::{self, CommentKind, Delimiter};
2828
use crate::tokenstream::{DelimSpan, LazyAttrTokenStream, TokenStream};
29-
use core::alloc::GlobalCoAllocMeta;
3029
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
3130
use rustc_data_structures::stack::ensure_sufficient_stack;
3231
use rustc_data_structures::sync::Lrc;
@@ -35,6 +34,8 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3534
use rustc_span::source_map::{respan, Spanned};
3635
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3736
use rustc_span::{Span, DUMMY_SP};
37+
use std::alloc::Allocator;
38+
use std::alloc::Global;
3839
use std::fmt;
3940
use std::mem;
4041
use thin_vec::{thin_vec, ThinVec};
@@ -3112,26 +3113,26 @@ mod size_asserts {
31123113
static_assert_size!(AssocItem, 104);
31133114
static_assert_size!(AssocItemKind, 32);
31143115
static_assert_size!(Attribute, 32);
3115-
static_assert_size!(Block, 48 + mem::size_of::<GlobalCoAllocMeta>());
3116-
static_assert_size!(Expr, 72 + mem::size_of::<GlobalCoAllocMeta>());
3117-
static_assert_size!(ExprKind, 40 + mem::size_of::<GlobalCoAllocMeta>());
3118-
static_assert_size!(Fn, 184 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3116+
static_assert_size!(Block, 48 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3117+
static_assert_size!(Expr, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3118+
static_assert_size!(ExprKind, 40 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3119+
static_assert_size!(Fn, 184 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31193120
static_assert_size!(ForeignItem, 96);
31203121
static_assert_size!(ForeignItemKind, 24);
31213122
static_assert_size!(GenericArg, 24);
3122-
static_assert_size!(GenericBound, 72 + mem::size_of::<GlobalCoAllocMeta>());
3123-
static_assert_size!(Generics, 72 + 2 * mem::size_of::<GlobalCoAllocMeta>());
3124-
static_assert_size!(Impl, 184 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3125-
static_assert_size!(Item, 184 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3126-
static_assert_size!(ItemKind, 112 + 3 * mem::size_of::<GlobalCoAllocMeta>());
3123+
static_assert_size!(GenericBound, 72 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3124+
static_assert_size!(Generics, 72 + 2 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3125+
static_assert_size!(Impl, 184 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3126+
static_assert_size!(Item, 184 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
3127+
static_assert_size!(ItemKind, 112 + 3 * mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31273128
static_assert_size!(LitKind, 24);
31283129
static_assert_size!(Local, 72);
31293130
static_assert_size!(MetaItemLit, 40);
31303131
static_assert_size!(Param, 40);
3131-
static_assert_size!(Pat, 88 + mem::size_of::<GlobalCoAllocMeta>());
3132+
static_assert_size!(Pat, 88 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31323133
static_assert_size!(Path, 24);
31333134
static_assert_size!(PathSegment, 24);
3134-
static_assert_size!(PatKind, 64 + mem::size_of::<GlobalCoAllocMeta>());
3135+
static_assert_size!(PatKind, 64 + mem::size_of::<<Global as Allocator>::CoAllocMeta>());
31353136
static_assert_size!(Stmt, 32);
31363137
static_assert_size!(StmtKind, 16);
31373138
static_assert_size!(Ty, 64);

compiler/rustc_ast/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
99
test(attr(deny(warnings)))
1010
)]
11+
#![feature(allocator_api)]
1112
#![feature(associated_type_bounds)]
1213
#![feature(box_patterns)]
1314
#![feature(const_default_impls)]

0 commit comments

Comments
 (0)