Skip to content

Commit 61f3705

Browse files
committed
Merge from rustc
2 parents 1620117 + 733b47e commit 61f3705

File tree

157 files changed

+4728
-3005
lines changed

Some content is hidden

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

157 files changed

+4728
-3005
lines changed

.github/workflows/dependencies.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919
PR_TITLE: Weekly `cargo update`
2020
PR_MESSAGE: |
2121
Automation to keep dependencies in `Cargo.lock` current.
22+
r? dep-bumps
2223
2324
The following is the output from `cargo update`:
2425
COMMIT_MESSAGE: "cargo update \n\n"

Cargo.lock

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ dependencies = [
581581
"serde_json",
582582
"syn 2.0.104",
583583
"tempfile",
584-
"termize",
584+
"termize 0.1.1",
585585
"tokio",
586586
"toml 0.7.8",
587587
"ui_test",
@@ -3761,7 +3761,7 @@ dependencies = [
37613761
"serde",
37623762
"serde_json",
37633763
"termcolor",
3764-
"termize",
3764+
"termize 0.2.0",
37653765
"tracing",
37663766
"windows 0.61.3",
37673767
]
@@ -4133,6 +4133,7 @@ dependencies = [
41334133
"rustc_fs_util",
41344134
"rustc_hir",
41354135
"rustc_hir_pretty",
4136+
"rustc_incremental",
41364137
"rustc_index",
41374138
"rustc_macros",
41384139
"rustc_middle",
@@ -4522,7 +4523,7 @@ dependencies = [
45224523
"rustc_serialize",
45234524
"rustc_span",
45244525
"rustc_target",
4525-
"termize",
4526+
"termize 0.2.0",
45264527
"tracing",
45274528
"windows 0.61.3",
45284529
]
@@ -5294,6 +5295,16 @@ dependencies = [
52945295
"winapi",
52955296
]
52965297

5298+
[[package]]
5299+
name = "termize"
5300+
version = "0.2.0"
5301+
source = "registry+https://github.com/rust-lang/crates.io-index"
5302+
checksum = "6a8da106d1a19c5b9c53c03311936568a0439926a7607815bd3461139cbab1cc"
5303+
dependencies = [
5304+
"libc",
5305+
"windows-sys 0.60.2",
5306+
]
5307+
52975308
[[package]]
52985309
name = "test-float-parse"
52995310
version = "0.1.0"

compiler/rustc_abi/src/layout/ty.rs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_macros::HashStable_Generic;
66

77
use crate::{
88
AbiAlign, Align, BackendRepr, FieldsShape, Float, HasDataLayout, LayoutData, Niche,
9-
PointeeInfo, Primitive, Scalar, Size, TargetDataLayout, Variants,
9+
PointeeInfo, Primitive, Size, Variants,
1010
};
1111

1212
// Explicitly import `Float` to avoid ambiguity with `Primitive::Float`.
@@ -115,16 +115,6 @@ impl<'a> Layout<'a> {
115115
pub fn unadjusted_abi_align(self) -> Align {
116116
self.0.0.unadjusted_abi_align
117117
}
118-
119-
/// Whether the layout is from a type that implements [`std::marker::PointerLike`].
120-
///
121-
/// Currently, that means that the type is pointer-sized, pointer-aligned,
122-
/// and has a initialized (non-union), scalar ABI.
123-
pub fn is_pointer_like(self, data_layout: &TargetDataLayout) -> bool {
124-
self.size() == data_layout.pointer_size
125-
&& self.align().abi == data_layout.pointer_align.abi
126-
&& matches!(self.backend_repr(), BackendRepr::Scalar(Scalar::Initialized { .. }))
127-
}
128118
}
129119

130120
/// The layout of a type, alongside the type itself.

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,21 @@ pub enum AttributeKind {
278278
/// Represents `#[naked]`
279279
Naked(Span),
280280

281+
/// Represents `#[no_implicit_prelude]`
282+
NoImplicitPrelude(Span),
283+
281284
/// Represents `#[no_mangle]`
282285
NoMangle(Span),
283286

287+
/// Represents `#[non_exhaustive]`
288+
NonExhaustive(Span),
289+
284290
/// Represents `#[optimize(size|speed)]`
285291
Optimize(OptimizeAttr, Span),
286292

293+
/// Represents `#[rustc_pass_by_value]` (used by the `rustc_pass_by_value` lint).
294+
PassByValue(Span),
295+
287296
/// Represents `#[rustc_pub_transparent]` (used by the `repr_transparent_external_private_fields` lint).
288297
PubTransparent(Span),
289298

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,44 @@ impl AttributeKind {
1212
use EncodeCrossCrate::*;
1313

1414
match self {
15+
// tidy-alphabetical-start
1516
Align { .. } => No,
1617
AllowConstFnUnstable(..) => No,
1718
AllowInternalUnstable(..) => Yes,
1819
AsPtr(..) => Yes,
1920
BodyStability { .. } => No,
21+
Cold(..) => No,
2022
Confusables { .. } => Yes,
23+
ConstContinue(..) => No,
2124
ConstStability { .. } => Yes,
2225
ConstStabilityIndirect => No,
2326
Deprecation { .. } => Yes,
2427
DocComment { .. } => Yes,
2528
ExportName { .. } => Yes,
2629
Inline(..) => No,
27-
LinkSection { .. } => No,
28-
MacroTransparency(..) => Yes,
29-
Repr(..) => No,
30-
Stability { .. } => Yes,
31-
Cold(..) => No,
32-
ConstContinue(..) => No,
3330
LinkName { .. } => Yes,
31+
LinkSection { .. } => No,
3432
LoopMatch(..) => No,
33+
MacroTransparency(..) => Yes,
3534
MayDangle(..) => No,
3635
MustUse { .. } => Yes,
3736
Naked(..) => No,
37+
NoImplicitPrelude(..) => No,
3838
NoMangle(..) => No,
39+
NonExhaustive(..) => Yes,
3940
Optimize(..) => No,
41+
PassByValue(..) => Yes,
4042
PubTransparent(..) => Yes,
43+
Repr(..) => No,
4144
RustcLayoutScalarValidRangeEnd(..) => Yes,
4245
RustcLayoutScalarValidRangeStart(..) => Yes,
4346
RustcObjectLifetimeDefault => No,
4447
SkipDuringMethodDispatch { .. } => No,
48+
Stability { .. } => Yes,
4549
TargetFeature(..) => No,
4650
TrackCaller(..) => Yes,
4751
Used { .. } => No,
52+
// tidy-alphabetical-end
4853
}
4954
}
5055
}

compiler/rustc_attr_parsing/src/attributes/lint_helpers.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ impl<S: Stage> NoArgsAttributeParser<S> for PubTransparentParser {
1717
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
1818
const CREATE: fn(Span) -> AttributeKind = AttributeKind::PubTransparent;
1919
}
20+
21+
pub(crate) struct PassByValueParser;
22+
impl<S: Stage> NoArgsAttributeParser<S> for PassByValueParser {
23+
const PATH: &[Symbol] = &[sym::rustc_pass_by_value];
24+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
25+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::PassByValue;
26+
}

compiler/rustc_attr_parsing/src/attributes/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ pub(crate) mod link_attrs;
3535
pub(crate) mod lint_helpers;
3636
pub(crate) mod loop_match;
3737
pub(crate) mod must_use;
38+
pub(crate) mod no_implicit_prelude;
39+
pub(crate) mod non_exhaustive;
3840
pub(crate) mod repr;
3941
pub(crate) mod rustc_internal;
4042
pub(crate) mod semantics;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use rustc_attr_data_structures::AttributeKind;
2+
use rustc_span::{Span, sym};
3+
4+
use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
5+
use crate::context::Stage;
6+
7+
pub(crate) struct NoImplicitPreludeParser;
8+
9+
impl<S: Stage> NoArgsAttributeParser<S> for NoImplicitPreludeParser {
10+
const PATH: &[rustc_span::Symbol] = &[sym::no_implicit_prelude];
11+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
12+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NoImplicitPrelude;
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use rustc_attr_data_structures::AttributeKind;
2+
use rustc_span::{Span, Symbol, sym};
3+
4+
use crate::attributes::{NoArgsAttributeParser, OnDuplicate};
5+
use crate::context::Stage;
6+
7+
pub(crate) struct NonExhaustiveParser;
8+
9+
impl<S: Stage> NoArgsAttributeParser<S> for NonExhaustiveParser {
10+
const PATH: &[Symbol] = &[sym::non_exhaustive];
11+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Warn;
12+
const CREATE: fn(Span) -> AttributeKind = AttributeKind::NonExhaustive;
13+
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ use crate::attributes::confusables::ConfusablesParser;
2323
use crate::attributes::deprecation::DeprecationParser;
2424
use crate::attributes::inline::{InlineParser, RustcForceInlineParser};
2525
use crate::attributes::link_attrs::{LinkNameParser, LinkSectionParser};
26-
use crate::attributes::lint_helpers::{AsPtrParser, PubTransparentParser};
26+
use crate::attributes::lint_helpers::{AsPtrParser, PassByValueParser, PubTransparentParser};
2727
use crate::attributes::loop_match::{ConstContinueParser, LoopMatchParser};
2828
use crate::attributes::must_use::MustUseParser;
29+
use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser;
30+
use crate::attributes::non_exhaustive::NonExhaustiveParser;
2931
use crate::attributes::repr::{AlignParser, ReprParser};
3032
use crate::attributes::rustc_internal::{
3133
RustcLayoutScalarValidRangeEnd, RustcLayoutScalarValidRangeStart,
@@ -141,7 +143,10 @@ attribute_parsers!(
141143
Single<WithoutArgs<ConstStabilityIndirectParser>>,
142144
Single<WithoutArgs<LoopMatchParser>>,
143145
Single<WithoutArgs<MayDangleParser>>,
146+
Single<WithoutArgs<NoImplicitPreludeParser>>,
144147
Single<WithoutArgs<NoMangleParser>>,
148+
Single<WithoutArgs<NonExhaustiveParser>>,
149+
Single<WithoutArgs<PassByValueParser>>,
145150
Single<WithoutArgs<PubTransparentParser>>,
146151
Single<WithoutArgs<TrackCallerParser>>,
147152
// tidy-alphabetical-end

0 commit comments

Comments
 (0)