Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 8 pull requests #82928

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f847ff1
Added #[repr(transparent)] to core::cmp::Reverse
imbrem Feb 8, 2021
095bf01
Improve sift_down performance in BinaryHeap
hanmertens Jan 17, 2021
516988b
Impl StatementKind::CopyNonOverlapping
JulianKnodt Oct 3, 2020
a058d44
Update fmt and use of memcpy
JulianKnodt Oct 5, 2020
5aba3da
Update match branches
JulianKnodt Oct 5, 2020
9fde038
Update interpret step
JulianKnodt Nov 7, 2020
0686d5d
Update cranelift
JulianKnodt Dec 29, 2020
8eb6a16
Replace todos with impls
JulianKnodt Jan 23, 2021
ed665d2
Change CopyNonOverlapping::codegen_ssa
JulianKnodt Jan 23, 2021
250b7b7
Build StKind::CopyOverlapping
JulianKnodt Jan 23, 2021
aff18fa
Switch to changing cp_non_overlap in tform
JulianKnodt Jan 23, 2021
1dda668
Clean up todos
JulianKnodt Feb 26, 2021
10a4c67
Add regression test for #75525
bugadani Mar 5, 2021
e64138c
use pat<no_top_alt> for patterns in let bindings
mark-i-m Feb 13, 2021
c946d1d
Bump libc dependency of std to 0.2.88.
de-vri-es Mar 3, 2021
95e096d
Change x64 size checks to not apply to x32.
hvdijk Mar 6, 2021
402a00a
clippy: fix or-pattern in let binding
mark-i-m Mar 8, 2021
469c030
Update CONTRIBUTING.md
henryboisdequin Mar 8, 2021
bf40ac6
Make opening sentence friendlier for new contributors
henrytheswimmer Mar 9, 2021
01c9141
Rollup merge of #77511 - JulianKnodt:st_kind_cpy, r=oli-obk
m-ou-se Mar 9, 2021
ad89b9e
Rollup merge of #81127 - hanmertens:binary_heap_sift_down_perf, r=dto…
m-ou-se Mar 9, 2021
d3f7b9a
Rollup merge of #81879 - imbrem:make-reverse-repr-transparent, r=m-ou-se
m-ou-se Mar 9, 2021
8684eb9
Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov
m-ou-se Mar 9, 2021
bfa0873
Rollup merge of #82731 - de-vri-es:bump-libc-for-std, r=Mark-Simulacrum
m-ou-se Mar 9, 2021
5574680
Rollup merge of #82799 - bugadani:codegen-tests, r=nagisa
m-ou-se Mar 9, 2021
9c400ba
Rollup merge of #82841 - hvdijk:x32, r=joshtriplett
m-ou-se Mar 9, 2021
07d5de3
Rollup merge of #82887 - henryboisdequin:improve-contributing-md, r=j…
m-ou-se Mar 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ pub struct Expr {
}

// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Expr, 120);

