Skip to content

Commit 697ac29

Browse files
committed
Auto merge of rust-lang#125499 - matthiaskrgr:rollup-84i5z5w, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - rust-lang#125455 (Make `clamp` inline) - rust-lang#125477 (Run rustfmt on files that need it.) - rust-lang#125481 (Fix the dead link in the bootstrap README) - rust-lang#125482 (Notify kobzol after changes to `opt-dist`) - rust-lang#125489 (Revert problematic opaque type change) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9e297bf + 1a165ec commit 697ac29

File tree

17 files changed

+185
-56
lines changed

17 files changed

+185
-56
lines changed

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ use rustc_middle::middle::debugger_visualizer::{DebuggerVisualizerFile, Debugger
2929
use rustc_middle::middle::exported_symbols;
3030
use rustc_middle::middle::exported_symbols::SymbolExportKind;
3131
use rustc_middle::middle::lang_items;
32-
use rustc_middle::mir::BinOp;
3332
use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem};
33+
use rustc_middle::mir::BinOp;
3434
use rustc_middle::query::Providers;
3535
use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout};
3636
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};

compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ where
139139
ErrorHandled::TooGeneric(span)
140140
}
141141
err_inval!(AlreadyReported(guar)) => ErrorHandled::Reported(guar, span),
142-
err_inval!(Layout(LayoutError::ReferencesError(guar))) => ErrorHandled::Reported(
143-
ReportedErrorInfo::tainted_by_errors(guar),
144-
span,
145-
),
142+
err_inval!(Layout(LayoutError::ReferencesError(guar))) => {
143+
ErrorHandled::Reported(ReportedErrorInfo::tainted_by_errors(guar), span)
144+
}
146145
// Report remaining errors.
147146
_ => {
148147
let (our_span, frames) = get_span_and_frames();

compiler/rustc_incremental/src/persist/load.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ fn load_dep_graph(sess: &Session) -> LoadResult<(Arc<SerializedDepGraph>, WorkPr
116116

117117
if let LoadResult::Ok { data: (work_products_data, start_pos) } = load_result {
118118
// Decode the list of work_products
119-
let Ok(mut work_product_decoder) =
120-
MemDecoder::new(&work_products_data[..], start_pos)
119+
let Ok(mut work_product_decoder) = MemDecoder::new(&work_products_data[..], start_pos)
121120
else {
122121
sess.dcx().emit_warn(errors::CorruptFile { path: &work_products_path });
123122
return LoadResult::DataOutOfDate;

compiler/rustc_infer/src/infer/mod.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -957,27 +957,14 @@ impl<'tcx> InferCtxt<'tcx> {
957957
(&ty::Infer(ty::TyVar(a_vid)), &ty::Infer(ty::TyVar(b_vid))) => {
958958
return Err((a_vid, b_vid));
959959
}
960-
// We don't silently want to constrain hidden types here, so we assert that either one side is
961-
// an infer var, so it'll get constrained to whatever the other side is, or there are no opaque
962-
// types involved.
963-
// We don't expect this to actually get hit, but if it does, we now at least know how to write
964-
// a test for it.
965-
(_, ty::Infer(ty::TyVar(_))) => {}
966-
(ty::Infer(ty::TyVar(_)), _) => {}
967-
_ if r_a != r_b && (r_a, r_b).has_opaque_types() => {
968-
span_bug!(
969-
cause.span(),
970-
"opaque types got hidden types registered from within subtype predicate: {r_a:?} vs {r_b:?}"
971-
)
972-
}
973960
_ => {}
974961
}
975962

976963
self.enter_forall(predicate, |ty::SubtypePredicate { a_is_expected, a, b }| {
977964
if a_is_expected {
978-
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::Yes, a, b))
965+
Ok(self.at(cause, param_env).sub(DefineOpaqueTypes::No, a, b))
979966
} else {
980-
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::Yes, b, a))
967+
Ok(self.at(cause, param_env).sup(DefineOpaqueTypes::No, b, a))
981968
}
982969
})
983970
}

compiler/rustc_lint/src/for_loops_over_fallibles.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
6262
};
6363

