Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e1f0920

Browse files
committedFeb 2, 2025
Auto merge of #136433 - matthiaskrgr:rollup-co27itw, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #133266 (ci: fix explanation why LLVM download is disabled for windows-gnu) - #136133 (Fix sentence in process::abort) - #136279 (Rename `tcx.ensure()` to `tcx.ensure_ok()`, and improve the associated docs) - #136328 (Rework "long type names" printing logic) - #136358 (`#[optimize(none)]` implies `#[inline(never)]`) - #136368 (Make comma separated lists of anything easier to make for errors) - #136412 (Tweak fn pointer suggestion span) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 6dd75f0 + 44def58 commit e1f0920

File tree

95 files changed

+725
-1131
lines changed

Some content is hidden

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

95 files changed

+725
-1131
lines changed
 

‎compiler/rustc_errors/src/lib.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub use rustc_error_messages::{
6565
SubdiagMessage, fallback_fluent_bundle, fluent_bundle,
6666
};
6767
use rustc_lint_defs::LintExpectationId;
68-
pub use rustc_lint_defs::{Applicability, pluralize};
68+
pub use rustc_lint_defs::{Applicability, listify, pluralize};
6969
use rustc_macros::{Decodable, Encodable};
7070
pub use rustc_span::ErrorGuaranteed;
7171
pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker};
@@ -1999,18 +1999,6 @@ pub fn a_or_an(s: &str) -> &'static str {
19991999
}
20002000
}
20012001

2002-
/// Grammatical tool for displaying messages to end users in a nice form.
2003-
///
2004-
/// Take a list ["a", "b", "c"] and output a display friendly version "a, b and c"
2005-
pub fn display_list_with_comma_and<T: std::fmt::Display>(v: &[T]) -> String {
2006-
match v {
2007-
[] => "".to_string(),
2008-
[a] => a.to_string(),
2009-
[a, b] => format!("{a} and {b}"),
2010-
[a, v @ ..] => format!("{a}, {}", display_list_with_comma_and(v)),
2011-
}
2012-
}
2013-
20142002
#[derive(Clone, Copy, PartialEq, Hash, Debug)]
20152003
pub enum TerminalUrl {
20162004
No,

‎compiler/rustc_hir_analysis/src/check/check.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,13 @@ fn check_static_linkage(tcx: TyCtxt<'_>, def_id: LocalDefId) {
778778
pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
779779
match tcx.def_kind(def_id) {
780780
DefKind::Static { .. } => {
781-
tcx.ensure().typeck(def_id);
781+
tcx.ensure_ok().typeck(def_id);
782782
maybe_check_static_with_link_section(tcx, def_id);
783783
check_static_inhabited(tcx, def_id);
784784
check_static_linkage(tcx, def_id);
785785
}
786786
DefKind::Const => {
787-
tcx.ensure().typeck(def_id);
787+
tcx.ensure_ok().typeck(def_id);
788788
}
789789
DefKind::Enum => {
790790
check_enum(tcx, def_id);
@@ -804,7 +804,7 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
804804
DefKind::Impl { of_trait } => {
805805
if of_trait && let Some(impl_trait_header) = tcx.impl_trait_header(def_id) {
806806
if tcx
807-
.ensure()
807+
.ensure_ok()
808808
.coherent_trait(impl_trait_header.trait_ref.instantiate_identity().def_id)
809809
.is_ok()
810810
{
@@ -1042,7 +1042,7 @@ fn check_impl_items_against_trait<'tcx>(
10421042
continue;
10431043
};
10441044

1045-
let res = tcx.ensure().compare_impl_item(impl_item.expect_local());
1045+
let res = tcx.ensure_ok().compare_impl_item(impl_item.expect_local());
10461046

10471047
if res.is_ok() {
10481048
match ty_impl_item.kind {
@@ -1488,7 +1488,7 @@ fn check_enum(tcx: TyCtxt<'_>, def_id: LocalDefId) {
14881488

14891489
for v in def.variants() {
14901490
if let ty::VariantDiscr::Explicit(discr_def_id) = v.discr {
1491-
tcx.ensure().typeck(discr_def_id.expect_local());
1491+
tcx.ensure_ok().typeck(discr_def_id.expect_local());
14921492
}
14931493
}
14941494

‎compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2034,7 +2034,7 @@ pub(super) fn check_type_bounds<'tcx>(
20342034
) -> Result<(), ErrorGuaranteed> {
20352035
// Avoid bogus "type annotations needed `Foo: Bar`" errors on `impl Bar for Foo` in case
20362036
// other `Foo` impls are incoherent.
2037-
tcx.ensure().coherent_trait(impl_trait_ref.def_id)?;
2037+
tcx.ensure_ok().coherent_trait(impl_trait_ref.def_id)?;
20382038

20392039
let param_env = tcx.param_env(impl_ty.def_id);
20402040
debug!(?param_env);
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.