Skip to content

Commit 1e2813f

Browse files
author
The Miri Conjob Bot
committed
Merge from rustc
2 parents aa6d6ba + fd36553 commit 1e2813f

File tree

561 files changed

+11886
-7523
lines changed

Some content is hidden

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

561 files changed

+11886
-7523
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
- name: disable git crlf conversion
6868
run: git config --global core.autocrlf false
6969
- name: checkout the source code
70-
uses: actions/checkout@v3
70+
uses: actions/checkout@v4
7171
with:
7272
fetch-depth: 2
7373
- name: configure the PR in which the error message will be posted
@@ -393,7 +393,7 @@ jobs:
393393
- name: dist-x86_64-msvc
394394
env:
395395
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler"
396-
SCRIPT: python x.py build --set rust.debug=true opt-dist && PGO_HOST=x86_64-pc-windows-msvc ./build/x86_64-pc-windows-msvc/stage0-tools-bin/opt-dist python x.py dist bootstrap --include-default-paths
396+
SCRIPT: python x.py build --set rust.debug=true opt-dist && PGO_HOST=x86_64-pc-windows-msvc ./build/x86_64-pc-windows-msvc/stage0-tools-bin/opt-dist windows-ci -- python x.py dist bootstrap --include-default-paths
397397
DIST_REQUIRE_ALL_TOOLS: 1
398398
os: windows-2019-8core-32gb
399399
- name: dist-i686-msvc
@@ -435,7 +435,7 @@ jobs:
435435
- name: disable git crlf conversion
436436
run: git config --global core.autocrlf false
437437
- name: checkout the source code
438-
uses: actions/checkout@v3
438+
uses: actions/checkout@v4
439439
with:
440440
fetch-depth: 2
441441
- name: configure the PR in which the error message will be posted
@@ -555,7 +555,7 @@ jobs:
555555
- name: disable git crlf conversion
556556
run: git config --global core.autocrlf false
557557
- name: checkout the source code
558-
uses: actions/checkout@v3
558+
uses: actions/checkout@v4
559559
with:
560560
fetch-depth: 2
561561
- name: configure the PR in which the error message will be posted
@@ -662,7 +662,7 @@ jobs:
662662
if: "github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'rust-lang-ci/rust'"
663663
steps:
664664
- name: checkout the source code
665-
uses: actions/checkout@v3
665+
uses: actions/checkout@v4
666666
with:
667667
fetch-depth: 2
668668
- name: publish toolstate

.github/workflows/dependencies.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
runs-on: ubuntu-latest
5151
steps:
5252
- name: checkout the source code
53-
uses: actions/checkout@v3
53+
uses: actions/checkout@v4
5454
with:
5555
submodules: recursive
5656
- name: install the bootstrap toolchain
@@ -87,7 +87,7 @@ jobs:
8787
pull-requests: write
8888
steps:
8989
- name: checkout the source code
90-
uses: actions/checkout@v3
90+
uses: actions/checkout@v4
9191

9292
- name: download Cargo.lock from update job
9393
uses: actions/download-artifact@v3

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ build/
5858
\#*
5959
\#*\#
6060
.#*
61-
rustc-ice-*.txt
6261

6362
## Tags
6463
tags

.mailmap

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ Kyle J Strand <batmanaod@gmail.com> <BatmanAoD@users.noreply.github.com>
328328
Kyle J Strand <batmanaod@gmail.com> <kyle.j.strand@gmail.com>
329329
Kyle J Strand <batmanaod@gmail.com> <kyle.strand@pieinsurance.com>
330330
Kyle J Strand <batmanaod@gmail.com> <kyle.strand@rms.com>
331-
Laurențiu Nicola <lnicola@dend.ro>
331+
Laurențiu Nicola <lnicola@dend.ro> Laurentiu Nicola <lnicola@dend.ro>
332+
Laurențiu Nicola <lnicola@dend.ro> <lnicola@users.noreply.github.com>
332333
lcnr <rust@lcnr.de> <bastian_kauschke@hotmail.de>
333334
Lee Jeffery <leejeffery@gmail.com> Lee Jeffery <lee@leejeffery.co.uk>
334335
Lee Wondong <wdlee91@gmail.com>
@@ -549,6 +550,8 @@ Timothy Maloney <tmaloney@pdx.edu>
549550
Tomas Koutsky <tomas@stepnivlk.net>
550551
Torsten Weber <TorstenWeber12@gmail.com>
551552
Torsten Weber <TorstenWeber12@gmail.com> <torstenweber12@gmail.com>
553+
Trevor Gross <tmgross@umich.edu> <t.gross35@gmail.com>
554+
Trevor Gross <tmgross@umich.edu> <tgross@intrepidcs.com>
552555
Trevor Spiteri <tspiteri@ieee.org> <trevor.spiteri@um.edu.mt>
553556
Tshepang Mbambo <tshepang@gmail.com>
554557
Ty Overby <ty@pre-alpha.com>

