Skip to content

Commit 9ec85bc

Browse files
committed
Auto merge of #154083 - JonathanBrouwer:rollup-mdOkZ8f, r=JonathanBrouwer
Rollup of 12 pull requests Successful merges: - #152870 (Do not enable split debuginfo for windows-gnu) - #153333 (Fix bootstrap rust build failure for vxworks) - #153681 (ci: add runners for vanilla LLVM 22) - #153824 (Add `Wake` diagnostic item for `alloc::task::Wake`) - #154077 (Optimize 128-bit integer formatting) - #154078 (`define_callbacks` tweaks) - #151905 (Split the `dec2flt::RawFloat` trait for easier reuse) - #153170 (Add is_disconnected functions to mpsc and mpmc channels) - #153804 (Derive Macro Eq: link to more detailed documentation) - #153974 (Point at return type when it is the source of the type expectation) - #154018 (simplify and remove `tests/ui/kindck` and related tests) - #154041 (bootstrap: Allow `--bless`ing changes to editor settings files)
2 parents 8b86f48 + 7cc8bd7 commit 9ec85bc

61 files changed

Lines changed: 1163 additions & 920 deletions

File tree

Some content is hidden

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

bootstrap.example.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,9 +1013,10 @@
10131013
# its historical default, but when compiling the compiler itself, we skip it by
10141014
# default since we know it's safe to do so in that case.
10151015
#
1016-
# On Windows platforms, packed debuginfo is the only supported option,
1017-
# producing a `.pdb` file.
1018-
#split-debuginfo = if linux { off } else if windows { packed } else if apple { unpacked }
1016+
# On Windows MSVC platforms, packed debuginfo is the only supported option,
1017+
# producing a `.pdb` file. On Windows GNU rustc doesn't support splitting debuginfo,
1018+
# and enabling it causes issues.
1019+
#split-debuginfo = if linux || windows-gnu { off } else if windows-msvc { packed } else if apple { unpacked }
10191020

10201021
# Path to the `llvm-config` binary of the installation of a custom LLVM to link
10211022
# against. Note that if this is specified we don't compile LLVM at all for this

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_hir::attrs::DivergingBlockBehavior;
1111
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
1212
use rustc_hir::def_id::DefId;
1313
use rustc_hir::intravisit::Visitor;
14-
use rustc_hir::{Expr, ExprKind, HirId, LangItem, Node, QPath, is_range_literal};
14+
use rustc_hir::{Expr, ExprKind, FnRetTy, HirId, LangItem, Node, QPath, is_range_literal};
1515
use rustc_hir_analysis::check::potentially_plural_count;
1616
use rustc_hir_analysis::hir_ty_lowering::{HirTyLowerer, PermitVariants};
1717
use rustc_index::IndexVec;
@@ -1587,6 +1587,45 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
15871587
}
15881588
}
15891589
err.span_note(spans, format!("{} defined here", self.tcx.def_descr(def_id)));
1590+
if let DefKind::Fn | DefKind::AssocFn = self.tcx.def_kind(def_id)
1591+
&& let ty::Param(_) =
1592+
self.tcx.fn_sig(def_id).instantiate_identity().skip_binder().output().kind()
1593+
&& let parent = self.tcx.hir_get_parent_item(call_expr.hir_id).def_id
1594+
&& let Some((output, body_id)) = match self.tcx.hir_node_by_def_id(parent) {
1595+
hir::Node::Item(hir::Item {
1596+
kind: hir::ItemKind::Fn { sig, body, .. },
1597+
..
1598+
})
1599+
| hir::Node::TraitItem(hir::TraitItem {
1600+
kind: hir::TraitItemKind::Fn(sig, hir::TraitFn::Provided(body)),
1601+
..
1602+
})
1603+
| hir::Node::ImplItem(hir::ImplItem {
1604+
kind: hir::ImplItemKind::Fn(sig, body),
1605+
..
1606+
}) => Some((sig.decl.output, body)),
1607+
_ => None,
1608+
}
1609+
&& let expr = self.tcx.hir_body(*body_id).value
1610+
&& (expr.peel_blocks().span == call_expr.span
1611+
|| matches!(
1612+
self.tcx.parent_hir_node(call_expr.hir_id),
1613+
hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Ret(_), .. })
1614+
))
1615+
{
1616+
err.span_label(
1617+
output.span(),
1618+
match output {
1619+
FnRetTy::DefaultReturn(_) => format!(
1620+
"this implicit `()` return type influences the call expression's return type"
1621+
),
1622+
FnRetTy::Return(_) => {
1623+
"this return type influences the call expression's return type"
1624+
.to_string()
1625+
}
1626+
},
1627+
);
1628+
}
15901629
} else if let Some(hir::Node::Expr(e)) = self.tcx.hir_get_if_local(def_id)
15911630
&& let hir::ExprKind::Closure(hir::Closure { body, .. }) = &e.kind
15921631
{

compiler/rustc_middle/src/queries.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ use crate::mir::mono::{
101101
CodegenUnit, CollectionMode, MonoItem, MonoItemPartitions, NormalizationErrorInMono,
102102
};
103103
use crate::query::describe_as_module;
104-
use crate::query::plumbing::{define_callbacks, query_helper_param_ty};
104+
use crate::query::plumbing::{define_callbacks, maybe_into_query_key};
105105
use crate::traits::query::{
106106
CanonicalAliasGoal, CanonicalDropckOutlivesGoal, CanonicalImpliedOutlivesBoundsGoal,
107107
CanonicalMethodAutoderefStepsGoal, CanonicalPredicateGoal, CanonicalTypeOpAscribeUserTypeGoal,

0 commit comments

Comments
 (0)