Skip to content

Commit 8236dc0

Browse files
committed
Auto merge of rust-lang#79075 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] next This backports: * Avoid installing external LLVM dylibs rust-lang#78986 * Install CI llvm into the library directory rust-lang#79074 * Revert "Revert "resolve: Avoid "self-confirming" import resolutions in one more case"" rust-lang#78784 * Bump Rustfmt and RLS rust-lang#78775 * Enforce no-move rule of ReentrantMutex using Pin and fix UB in stdio rust-lang#77801 For RLS/rustfmt compilation to succeed: * change the order of type arguments on ControlFlow rust-lang#76614 * Add ControlFlow::is_{break,continue} methods rust-lang#78200 * Replace run_compiler with RunCompiler builder pattern rust-lang#77649 As a dependency of rust-lang#77801: * Add Pin::static_ref, static_mut. rust-lang#77726
2 parents 61bc95a + 0b6785f commit 8236dc0

File tree

23 files changed

+339
-198
lines changed

23 files changed

+339
-198
lines changed

Cargo.lock

+58-46
Original file line numberDiff line numberDiff line change
@@ -1926,6 +1926,17 @@ dependencies = [
19261926
"rustc-hash",
19271927
]
19281928

1929+
[[package]]
1930+
name = "measureme"
1931+
version = "9.0.0"
1932+
source = "registry+https://github.com/rust-lang/crates.io-index"
1933+
checksum = "22bf8d885d073610aee20e7fa205c4341ed32a761dbde96da5fd96301a8d3e82"
1934+
dependencies = [
1935+
"parking_lot 0.11.0",
1936+
"rustc-hash",
1937+
"smallvec 1.4.2",
1938+
]
1939+
19291940
[[package]]
19301941
name = "memchr"
19311942
version = "2.3.3"
@@ -2636,9 +2647,9 @@ dependencies = [
26362647

26372648
[[package]]
26382649
name = "racer"
2639-
version = "2.1.39"
2650+
version = "2.1.40"
26402651
source = "registry+https://github.com/rust-lang/crates.io-index"
2641-
checksum = "b9424b4650b9c1134d0a1b34dab82319691e1c95fa8af1658fc640deb1b6823c"
2652+
checksum = "68c5fb83bc092c10e12ca863ab8922b1833382d5d248aaafca779886d3396a44"
26422653
dependencies = [
26432654
"bitflags",
26442655
"clap",
@@ -2963,19 +2974,18 @@ dependencies = [
29632974

29642975
[[package]]
29652976
name = "rustc-ap-rustc_arena"
2966-
version = "679.0.0"
2977+
version = "686.0.0"
29672978
source = "registry+https://github.com/rust-lang/crates.io-index"
2968-
checksum = "e8e941a8fc3878a111d2bbfe78e39522d884136f0b412b12592195f26f653476"
2979+
checksum = "477085eefed2f12085c68577cc3827c8c39a31a4a750978aacb9af10f7903174"
29692980
dependencies = [
2970-
"rustc-ap-rustc_data_structures",
29712981
"smallvec 1.4.2",
29722982
]
29732983

29742984
[[package]]
29752985
name = "rustc-ap-rustc_ast"
2976-
version = "679.0.0"
2986+
version = "686.0.0"
29772987
source = "registry+https://github.com/rust-lang/crates.io-index"
2978-
checksum = "3b58b6b035710df7f339a2bf86f6dafa876efd95439540970e24609e33598ca6"
2988+
checksum = "4d4ad5ec25f6b3d122354595be0d1b513f37fca3299d9b448b1db28f4a9e4b12"
29792989
dependencies = [
29802990
"bitflags",
29812991
"rustc-ap-rustc_data_structures",
@@ -2990,9 +3000,9 @@ dependencies = [
29903000

29913001
[[package]]
29923002
name = "rustc-ap-rustc_ast_passes"
2993-
version = "679.0.0"
3003+
version = "686.0.0"
29943004
source = "registry+https://github.com/rust-lang/crates.io-index"
2995-
checksum = "3d379a900d6a1f098490d92ab83e87487dcee2e4ec3f04c3ac4512b5117b64e2"
3005+
checksum = "0c6d8635298d7736decdb3c6e92e784d3eccde557462a9c10ac11a34fec3d756"
29963006
dependencies = [
29973007
"itertools 0.9.0",
29983008
"rustc-ap-rustc_ast",
@@ -3009,9 +3019,9 @@ dependencies = [
30093019

30103020
[[package]]
30113021
name = "rustc-ap-rustc_ast_pretty"
3012-
version = "679.0.0"
3022+
version = "686.0.0"
30133023
source = "registry+https://github.com/rust-lang/crates.io-index"
3014-
checksum = "658d925c0da9e3c5cddc5e54f4fa8c03b41aff1fc6dc5e41837c1118ad010ac0"
3024+
checksum = "7a61bdb5252e1a95b7715038949e10f07ce770a436fcd497cdd9bc7255471de9"
30153025
dependencies = [
30163026
"rustc-ap-rustc_ast",
30173027
"rustc-ap-rustc_span",
@@ -3021,9 +3031,9 @@ dependencies = [
30213031

30223032
[[package]]
30233033
name = "rustc-ap-rustc_attr"
3024-
version = "679.0.0"
3034+
version = "686.0.0"
30253035
source = "registry+https://github.com/rust-lang/crates.io-index"
3026-
checksum = "3f387037534f34c148aed753622677500e42d190a095670e7ac3fffc09811a59"
3036+
checksum = "84520a16cb61bd31e9c27e87eca5d933a9c94ac84f25649bddcc19989275ab2a"
30273037
dependencies = [
30283038
"rustc-ap-rustc_ast",
30293039
"rustc-ap-rustc_ast_pretty",
@@ -3040,18 +3050,19 @@ dependencies = [
30403050

30413051
[[package]]
30423052
name = "rustc-ap-rustc_data_structures"
3043-
version = "679.0.0"
3053+
version = "686.0.0"
30443054
source = "registry+https://github.com/rust-lang/crates.io-index"
3045-
checksum = "14ffd17a37e00d77926a0713f191c59ff3aeb2b551a024c7cfffce14bab79be8"
3055+
checksum = "b1cb2b6a38759cf7c0c1434c8b4cbfcab9cd24970d05f960f2ca01226ddb4d68"
30463056
dependencies = [
3057+
"arrayvec",
30473058
"bitflags",
30483059
"cfg-if",
30493060
"crossbeam-utils 0.7.2",
30503061
"ena",
30513062
"indexmap",
30523063
"jobserver",
30533064
"libc",
3054-
"measureme",
3065+
"measureme 9.0.0",
30553066
"parking_lot 0.11.0",
30563067
"rustc-ap-rustc_graphviz",
30573068
"rustc-ap-rustc_index",
@@ -3070,9 +3081,9 @@ dependencies = [
30703081

30713082
[[package]]
30723083
name = "rustc-ap-rustc_errors"
3073-
version = "679.0.0"
3084+
version = "686.0.0"
30743085
source = "registry+https://github.com/rust-lang/crates.io-index"
3075-
checksum = "2b3263ddcfa9eb911e54a4e8088878dd9fd10e00d8b99b01033ba4a2733fe91d"
3086+
checksum = "46cfb19536426bf9252827a78552d635be207a4be74f4e92832aad82d7f2135c"
30763087
dependencies = [
30773088
"annotate-snippets 0.8.0",
30783089
"atty",
@@ -3089,9 +3100,9 @@ dependencies = [
30893100

30903101
[[package]]
30913102
name = "rustc-ap-rustc_expand"
3092-
version = "679.0.0"
3103+
version = "686.0.0"
30933104
source = "registry+https://github.com/rust-lang/crates.io-index"
3094-
checksum = "e1ab7e68cede8a2273fd8b8623002ce9dc832e061dfc3330e9bcc1fc2a722d73"
3105+
checksum = "6273e60042a0ef31f6cfe783c519873993eb426f055be2bc058a48b6ca3934d0"
30953106
dependencies = [
30963107
"rustc-ap-rustc_ast",
30973108
"rustc-ap-rustc_ast_passes",
@@ -3112,31 +3123,31 @@ dependencies = [
31123123

31133124
[[package]]
31143125
name = "rustc-ap-rustc_feature"
3115-
version = "679.0.0"
3126+
version = "686.0.0"
31163127
source = "registry+https://github.com/rust-lang/crates.io-index"
3117-
checksum = "eea2dc95421bc19bbd4d939399833a882c46b684283b4267ad1fcf982fc043d9"
3128+
checksum = "2936e8346157e2848305e509f38aa3ed4e97697975ef68027587f5db6a38703f"
31183129
dependencies = [
31193130
"rustc-ap-rustc_data_structures",
31203131
"rustc-ap-rustc_span",
31213132
]
31223133

31233134
[[package]]
31243135
name = "rustc-ap-rustc_fs_util"
3125-
version = "679.0.0"
3136+
version = "686.0.0"
31263137
source = "registry+https://github.com/rust-lang/crates.io-index"
3127-
checksum = "1e44c1804f09635f83f6cf1e04c2e92f8aeb7b4e850ac6c53d373dab02c13053"
3138+
checksum = "9b4c3ae17776b5a5aa441ca510a650f75805e1f5569edd231caa8378552195a4"
31283139

31293140
[[package]]
31303141
name = "rustc-ap-rustc_graphviz"
3131-
version = "679.0.0"
3142+
version = "686.0.0"
31323143
source = "registry+https://github.com/rust-lang/crates.io-index"
3133-
checksum = "dc491f2b9be6e928f6df6b287549b8d50c48e8eff8638345155f40fa2cfb785d"
3144+
checksum = "5611bf0ac0ac49c2a22c959c7d8b17f85f69959293f0e8c4f753eca832fe7ad0"
31343145

31353146
[[package]]
31363147
name = "rustc-ap-rustc_index"
3137-
version = "679.0.0"
3148+
version = "686.0.0"
31383149
source = "registry+https://github.com/rust-lang/crates.io-index"
3139-
checksum = "fa73f3fed413cdb6290738a10267da17b9ae8e02087334778b9a8c9491c5efc0"
3150+
checksum = "ca67cf37c427057192e451c7f912e94ae9a8ca5ad69fd481c011fad3f86982cb"
31403151
dependencies = [
31413152
"arrayvec",
31423153
"rustc-ap-rustc_macros",
@@ -3145,18 +3156,18 @@ dependencies = [
31453156

31463157
[[package]]
31473158
name = "rustc-ap-rustc_lexer"
3148-
version = "679.0.0"
3159+
version = "686.0.0"
31493160
source = "registry+https://github.com/rust-lang/crates.io-index"
3150-
checksum = "e993881244a92f3b44cf43c8f22ae2ca5cefe4f55a34e2b65b72ee66fe5ad077"
3161+
checksum = "a5b04cd2159495584d976d501c5394498470c2e94e4f0cebb8186562d407a678"
31513162
dependencies = [
31523163
"unicode-xid",
31533164
]
31543165

31553166
[[package]]
31563167
name = "rustc-ap-rustc_macros"
3157-
version = "679.0.0"
3168+
version = "686.0.0"
31583169
source = "registry+https://github.com/rust-lang/crates.io-index"
3159-
checksum = "4effe366556e1d75344764adf4d54cba7c2fad33dbd07588e96d0853831ddc7c"
3170+
checksum = "61ec6d623853449acd3c65050d249d3674edab5f6e4d9f074c7bac183269f9c8"
31603171
dependencies = [
31613172
"proc-macro2",
31623173
"quote",
@@ -3166,9 +3177,9 @@ dependencies = [
31663177

31673178
[[package]]
31683179
name = "rustc-ap-rustc_parse"
3169-
version = "679.0.0"
3180+
version = "686.0.0"
31703181
source = "registry+https://github.com/rust-lang/crates.io-index"
3171-
checksum = "0342675835251571471d3dca9ea1576a853a8dfa1f4b0084db283c861223cb60"
3182+
checksum = "ca524bafce4b04d2b49fee2d40b4b26c3ebab9f1a4f731fdf561f00617862f02"
31723183
dependencies = [
31733184
"bitflags",
31743185
"rustc-ap-rustc_ast",
@@ -3186,19 +3197,19 @@ dependencies = [
31863197

31873198
[[package]]
31883199
name = "rustc-ap-rustc_serialize"
3189-
version = "679.0.0"
3200+
version = "686.0.0"
31903201
source = "registry+https://github.com/rust-lang/crates.io-index"
3191-
checksum = "438255ed968d73bf6573aa18d3b8d33c0a85ecdfd14160ef09ff813938e0606c"
3202+
checksum = "c67920561e58f98c4de864407c92b2dd05ace5d5e5301e17444f10f742c005b7"
31923203
dependencies = [
31933204
"indexmap",
31943205
"smallvec 1.4.2",
31953206
]
31963207

31973208
[[package]]
31983209
name = "rustc-ap-rustc_session"
3199-
version = "679.0.0"
3210+
version = "686.0.0"
32003211
source = "registry+https://github.com/rust-lang/crates.io-index"
3201-
checksum = "7d61ff76dede8eb827f6805754900d1097a7046f938f950231b62b448f55bf78"
3212+
checksum = "0762fd855792e06ef639327237898e4e092ad68150e6a8e19aeb7dc06276ad7a"
32023213
dependencies = [
32033214
"bitflags",
32043215
"getopts",
@@ -3217,9 +3228,9 @@ dependencies = [
32173228

32183229
[[package]]
32193230
name = "rustc-ap-rustc_span"
3220-
version = "679.0.0"
3231+
version = "686.0.0"
32213232
source = "registry+https://github.com/rust-lang/crates.io-index"
3222-
checksum = "1c267f15c3cfc82a8a441d2bf86bcccf299d1eb625822468e3d8ee6f7c5a1c89"
3233+
checksum = "0bf3db7b4ca5d21c14c45475df155e5e020c9a3760346945a662c9a9053b49c8"
32233234
dependencies = [
32243235
"cfg-if",
32253236
"md-5",
@@ -3236,9 +3247,9 @@ dependencies = [
32363247

32373248
[[package]]
32383249
name = "rustc-ap-rustc_target"
3239-
version = "679.0.0"
3250+
version = "686.0.0"
32403251
source = "registry+https://github.com/rust-lang/crates.io-index"
3241-
checksum = "8b1b4b266c4d44aac0f7f83b6741d8f0545b03d1ce32f3b5254f2014225cb96c"
3252+
checksum = "3aa6560bb9742b276064d67ab9edb5766ecb303f8ae3854835ad3fad4b432188"
32423253
dependencies = [
32433254
"bitflags",
32443255
"rustc-ap-rustc_data_structures",
@@ -3323,6 +3334,7 @@ dependencies = [
33233334
name = "rustc-workspace-hack"
33243335
version = "1.0.0"
33253336
dependencies = [
3337+
"byteorder",
33263338
"crossbeam-utils 0.7.2",
33273339
"proc-macro2",
33283340
"quote",
@@ -3454,7 +3466,7 @@ version = "0.0.0"
34543466
dependencies = [
34553467
"bitflags",
34563468
"libc",
3457-
"measureme",
3469+
"measureme 0.7.1",
34583470
"rustc-demangle",
34593471
"rustc_ast",
34603472
"rustc_attr",
@@ -3520,7 +3532,7 @@ dependencies = [
35203532
"indexmap",
35213533
"jobserver",
35223534
"libc",
3523-
"measureme",
3535+
"measureme 0.7.1",
35243536
"parking_lot 0.11.0",
35253537
"rustc-hash",
35263538
"rustc-rayon",
@@ -3824,7 +3836,7 @@ version = "0.0.0"
38243836
dependencies = [
38253837
"bitflags",
38263838
"chalk-ir",
3827-
"measureme",
3839+
"measureme 0.7.1",
38283840
"polonius-engine",
38293841
"rustc-rayon-core",
38303842
"rustc_apfloat",
@@ -4255,7 +4267,7 @@ dependencies = [
42554267

42564268
[[package]]
42574269
name = "rustfmt-nightly"
4258-
version = "1.4.22"
4270+
version = "1.4.24"
42594271
dependencies = [
42604272
"annotate-snippets 0.6.1",
42614273
"anyhow",

compiler/rustc_data_structures/src/graph/iterate/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use super::{DirectedGraph, WithNumNodes, WithStartNode, WithSuccessors};
22
use rustc_index::bit_set::BitSet;
33
use rustc_index::vec::IndexVec;
4+
use std::ops::ControlFlow;
45

56
#[cfg(test)]
67
mod tests;
@@ -86,10 +87,6 @@ where
8687
}
8788
}
8889

89-
/// Allows searches to terminate early with a value.
90-
// FIXME (#75744): remove the alias once the generics are in a better order and `C=()`.
91-
pub type ControlFlow<T> = std::ops::ControlFlow<(), T>;
92-
9390
/// The status of a node in the depth-first search.
9491
///
9592
/// See the documentation of `TriColorDepthFirstSearch` to see how a node's status is updated

compiler/rustc_driver/src/lib.rs

+45-2
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,52 @@ pub fn diagnostics_registry() -> Registry {
134134
Registry::new(&rustc_error_codes::DIAGNOSTICS)
135135
}
136136

137+
pub struct RunCompiler<'a, 'b> {
138+
at_args: &'a [String],
139+
callbacks: &'b mut (dyn Callbacks + Send),
140+
file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
141+
emitter: Option<Box<dyn Write + Send>>,
142+
make_codegen_backend:
143+
Option<Box<dyn FnOnce(&config::Options) -> Box<dyn CodegenBackend> + Send>>,
144+
}
145+
146+
impl<'a, 'b> RunCompiler<'a, 'b> {
147+
pub fn new(at_args: &'a [String], callbacks: &'b mut (dyn Callbacks + Send)) -> Self {
148+
Self { at_args, callbacks, file_loader: None, emitter: None, make_codegen_backend: None }
149+
}
150+
pub fn set_make_codegen_backend(
151+
&mut self,
152+
make_codegen_backend: Option<
153+
Box<dyn FnOnce(&config::Options) -> Box<dyn CodegenBackend> + Send>,
154+
>,
155+
) -> &mut Self {
156+
self.make_codegen_backend = make_codegen_backend;
157+
self
158+
}
159+
pub fn set_emitter(&mut self, emitter: Option<Box<dyn Write + Send>>) -> &mut Self {
160+
self.emitter = emitter;
161+
self
162+
}
163+
pub fn set_file_loader(
164+
&mut self,
165+
file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
166+
) -> &mut Self {
167+
self.file_loader = file_loader;
168+
self
169+
}
170+
pub fn run(self) -> interface::Result<()> {
171+
run_compiler(
172+
self.at_args,
173+
self.callbacks,
174+
self.file_loader,
175+
self.emitter,
176+
self.make_codegen_backend,
177+
)
178+
}
179+
}
137180
// Parse args and run the compiler. This is the primary entry point for rustc.
138181
// The FileLoader provides a way to load files from sources other than the file system.
139-
pub fn run_compiler(
182+
fn run_compiler(
140183
at_args: &[String],
141184
callbacks: &mut (dyn Callbacks + Send),
142185
file_loader: Option<Box<dyn FileLoader + Send + Sync>>,
@@ -1275,7 +1318,7 @@ pub fn main() -> ! {
12751318
})
12761319
})
12771320
.collect::<Vec<_>>();
1278-
run_compiler(&args, &mut callbacks, None, None, None)
1321+
RunCompiler::new(&args, &mut callbacks).run()
12791322
});
12801323
// The extra `\t` is necessary to align this label with the others.
12811324
print_time_passes_entry(callbacks.time_passes, "\ttotal", start.elapsed());

0 commit comments

Comments
 (0)