diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-05-10 07:30:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-10 07:30:21 +0200 |
| commit | 30bd6cb726a4051c8a85dedae1173aeb9ecaca16 (patch) | |
| tree | a206d4bc3bd2842cef75b6f18eca355d6ceed558 /compiler | |
| parent | 43ddd1d96386fff1a16f6bbaec1d2d7bf9859cf9 (diff) | |
| parent | 8f9062530b2559e0e4e8affa0fefaa12575e7aa2 (diff) | |
Rollup merge of #124943 - lcnr:generic-args-ref, r=compiler-errors
always use `GenericArgsRef` r? ```@compiler-errors```
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_hir_typeck/src/method/mod.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/pat.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint/src/for_loops_over_fallibles.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/misc.rs | 4 |
6 files changed, 9 insertions, 9 deletions
diff --git a/compiler/rustc_hir_typeck/src/method/mod.rs b/compiler/rustc_hir_typeck/src/method/mod.rs index 39d54f1a25e..ec613f3d14e 100644 --- a/compiler/rustc_hir_typeck/src/method/mod.rs +++ b/compiler/rustc_hir_typeck/src/method/mod.rs @@ -315,7 +315,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { trait_def_id: DefId, self_ty: Ty<'tcx>, opt_input_types: Option<&[Ty<'tcx>]>, - ) -> (traits::PredicateObligation<'tcx>, &'tcx ty::List<ty::GenericArg<'tcx>>) { + ) -> (traits::PredicateObligation<'tcx>, ty::GenericArgsRef<'tcx>) { // Construct a trait-reference `self_ty : Trait<input_tys>` let args = GenericArgs::for_item(self.tcx, trait_def_id, |param, _| { match param.kind { @@ -365,7 +365,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { m_name: Ident, trait_def_id: DefId, obligation: traits::PredicateObligation<'tcx>, - args: &'tcx ty::List<ty::GenericArg<'tcx>>, + args: ty::GenericArgsRef<'tcx>, ) -> Option<InferOk<'tcx, MethodCallee<'tcx>>> { debug!(?obligation); diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index 8c7ae7f8e98..2fab9ce9738 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -1676,7 +1676,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { unmentioned_fields: &mut Vec<(&'tcx ty::FieldDef, Ident)>, pat: &'tcx Pat<'tcx>, variant: &ty::VariantDef, - args: &'tcx ty::List<ty::GenericArg<'tcx>>, + args: ty::GenericArgsRef<'tcx>, ) -> Diag<'tcx> { let tcx = self.tcx; let (field_names, t, plural) = if let [field] = inexistent_fields { diff --git a/compiler/rustc_lint/src/for_loops_over_fallibles.rs b/compiler/rustc_lint/src/for_loops_over_fallibles.rs index ce3f45a17e9..1f9a3297844 100644 --- a/compiler/rustc_lint/src/for_loops_over_fallibles.rs +++ b/compiler/rustc_lint/src/for_loops_over_fallibles.rs @@ -9,7 +9,7 @@ use crate::{ use hir::{Expr, Pat}; use rustc_hir as hir; use rustc_infer::{infer::TyCtxtInferExt, traits::ObligationCause}; -use rustc_middle::ty::{self, List}; +use rustc_middle::ty; use rustc_session::{declare_lint, declare_lint_pass}; use rustc_span::{sym, Span}; use rustc_trait_selection::traits::ObligationCtxt; @@ -123,7 +123,7 @@ fn extract_iterator_next_call<'tcx>( fn suggest_question_mark<'tcx>( cx: &LateContext<'tcx>, adt: ty::AdtDef<'tcx>, - args: &List<ty::GenericArg<'tcx>>, + args: ty::GenericArgsRef<'tcx>, span: Span, ) -> bool { let Some(body_id) = cx.enclosing_body else { return false }; diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 94b13269bfd..0f3ebf76e75 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2331,7 +2331,7 @@ impl<'tcx> TyCtxt<'tcx> { pub fn mk_args_from_iter<I, T>(self, iter: I) -> T::Output where I: Iterator<Item = T>, - T: CollectAndApply<GenericArg<'tcx>, &'tcx List<GenericArg<'tcx>>>, + T: CollectAndApply<GenericArg<'tcx>, ty::GenericArgsRef<'tcx>>, { T::collect_and_apply(iter, |xs| self.mk_args(xs)) } diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index 5f47aef0f32..46dcd18cfbb 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -977,7 +977,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { fn pretty_print_opaque_impl_type( &mut self, def_id: DefId, - args: &'tcx ty::List<ty::GenericArg<'tcx>>, + args: ty::GenericArgsRef<'tcx>, ) -> Result<(), PrintError> { let tcx = self.tcx(); diff --git a/compiler/rustc_trait_selection/src/traits/misc.rs b/compiler/rustc_trait_selection/src/traits/misc.rs index 93f9c2333f0..da2b004761f 100644 --- a/compiler/rustc_trait_selection/src/traits/misc.rs +++ b/compiler/rustc_trait_selection/src/traits/misc.rs @@ -10,7 +10,7 @@ use rustc_infer::infer::canonical::Canonical; use rustc_infer::infer::{RegionResolutionError, TyCtxtInferExt}; use rustc_infer::traits::query::NoSolution; use rustc_infer::{infer::outlives::env::OutlivesEnvironment, traits::FulfillmentError}; -use rustc_middle::ty::{self, AdtDef, GenericArg, List, Ty, TyCtxt, TypeVisitableExt}; +use rustc_middle::ty::{self, AdtDef, Ty, TyCtxt, TypeVisitableExt}; use rustc_span::DUMMY_SP; use super::outlives_bounds::InferCtxtExt; @@ -129,7 +129,7 @@ pub fn all_fields_implement_trait<'tcx>( param_env: ty::ParamEnv<'tcx>, self_type: Ty<'tcx>, adt: AdtDef<'tcx>, - args: &'tcx List<GenericArg<'tcx>>, + args: ty::GenericArgsRef<'tcx>, parent_cause: ObligationCause<'tcx>, lang_item: LangItem, ) -> Result<(), Vec<(&'tcx ty::FieldDef, Ty<'tcx>, InfringingFieldsReason<'tcx>)>> { |