Cargo.lock

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -859,14 +859,38 @@ dependencies = [
859859
"winapi",
860860
]
861861

862+
[[package]]
863+
name = "darling"
864+
version = "0.14.4"
865+
source = "registry+https://github.com/rust-lang/crates.io-index"
866+
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
867+
dependencies = [
868+
"darling_core 0.14.4",
869+
"darling_macro 0.14.4",
870+
]
871+
862872
[[package]]
863873
name = "darling"
864874
version = "0.20.3"
865875
source = "registry+https://github.com/rust-lang/crates.io-index"
866876
checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e"
867877
dependencies = [
868-
"darling_core",
869-
"darling_macro",
878+
"darling_core 0.20.3",
879+
"darling_macro 0.20.3",
880+
]
881+
882+
[[package]]
883+
name = "darling_core"
884+
version = "0.14.4"
885+
source = "registry+https://github.com/rust-lang/crates.io-index"
886+
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
887+
dependencies = [
888+
"fnv",
889+
"ident_case",
890+
"proc-macro2",
891+
"quote",
892+
"strsim",
893+
"syn 1.0.109",
870894
]
871895

872896
[[package]]
@@ -883,13 +907,24 @@ dependencies = [
883907
"syn 2.0.29",
884908
]
885909

910+
[[package]]
911+
name = "darling_macro"
912+
version = "0.14.4"
913+
source = "registry+https://github.com/rust-lang/crates.io-index"
914+
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
915+
dependencies = [
916+
"darling_core 0.14.4",
917+
"quote",
918+
"syn 1.0.109",
919+
]
920+
886921
[[package]]
887922
name = "darling_macro"
888923
version = "0.20.3"
889924
source = "registry+https://github.com/rust-lang/crates.io-index"
890925
checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5"
891926
dependencies = [
892-
"darling_core",
927+
"darling_core 0.20.3",
893928
"quote",
894929
"syn 2.0.29",
895930
]
@@ -920,6 +955,37 @@ dependencies = [
920955
"syn 1.0.109",
921956
]
922957