impl Expr {
Expand Down Expand Up @@ -2755,7 +2755,7 @@ pub enum ItemKind {
MacroDef(MacroDef),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(ItemKind, 112);

impl ItemKind {
Expand Down Expand Up @@ -2829,7 +2829,7 @@ pub enum AssocItemKind {
MacCall(MacCall),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(AssocItemKind, 72);

impl AssocItemKind {
Expand Down Expand Up @@ -2881,7 +2881,7 @@ pub enum ForeignItemKind {
MacCall(MacCall),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(ForeignItemKind, 72);

impl From<ForeignItemKind> for ItemKind {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ pub enum TokenKind {
}

// `TokenKind` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(TokenKind, 16);

#[derive(Clone, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
Expand Down Expand Up @@ -682,7 +682,7 @@ pub enum Nonterminal {
}

// `Nonterminal` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Nonterminal, 48);

#[derive(Debug, Copy, Clone, PartialEq, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ pub struct TokenStream(pub(crate) Lrc<Vec<TreeAndSpacing>>);
pub type TreeAndSpacing = (TokenTree, Spacing);

// `TokenStream` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(TokenStream, 8);

#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_errors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub type PResult<'a, T> = Result<T, DiagnosticBuilder<'a>>;

// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger.
// (See also the comment on `DiagnosticBuilderInner`.)
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(PResult<'_, bool>, 16);

#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Encodable, Decodable)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3088,7 +3088,7 @@ impl<'hir> Node<'hir> {
}

// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
mod size_asserts {
rustc_data_structures::static_assert_size!(super::Block<'static>, 48);
rustc_data_structures::static_assert_size!(super::Expr<'static>, 72);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ pub enum SubregionOrigin<'tcx> {
}

// `SubregionOrigin` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(SubregionOrigin<'_>, 32);

/// Times when we replace late-bound regions with variables:
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#[macro_use]
extern crate rustc_macros;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_infer/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
pub type TraitObligation<'tcx> = Obligation<'tcx, ty::PolyTraitPredicate<'tcx>>;

// `PredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PredicateObligation<'_>, 32);

pub type PredicateObligations<'tcx> = Vec<PredicateObligation<'tcx>>;
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/interpret/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn struct_error<'tcx>(tcx: TyCtxtAt<'tcx>, msg: &str) -> DiagnosticBuilder<'
struct_span_err!(tcx.sess, tcx.span, E0080, "{}", msg)
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(InterpErrorInfo<'_>, 8);

/// Packages the kind of error we got from the const code interpreter
Expand Down Expand Up @@ -444,7 +444,7 @@ impl dyn MachineStopType {
}
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(InterpError<'_>, 72);

pub enum InterpError<'tcx> {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub enum ConstValue<'tcx> {
},
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(ConstValue<'_>, 32);

impl<'tcx> ConstValue<'tcx> {
Expand Down Expand Up @@ -111,7 +111,7 @@ pub enum Scalar<Tag = ()> {
Ptr(Pointer<Tag>),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(Scalar, 24);

// We want the `Debug` output to be readable as it is used by `derive(Debug)` for
Expand Down Expand Up @@ -509,7 +509,7 @@ pub enum ScalarMaybeUninit<Tag = ()> {
Uninit,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(ScalarMaybeUninit, 24);

impl<Tag> From<Scalar<Tag>> for ScalarMaybeUninit<Tag> {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ pub struct LocalDecl<'tcx> {
}

// `LocalDecl` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(LocalDecl<'_>, 56);

/// Extra information about a some locals that's used for diagnostics and for
Expand Down Expand Up @@ -1468,7 +1468,7 @@ pub struct Statement<'tcx> {
}

// `Statement` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(Statement<'_>, 32);

impl Statement<'_> {
Expand Down Expand Up @@ -1775,7 +1775,7 @@ impl<V, T> ProjectionElem<V, T> {
pub type PlaceElem<'tcx> = ProjectionElem<Local, Ty<'tcx>>;

// At least on 64 bit systems, `PlaceElem` should not be larger than two pointers.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PlaceElem<'_>, 24);

/// Alias for projections as they appear in `UserTypeProjection`, where we
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/tcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct PlaceTy<'tcx> {
}

// At least on 64 bit systems, `PlaceTy` should not be larger than two or three pointers.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PlaceTy<'_>, 16);

impl<'tcx> PlaceTy<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/traits/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl ObligationCauseCode<'_> {
}

// `ObligationCauseCode` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(ObligationCauseCode<'_>, 32);

#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub struct Const<'tcx> {
pub val: ConstKind<'tcx>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(Const<'_>, 48);

impl<'tcx> Const<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/consts/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub enum ConstKind<'tcx> {
Error(ty::DelaySpanBugEmitted),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(ConstKind<'_>, 40);

impl<'tcx> ConstKind<'tcx> {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/ty/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ impl<'tcx> TyS<'tcx> {
}

// `TyS` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(TyS<'_>, 32);

impl<'tcx> Ord for TyS<'tcx> {
Expand Down Expand Up @@ -1030,7 +1030,7 @@ crate struct PredicateInner<'tcx> {
outer_exclusive_binder: ty::DebruijnIndex,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PredicateInner<'_>, 40);

#[derive(Clone, Copy, Lift)]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ impl TyKind<'tcx> {
}

// `TyKind` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(TyKind<'_>, 24);

/// A closure can be modeled as a struct that looks like:
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir/src/interpret/operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum Immediate<Tag = ()> {
ScalarPair(ScalarMaybeUninit<Tag>, ScalarMaybeUninit<Tag>),
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Immediate, 56);

impl<Tag> From<ScalarMaybeUninit<Tag>> for Immediate<Tag> {
Expand Down Expand Up @@ -95,7 +95,7 @@ pub struct ImmTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(ImmTy<'_>, 72);

impl<Tag: Copy> std::fmt::Display for ImmTy<'tcx, Tag> {
Expand Down Expand Up @@ -162,7 +162,7 @@ pub struct OpTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(OpTy<'_, ()>, 80);

impl<'tcx, Tag> std::ops::Deref for OpTy<'tcx, Tag> {
Expand Down
10 changes: 5 additions & 5 deletions compiler/rustc_mir/src/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum MemPlaceMeta<Tag = ()> {
Poison,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(MemPlaceMeta, 24);

impl<Tag> MemPlaceMeta<Tag> {
Expand Down Expand Up @@ -74,7 +74,7 @@ pub struct MemPlace<Tag = ()> {
pub meta: MemPlaceMeta<Tag>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(MemPlace, 56);

#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, HashStable)]
Expand All @@ -87,7 +87,7 @@ pub enum Place<Tag = ()> {
Local { frame: usize, local: mir::Local },
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Place, 64);

#[derive(Copy, Clone, Debug)]
Expand All @@ -96,7 +96,7 @@ pub struct PlaceTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(PlaceTy<'_>, 80);

impl<'tcx, Tag> std::ops::Deref for PlaceTy<'tcx, Tag> {
Expand All @@ -114,7 +114,7 @@ pub struct MPlaceTy<'tcx, Tag = ()> {
pub layout: TyAndLayout<'tcx>,
}

#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(MPlaceTy<'_>, 72);

impl<'tcx, Tag> std::ops::Deref for MPlaceTy<'tcx, Tag> {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ crate enum StmtKind<'tcx> {
}

// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Expr<'_>, 168);

/// The Thir trait implementor lowers their expressions (`&'tcx H::Expr`)
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#[macro_use]
extern crate rustc_macros;
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
#[macro_use]
extern crate rustc_data_structures;
#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/fulfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub struct PendingPredicateObligation<'tcx> {
}

// `PendingPredicateObligation` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
static_assert_size!(PendingPredicateObligation<'_>, 56);

impl<'a, 'tcx> FulfillmentContext<'tcx> {
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ crate struct Item {
}

// `Item` is used a lot. Make sure it doesn't unintentionally get bigger.
#[cfg(target_arch = "x86_64")]
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
rustc_data_structures::static_assert_size!(Item, 48);

impl fmt::Debug for Item {
Expand Down