6464
let (article, ty, var) = match adt.did() {
65-
did if cx.tcx.is_diagnostic_item(sym::Option, did) && ref_mutability.is_some() => ("a", "Option", "Some"),
65+
did if cx.tcx.is_diagnostic_item(sym::Option, did) && ref_mutability.is_some() => {
66+
("a", "Option", "Some")
67+
}
6668
did if cx.tcx.is_diagnostic_item(sym::Option, did) => ("an", "Option", "Some"),
6769
did if cx.tcx.is_diagnostic_item(sym::Result, did) => ("a", "Result", "Ok"),
6870
_ => return,

library/core/src/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
898898
/// assert_eq!(2.clamp(-2, 1), 1);
899899
/// ```
900900
#[must_use]
901+
#[inline]
901902
#[stable(feature = "clamp", since = "1.50.0")]
902903
fn clamp(self, min: Self, max: Self) -> Self
903904
where

library/test/src/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ fn fmt_thousands_sep(mut n: f64, sep: char) -> String {
9898
(0, true) => write!(output, "{:06.2}", n / base as f64).unwrap(),
9999
(0, false) => write!(output, "{:.2}", n / base as f64).unwrap(),
100100
(_, true) => write!(output, "{:03}", n as usize / base).unwrap(),
101-
_ => write!(output, "{}", n as usize / base).unwrap()
101+
_ => write!(output, "{}", n as usize / base).unwrap(),
102102
}
103103
if pow != 0 {
104104
output.push(sep);

src/bootstrap/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ and some of the technical details of the build system.
66
Note that this README only covers internal information, not how to use the tool.
77
Please check [bootstrapping dev guide][bootstrapping-dev-guide] for further information.
88

9-
[bootstrapping-dev-guide]: https://rustc-dev-guide.rust-lang.org/building/bootstrapping.html
9+
[bootstrapping-dev-guide]: https://rustc-dev-guide.rust-lang.org/building/bootstrapping/intro.html
1010

1111
## Introduction
1212

src/bootstrap/src/core/builder/tests.rs

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ fn check_cli<const N: usize>(paths: [&str; N]) {
6060
macro_rules! std {
6161
($host:ident => $target:ident, stage = $stage:literal) => {
6262
compile::Std::new(
63-
Compiler { host: TargetSelection::from_user(concat!(stringify!($host), "-", stringify!($host))), stage: $stage },
63+
Compiler {
64+
host: TargetSelection::from_user(concat!(
65+
stringify!($host),
66+
"-",
67+
stringify!($host)
68+
)),
69+
stage: $stage,
70+
},
6471
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
6572
)
6673
};
@@ -83,7 +90,14 @@ macro_rules! doc_std {
8390
macro_rules! rustc {
8491
($host:ident => $target:ident, stage = $stage:literal) => {
8592
compile::Rustc::new(
86-
Compiler { host: TargetSelection::from_user(concat!(stringify!($host), "-", stringify!($host))), stage: $stage },
93+
Compiler {
94+
host: TargetSelection::from_user(concat!(
95+
stringify!($host),
96+
"-",
97+
stringify!($host)
98+
)),
99+
stage: $stage,
100+
},
87101
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
88102
)
89103
};
@@ -141,10 +155,14 @@ fn check_missing_paths_for_x_test_tests() {
141155

142156
// Skip if not a test directory.
143157
if path.ends_with("tests/auxiliary") || !path.is_dir() {
144-
continue
158+
continue;
145159
}
146160

147-
assert!(tests_remap_paths.iter().any(|item| path.ends_with(*item)), "{} is missing in PATH_REMAP tests list.", path.display());
161+
assert!(
162+
tests_remap_paths.iter().any(|item| path.ends_with(*item)),
163+
"{} is missing in PATH_REMAP tests list.",
164+
path.display()
165+
);
148166
}
149167
}
150168

@@ -185,7 +203,8 @@ fn alias_and_path_for_library() {
185203
&[std!(A => A, stage = 0), std!(A => A, stage = 1)]
186204
);
187205

188-
let mut cache = run_build(&["library".into(), "core".into()], configure("doc", &["A-A"], &["A-A"]));
206+
let mut cache =
207+
run_build(&["library".into(), "core".into()], configure("doc", &["A-A"], &["A-A"]));
189208
assert_eq!(first(cache.all::<doc::Std>()), &[doc_std!(A => A, stage = 0)]);
190209
}
191210

src/bootstrap/src/core/sanity.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,15 @@ than building it.
199199
if !["A-A", "B-B", "C-C"].contains(&target_str.as_str()) {
200200
let mut has_target = false;
201201

202-
let missing_targets_hashset: HashSet<_> = STAGE0_MISSING_TARGETS.iter().map(|t| t.to_string()).collect();
203-
let duplicated_targets: Vec<_> = stage0_supported_target_list.intersection(&missing_targets_hashset).collect();
202+
let missing_targets_hashset: HashSet<_> =
203+
STAGE0_MISSING_TARGETS.iter().map(|t| t.to_string()).collect();
204+
let duplicated_targets: Vec<_> =
205+
stage0_supported_target_list.intersection(&missing_targets_hashset).collect();
204206

205207
if !duplicated_targets.is_empty() {
206-
println!("Following targets supported from the stage0 compiler, please remove them from STAGE0_MISSING_TARGETS list.");
208+
println!(
209+
"Following targets supported from the stage0 compiler, please remove them from STAGE0_MISSING_TARGETS list."
210+
);
207211
for duplicated_target in duplicated_targets {
208212
println!(" {duplicated_target}");
209213
}

0 commit comments

Comments
 (0)