958+
[[package]]
959+
name = "derive_builder"
960+
version = "0.12.0"
961+
source = "registry+https://github.com/rust-lang/crates.io-index"
962+
checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8"
963+
dependencies = [
964+
"derive_builder_macro",
965+
]
966+
967+
[[package]]
968+
name = "derive_builder_core"
969+
version = "0.12.0"
970+
source = "registry+https://github.com/rust-lang/crates.io-index"
971+
checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f"
972+
dependencies = [
973+
"darling 0.14.4",
974+
"proc-macro2",
975+
"quote",
976+
"syn 1.0.109",
977+
]
978+
979+
[[package]]
980+
name = "derive_builder_macro"
981+
version = "0.12.0"
982+
source = "registry+https://github.com/rust-lang/crates.io-index"
983+
checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e"
984+
dependencies = [
985+
"derive_builder_core",
986+
"syn 1.0.109",
987+
]
988+
923989
[[package]]
924990
name = "derive_more"
925991
version = "0.99.17"
@@ -939,7 +1005,7 @@ version = "0.1.6"
9391005
source = "registry+https://github.com/rust-lang/crates.io-index"
9401006
checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d"
9411007
dependencies = [
942-
"darling",
1008+
"darling 0.20.3",
9431009
"proc-macro2",
9441010
"quote",
9451011
"syn 2.0.29",
@@ -2594,6 +2660,8 @@ dependencies = [
25942660
"anyhow",
25952661
"build_helper",
25962662
"camino",
2663+
"clap",
2664+
"derive_builder",
25972665
"env_logger 0.10.0",
25982666
"fs_extra",
25992667
"glob",

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,22 @@ impl Attribute {
9999
}
100100
}
101101

102+
pub fn path_matches(&self, name: &[Symbol]) -> bool {
103+
match &self.kind {
104+
AttrKind::Normal(normal) => {
105+
normal.item.path.segments.len() == name.len()
106+
&& normal
107+
.item
108+
.path
109+
.segments
110+
.iter()
111+
.zip(name)
112+
.all(|(s, n)| s.args.is_none() && s.ident.name == *n)
113+
}
114+
AttrKind::DocComment(..) => false,
115+
}
116+
}
117+
102118
pub fn is_word(&self) -> bool {
103119
if let AttrKind::Normal(normal) = &self.kind {
104120
matches!(normal.item.args, AttrArgs::Empty)

compiler/rustc_borrowck/src/diagnostics/region_name.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
442442
span: Span,
443443
counter: usize,
444444
) -> RegionNameHighlight {
445-
let mut highlight = RegionHighlightMode::new(self.infcx.tcx);
446-
highlight.highlighting_region_vid(needle_fr, counter);
445+
let mut highlight = RegionHighlightMode::default();
446+
highlight.highlighting_region_vid(self.infcx.tcx, needle_fr, counter);
447447
let type_name =
448448
self.infcx.extract_inference_diagnostics_data(ty.into(), Some(highlight)).name;
449449

@@ -804,8 +804,8 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
804804
return None;
805805
}
806806

807-
let mut highlight = RegionHighlightMode::new(tcx);
808-
highlight.highlighting_region_vid(fr, *self.next_region_name.try_borrow().unwrap());
807+
let mut highlight = RegionHighlightMode::default();
808+
highlight.highlighting_region_vid(tcx, fr, *self.next_region_name.try_borrow().unwrap());
809809
let type_name =
810810
self.infcx.extract_inference_diagnostics_data(yield_ty.into(), Some(highlight)).name;
811811

compiler/rustc_builtin_macros/messages.ftl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ builtin_macros_format_positional_after_named = positional arguments cannot follo
137137
.label = positional arguments must be before named arguments
138138
.named_args = named argument
139139
140+
builtin_macros_format_remove_raw_ident = remove the `r#`
141+
140142
builtin_macros_format_requires_string = requires at least a format string argument
141143
142144
builtin_macros_format_string_invalid = invalid format string: {$desc}
@@ -165,6 +167,8 @@ builtin_macros_format_unused_arg = {$named ->
165167
builtin_macros_format_unused_args = multiple unused formatting arguments
166168
.label = multiple missing formatting specifiers
167169
170+
builtin_macros_format_use_positional = consider using a positional formatting argument instead
171+
168172
builtin_macros_global_asm_clobber_abi = `clobber_abi` cannot be used with `global_asm!`
169173
170174
builtin_macros_invalid_crate_attribute = invalid crate attribute
@@ -205,8 +209,6 @@ builtin_macros_requires_cfg_pattern =
205209
206210
builtin_macros_should_panic = functions using `#[should_panic]` must return `()`
207211
208-
builtin_macros_sugg = consider using a positional formatting argument instead
209-
210212
builtin_macros_test_arg_non_lifetime = functions used as tests can not have any non-lifetime generic parameters
211213
212214
builtin_macros_test_args = functions used as tests can not have any arguments

compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ pub fn expand_deriving_eq(
1818
is_const: bool,
1919
) {
2020
let span = cx.with_def_site_ctxt(span);
21+
22+
let structural_trait_def = TraitDef {
23+
span,
24+
path: path_std!(marker::StructuralEq),
25+
skip_path_as_bound: true, // crucial!
26+
needs_copy_as_bound_if_packed: false,
27+
additional_bounds: Vec::new(),
28+
supports_unions: true,
29+
methods: Vec::new(),
30+
associated_types: Vec::new(),
31+
is_const: false,
32+
};
33+
structural_trait_def.expand(cx, mitem, item, push);
34+
2135
let trait_def = TraitDef {
2236
span,
2337
path: path_std!(cmp::Eq),
@@ -44,9 +58,6 @@ pub fn expand_deriving_eq(
4458
associated_types: Vec::new(),
4559
is_const,
4660
};
47-
48-
super::inject_impl_of_structural_trait(cx, span, item, path_std!(marker::StructuralEq), push);
49-
5061
trait_def.expand_ext(cx, mitem, item, push, true)
5162
}
5263

compiler/rustc_builtin_macros/src/deriving/cmp/partial_eq.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,20 @@ pub fn expand_deriving_partial_eq(
7272
BlockOrExpr::new_expr(expr)
7373
}
7474

75-
super::inject_impl_of_structural_trait(
76-
cx,
75+
let structural_trait_def = TraitDef {
7776
span,
78-
item,
79-
path_std!(marker::StructuralPartialEq),
80-
push,
81-
);
77+
path: path_std!(marker::StructuralPartialEq),
78+
skip_path_as_bound: true, // crucial!
79+
needs_copy_as_bound_if_packed: false,
80+
additional_bounds: Vec::new(),
81+
// We really don't support unions, but that's already checked by the impl generated below;
82+
// a second check here would lead to redundant error messages.
83+
supports_unions: true,
84+
methods: Vec::new(),
85+
associated_types: Vec::new(),
86+
is_const: false,
87+
};
88+
structural_trait_def.expand(cx, mitem, item, push);
8289

8390
// No need to generate `ne`, the default suffices, and not generating it is
8491
// faster.

0 commit comments

Comments
 (0)