Skip to content

Commit aa51a9b

Browse files
committed
Auto merge of #143934 - samueltardieu:rollup-w3iw614, r=samueltardieu
Rollup of 8 pull requests Successful merges: - #141809 (Don't call WSACleanup on process exit) - #143710 (Updates to random number generation APIs) - #143848 (Rename `stable_mir` and `rustc_smir`) - #143855 (Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing) - #143868 (warn on align on fields to avoid breaking changes) - #143870 ([COMPILETEST-UNTANGLE 6/N] Use `TestSuite` enum instead of stringly-typed test suites) - #143901 (Region constraint nits) - #143903 (Fix typos in documentation files) r? `@ghost` `@rustbot` modify labels: rollup
2 parents cccf075 + 9b260f6 commit aa51a9b

File tree

101 files changed

+461
-407
lines changed

Some content is hidden

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

101 files changed

+461
-407
lines changed

Cargo.lock

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -3271,8 +3271,8 @@ dependencies = [
32713271
"rustc_codegen_ssa",
32723272
"rustc_driver",
32733273
"rustc_driver_impl",
3274-
"rustc_smir",
3275-
"stable_mir",
3274+
"rustc_public",
3275+
"rustc_public_bridge",
32763276
"tikv-jemalloc-sys",
32773277
]
32783278

