diff options
| author | bors <bors@rust-lang.org> | 2024-04-03 16:16:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-04-03 16:16:52 +0000 |
| commit | 703dc9ce64d9b31a239a7280d9b5f9ddd85ffed6 (patch) | |
| tree | c39cc52942d7e2c3871c4fbd22dbba1356176583 /compiler/rustc_middle/src | |
| parent | ceab6128fa48a616bfd3e3adf4bc80133b8ee223 (diff) | |
| parent | 658c8f73677696ff2f37ea1cbd5d667d2562ccbf (diff) | |
| download | rust-703dc9ce64d9b31a239a7280d9b5f9ddd85ffed6.tar.gz rust-703dc9ce64d9b31a239a7280d9b5f9ddd85ffed6.zip | |
Auto merge of #123416 - matthiaskrgr:rollup-j85wj05, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #123209 (Add section to sanitizer doc for `-Zexternal-clangrt`) - #123342 (x.py test: remove no-op --skip flag) - #123382 (Assert `FnDef` kind) - #123386 (Set `CARGO` instead of `PATH` for Rust Clippy) - #123393 (rustc_ast: Update `P<T>` docs to reflect mutable status.) - #123394 (Postfix match fixes) - #123412 (Output URLs of CI artifacts to GitHub summary) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/thir.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/sty.rs | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index 05f6fbbbfa3..95e8509c2d3 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -12,7 +12,7 @@ use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; use rustc_errors::{DiagArgValue, IntoDiagArg}; use rustc_hir as hir; use rustc_hir::def_id::DefId; -use rustc_hir::{BindingAnnotation, ByRef, RangeEnd}; +use rustc_hir::{BindingAnnotation, ByRef, MatchSource, RangeEnd}; use rustc_index::newtype_index; use rustc_index::IndexVec; use rustc_middle::middle::region; @@ -358,6 +358,7 @@ pub enum ExprKind<'tcx> { scrutinee: ExprId, scrutinee_hir_id: hir::HirId, arms: Box<[ArmId]>, + match_source: MatchSource, }, /// A block. Block { diff --git a/compiler/rustc_middle/src/ty/sty.rs b/compiler/rustc_middle/src/ty/sty.rs index b5e619f1e2a..ba0898e07c2 100644 --- a/compiler/rustc_middle/src/ty/sty.rs +++ b/compiler/rustc_middle/src/ty/sty.rs @@ -11,7 +11,7 @@ use crate::ty::{ }; use crate::ty::{GenericArg, GenericArgs, GenericArgsRef}; use crate::ty::{List, ParamEnv}; -use hir::def::DefKind; +use hir::def::{CtorKind, DefKind}; use rustc_data_structures::captures::Captures; use rustc_errors::{DiagArgValue, ErrorGuaranteed, IntoDiagArg, MultiSpan}; use rustc_hir as hir; @@ -1677,6 +1677,10 @@ impl<'tcx> Ty<'tcx> { def_id: DefId, args: impl IntoIterator<Item: Into<GenericArg<'tcx>>>, ) -> Ty<'tcx> { + debug_assert_matches!( + tcx.def_kind(def_id), + DefKind::AssocFn | DefKind::Fn | DefKind::Ctor(_, CtorKind::Fn) + ); let args = tcx.check_and_mk_args(def_id, args); Ty::new(tcx, FnDef(def_id, args)) } |
