Skip to content

Commit 618c300

Browse files
committed
Auto merge of #123897 - matthiaskrgr:rollup-v0vvcw2, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #123530 (Enable building tier2 target riscv32im-unknown-none-elf) - #123642 (do not allow using local llvm while using rustc from ci) - #123716 (Update documentation of Path::to_path_buf and Path::ancestors) - #123876 (Update backtrace submodule) - #123888 (Replace a `DefiningOpaqueTypes::No` with `Yes` by asserting that one side of the comparison is a type variable.) - #123890 (removed (mostly) unused code) - #123891 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3a0db6c + f8ef61d commit 618c300

File tree

14 files changed

+129
-227
lines changed

14 files changed

+129
-227
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
505505
}
506506

507507
pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
508-
let _indenter = indenter();
509508
match tcx.def_kind(def_id) {
510509
DefKind::Static { .. } => {
511510
tcx.ensure().typeck(def_id);

compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ use rustc_trait_selection::traits::ObligationCtxt;
103103

104104
use crate::errors;
105105
use crate::require_c_abi_if_c_variadic;
106-
use crate::util::common::indenter;
107106

108107
use self::compare_impl_item::collect_return_position_impl_trait_in_trait_tys;
109108
use self::region::region_scope_tree;

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ use rustc_middle::middle;
103103
use rustc_middle::mir::interpret::GlobalId;
104104
use rustc_middle::query::Providers;
105105
use rustc_middle::ty::{self, Ty, TyCtxt};
106-
use rustc_middle::util;
107106
use rustc_session::parse::feature_err;
108107
use rustc_span::{symbol::sym, Span};
109108
use rustc_target::spec::abi::Abi;

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
561561

562562
// Unify `interior` with `witness` and collect all the resulting obligations.
563563
let span = self.tcx.hir().body(body_id).value.span;
564+
let ty::Infer(ty::InferTy::TyVar(_)) = interior.kind() else {
565+
span_bug!(span, "coroutine interior witness not infer: {:?}", interior.kind())
566+
};
564567
let ok = self
565568
.at(&self.misc(span), self.param_env)
566-
.eq(DefineOpaqueTypes::No, interior, witness)
569+
// Will never define opaque types, as all we do is instantiate a type variable.
570+
.eq(DefineOpaqueTypes::Yes, interior, witness)
567571
.expect("Failed to unify coroutine interior type");
568572
let mut obligations = ok.obligations;
569573

compiler/rustc_middle/src/util/common.rs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
use rustc_data_structures::sync::Lock;
2-
3-
use std::fmt::Debug;
4-
use std::time::{Duration, Instant};
5-
61
#[cfg(test)]
72
mod tests;
83

@@ -26,46 +21,6 @@ pub fn to_readable_str(mut val: usize) -> String {
2621
groups.join("_")
2722
}
2823

29-
pub fn record_time<T, F>(accu: &Lock<Duration>, f: F) -> T
30-
where
31-
F: FnOnce() -> T,
32-
{
33-
let start = Instant::now();
34-
let rv = f();
35-
let duration = start.elapsed();
36-
let mut accu = accu.lock();
37-
*accu += duration;
38-
rv
39-
}
40-
41-
pub fn indent<R, F>(op: F) -> R
42-
where
43-
R: Debug,
44-
F: FnOnce() -> R,
45-
{
46-
// Use in conjunction with the log post-processor like `src/etc/indenter`
47-
// to make debug output more readable.
48-
debug!(">>");
49-
let r = op();
50-
debug!("<< (Result = {:?})", r);
51-
r
52-
}
53-
54-
pub struct Indenter {
55-
_cannot_construct_outside_of_this_module: (),
56-
}
57-
58-
impl Drop for Indenter {
59-
fn drop(&mut self) {
60-
debug!("<<");
61-
}
62-
}
63-
64-
pub fn indenter() -> Indenter {
65-
debug!(">>");
66-
Indenter { _cannot_construct_outside_of_this_module: () }
67-
}
68-
6924
// const wrapper for `if let Some((_, tail)) = name.rsplit_once(':') { tail } else { name }`
7025
pub const fn c_name(name: &'static str) -> &'static str {
7126
// FIXME Simplify the implementation once more `str` methods get const-stable.

compiler/rustc_type_ir/src/ty_kind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ pub enum TyKind<I: Interner> {
181181
/// Looking at the following example, the witness for this coroutine
182182
/// may end up as something like `for<'a> [Vec<i32>, &'a Vec<i32>]`:
183183
///
184-
/// ```ignore UNSOLVED (ask @compiler-errors, should this error? can we just swap the yields?)
184+
/// ```
185185
/// #![feature(coroutines)]
186-
/// |a| {
186+
/// static |a| {
187187
/// let x = &vec![3];
188188
/// yield a;
189189
/// yield x[0];

config.example.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#
5151
# Note that many of the LLVM options are not currently supported for
5252
# downloading. Currently only the "assertions" option can be toggled.
53-
#download-ci-llvm = if rust.channel == "dev" { "if-unchanged" } else { false }
53+
#download-ci-llvm = if rust.channel == "dev" || rust.download-rustc != false { "if-unchanged" } else { false }
5454

5555
# Indicates whether the LLVM build is a Release or Debug build
5656
#optimize = true

library/std/src/path.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2143,10 +2143,10 @@ impl Path {
21432143
/// # Examples
21442144
///
21452145
/// ```
2146-
/// use std::path::Path;
2146+
/// use std::path::{Path, PathBuf};
21472147
///
21482148
/// let path_buf = Path::new("foo.txt").to_path_buf();
2149-
/// assert_eq!(path_buf, std::path::PathBuf::from("foo.txt"));
2149+
/// assert_eq!(path_buf, PathBuf::from("foo.txt"));
21502150
/// ```
21512151
#[rustc_conversion_suggestion]
21522152
#[must_use = "this returns the result of the operation, \
@@ -2278,10 +2278,9 @@ impl Path {
22782278
/// Produces an iterator over `Path` and its ancestors.
22792279
///
22802280
/// The iterator will yield the `Path` that is returned if the [`parent`] method is used zero
2281-
/// or more times. That means, the iterator will yield `&self`, `&self.parent().unwrap()`,
2282-
/// `&self.parent().unwrap().parent().unwrap()` and so on. If the [`parent`] method returns
2283-
/// [`None`], the iterator will do likewise. The iterator will always yield at least one value,
2284-
/// namely `&self`.
2281+
/// or more times. If the [`parent`] method returns [`None`], the iterator will do likewise.
2282+
/// The iterator will always yield at least one value, namely `Some(&self)`. Next it will yield
2283+
/// `&self.parent()`, `&self.parent().and_then(Path::parent)` and so on.
22852284
///
22862285
/// # Examples
22872286
///

src/bootstrap/src/core/config/config.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,9 +2483,20 @@ impl Config {
24832483
llvm::is_ci_llvm_available(self, asserts)
24842484
}
24852485
};
2486+
24862487
match download_ci_llvm {
2487-
None => self.channel == "dev" && if_unchanged(),
2488-
Some(StringOrBool::Bool(b)) => b,
2488+
None => {
2489+
(self.channel == "dev" || self.download_rustc_commit.is_some()) && if_unchanged()
2490+
}
2491+
Some(StringOrBool::Bool(b)) => {
2492+
if !b && self.download_rustc_commit.is_some() {
2493+
panic!(
2494+
"`llvm.download-ci-llvm` cannot be set to `false` if `rust.download-rustc` is set to `true` or `if-unchanged`."
2495+
);
2496+
}
2497+
2498+
b
2499+
}
24892500
// FIXME: "if-available" is deprecated. Remove this block later (around mid 2024)
24902501
// to not break builds between the recent-to-old checkouts.
24912502
Some(StringOrBool::String(s)) if s == "if-available" => {

0 commit comments

Comments
 (0)