@@ -3709,6 +3709,7 @@ dependencies = [
37093709
"rustc_passes",
37103710
"rustc_pattern_analysis",
37113711
"rustc_privacy",
3712+
"rustc_public",
37123713
"rustc_query_system",
37133714
"rustc_resolve",
37143715
"rustc_session",
@@ -3718,7 +3719,6 @@ dependencies = [
37183719
"rustc_ty_utils",
37193720
"serde_json",
37203721
"shlex",
3721-
"stable_mir",
37223722
"tracing",
37233723
"windows 0.61.3",
37243724
]
@@ -4415,6 +4415,36 @@ dependencies = [
44154415
"rustc-literal-escaper",
44164416
]
44174417

4418+
[[package]]
4419+
name = "rustc_public"
4420+
version = "0.1.0-preview"
4421+
dependencies = [
4422+
"rustc_abi",
4423+
"rustc_hir",
4424+
"rustc_middle",
4425+
"rustc_public_bridge",
4426+
"rustc_session",
4427+
"rustc_span",
4428+
"rustc_target",
4429+
"scoped-tls",
4430+
"serde",
4431+
"tracing",
4432+
]
4433+
4434+
[[package]]
4435+
name = "rustc_public_bridge"
4436+
version = "0.0.0"
4437+
dependencies = [
4438+
"rustc_abi",
4439+
"rustc_data_structures",
4440+
"rustc_hir",
4441+
"rustc_hir_pretty",
4442+
"rustc_middle",
4443+
"rustc_session",
4444+
"rustc_span",
4445+
"rustc_target",
4446+
]
4447+
44184448
[[package]]
44194449
name = "rustc_query_impl"
44204450
version = "0.0.0"
@@ -4542,20 +4572,6 @@ dependencies = [
45424572
"windows 0.61.3",
45434573
]
45444574

4545-
[[package]]
4546-
name = "rustc_smir"
4547-
version = "0.0.0"
4548-
dependencies = [
4549-
"rustc_abi",
4550-
"rustc_data_structures",
4551-
"rustc_hir",
4552-
"rustc_hir_pretty",
4553-
"rustc_middle",
4554-
"rustc_session",
4555-
"rustc_span",
4556-
"rustc_target",
4557-
]
4558-
45594575
[[package]]
45604576
name = "rustc_span"
45614577
version = "0.0.0"
@@ -5103,22 +5119,6 @@ version = "1.2.0"
51035119
source = "registry+https://github.com/rust-lang/crates.io-index"
51045120
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
51055121

5106-
[[package]]
5107-
name = "stable_mir"
5108-
version = "0.1.0-preview"
5109-
dependencies = [
5110-
"rustc_abi",
5111-
"rustc_hir",
5112-
"rustc_middle",
5113-
"rustc_session",
5114-
"rustc_smir",
5115-
"rustc_span",
5116-
"rustc_target",
5117-
"scoped-tls",
5118-
"serde",
5119-
"tracing",
5120-
]
5121-
51225122
[[package]]
51235123
name = "stacker"
51245124
version = "0.1.21"

compiler/rustc/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ rustc_codegen_ssa = { path = "../rustc_codegen_ssa" }
1313
rustc_driver = { path = "../rustc_driver" }
1414
rustc_driver_impl = { path = "../rustc_driver_impl" }
1515

16-
# Make sure rustc_smir ends up in the sysroot, because this
17-
# crate is intended to be used by stable MIR consumers, which are not in-tree.
18-
rustc_smir = { path = "../rustc_smir" }
16+
rustc_public = { path = "../rustc_public" }
1917

20-
stable_mir = { path = "../stable_mir" }
18+
# Make sure rustc_public_bridge ends up in the sysroot, because this
19+
# crate is intended to be used by stable MIR consumers, which are not in-tree.
20+
rustc_public_bridge = { path = "../rustc_public_bridge" }
2121
# tidy-alphabetical-end
2222

2323
[dependencies.tikv-jemalloc-sys]

compiler/rustc_attr_data_structures/src/attributes.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,9 @@ pub enum AttributeKind {
334334
/// Represents `#[non_exhaustive]`
335335
NonExhaustive(Span),
336336

337+
/// Represents `#[omit_gdb_pretty_printer_section]`
338+
OmitGdbPrettyPrinterSection,
339+
337340
/// Represents `#[optimize(size|speed)]`
338341
Optimize(OptimizeAttr, Span),
339342

compiler/rustc_attr_data_structures/src/encode_cross_crate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl AttributeKind {
5252
NoImplicitPrelude(..) => No,
5353
NoMangle(..) => No,
5454
NonExhaustive(..) => Yes,
55+
OmitGdbPrettyPrinterSection => No,
5556
Optimize(..) => No,
5657
ParenSugar(..) => No,
5758
PassByValue(..) => Yes,

compiler/rustc_attr_parsing/src/attributes/codegen_attrs.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,3 +334,11 @@ impl<S: Stage> CombineAttributeParser<S> for TargetFeatureParser {
334334
features
335335
}
336336
}
337+
338+
pub(crate) struct OmitGdbPrettyPrinterSectionParser;
339+
340+
impl<S: Stage> NoArgsAttributeParser<S> for OmitGdbPrettyPrinterSectionParser {
341+
const PATH: &[Symbol] = &[sym::omit_gdb_pretty_printer_section];
342+
const ON_DUPLICATE: OnDuplicate<S> = OnDuplicate::Error;
343+
const CREATE: fn(Span) -> AttributeKind = |_| AttributeKind::OmitGdbPrettyPrinterSection;
344+
}

compiler/rustc_attr_parsing/src/context.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, Symbol, sym};
1616

1717
use crate::attributes::allow_unstable::{AllowConstFnUnstableParser, AllowInternalUnstableParser};
1818
use crate::attributes::codegen_attrs::{
19-
ColdParser, ExportNameParser, NakedParser, NoMangleParser, OptimizeParser, TargetFeatureParser,
20-
TrackCallerParser, UsedParser,
19+
ColdParser, ExportNameParser, NakedParser, NoMangleParser, OmitGdbPrettyPrinterSectionParser,
20+
OptimizeParser, TargetFeatureParser, TrackCallerParser, UsedParser,
2121
};
2222
use crate::attributes::confusables::ConfusablesParser;
2323
use crate::attributes::deprecation::DeprecationParser;
@@ -175,6 +175,7 @@ attribute_parsers!(
175175
Single<WithoutArgs<NoImplicitPreludeParser>>,
176176
Single<WithoutArgs<NoMangleParser>>,
177177
Single<WithoutArgs<NonExhaustiveParser>>,
178+
Single<WithoutArgs<OmitGdbPrettyPrinterSectionParser>>,
178179
Single<WithoutArgs<ParenSugarParser>>,
179180
Single<WithoutArgs<PassByValueParser>>,
180181
Single<WithoutArgs<PubTransparentParser>>,

compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
159159
}
160160

161161
GenericArgKind::Type(mut t1) => {
162+
// Scraped constraints may have had inference vars.
163+
t1 = self.infcx.resolve_vars_if_possible(t1);
164+
162165
// Normalize the type we receive from a `TypeOutlives` obligation
163166
// in the new trait solver.
164167
if infcx.next_trait_solver() {

compiler/rustc_codegen_llvm/src/debuginfo/gdb.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// .debug_gdb_scripts binary section.
22

3-
use rustc_ast::attr;
3+
use rustc_attr_data_structures::{AttributeKind, find_attr};
44
use rustc_codegen_ssa::base::collect_debugger_visualizers_transitive;
55
use rustc_codegen_ssa::traits::*;
66
use rustc_hir::def_id::LOCAL_CRATE;
77
use rustc_middle::bug;
88
use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerType;
99
use rustc_session::config::{CrateType, DebugInfo};
10-
use rustc_span::sym;
1110

1211
use crate::builder::Builder;
1312
use crate::common::CodegenCx;
@@ -87,7 +86,7 @@ pub(crate) fn get_or_insert_gdb_debug_scripts_section_global<'ll>(
8786

8887
pub(crate) fn needs_gdb_debug_scripts_section(cx: &CodegenCx<'_, '_>) -> bool {
8988
let omit_gdb_pretty_printer_section =
90-
attr::contains_name(cx.tcx.hir_krate_attrs(), sym::omit_gdb_pretty_printer_section);
89+
find_attr!(cx.tcx.hir_krate_attrs(), AttributeKind::OmitGdbPrettyPrinterSection);
9190

9291
// To ensure the section `__rustc_debug_gdb_scripts_section__` will not create
9392
// ODR violations at link time, this section will not be emitted for rlibs since

compiler/rustc_driver_impl/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ rustc_parse = { path = "../rustc_parse" }
4141
rustc_passes = { path = "../rustc_passes" }
4242
rustc_pattern_analysis = { path = "../rustc_pattern_analysis" }
4343
rustc_privacy = { path = "../rustc_privacy" }
44+
rustc_public = { path = "../rustc_public", features = ["rustc_internal"] }
4445
rustc_query_system = { path = "../rustc_query_system" }
4546
rustc_resolve = { path = "../rustc_resolve" }
4647
rustc_session = { path = "../rustc_session" }
@@ -50,7 +51,6 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
5051
rustc_ty_utils = { path = "../rustc_ty_utils" }
5152
serde_json = "1.0.59"
5253
shlex = "1.0"
53-
stable_mir = { path = "../stable_mir", features = ["rustc_internal"] }
5454
tracing = { version = "0.1.35" }
5555
# tidy-alphabetical-end
5656

compiler/rustc_driver_impl/src/pretty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use rustc_middle::bug;
88
use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty};
99
use rustc_middle::ty::{self, TyCtxt};
1010
use rustc_mir_build::thir::print::{thir_flat, thir_tree};
11+
use rustc_public::rustc_internal::pretty::write_smir_pretty;
1112
use rustc_session::Session;
1213
use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode};
1314
use rustc_span::{FileName, Ident};
14-
use stable_mir::rustc_internal::pretty::write_smir_pretty;
1515
use tracing::debug;
1616
use {rustc_ast as ast, rustc_hir_pretty as pprust_hir};
1717

0 commit comments

Comments
 (0)