| author | bors <bors@rust-lang.org> 2024-07-18 06:11:35 UTC |
| committer | bors <bors@rust-lang.org> 2024-07-18 06:11:35 UTC |
| log | 52f3c71c8dc4aaed71e3035995fcbdd6d78c98c6 |
| tree | 29470eed894270e4f81716b839c190806fdf0099 |
| parent | 4bb2f278617e5498ac9a4776d3e1268154c500c5 |
| parent | 77e5bbf3412a6e5d4defb3445c729dc457cd1fc0 |
Rollup of 8 pull requests
Successful merges:
- #127077 (Make language around `ToOwned` for `BorrowedFd` more precise)
- #127783 (Put the dots back in RTN pretty printing)
- #127787 (Migrate `atomic-lock-free` to `rmake`)
- #127810 (Rename `tcx` to `cx` in `rustc_type_ir`)
- #127878 (Fix associated item removal suggestion)
- #127886 (Accurate `use` rename suggestion span)
- #127888 (More accurate span for type parameter suggestion)
- #127889 (More accurate span for anonymous argument suggestion)
r? `@ghost`
`@rustbot` modify labels: rollup80 files changed, 550 insertions(+), 383 deletions(-)
compiler/rustc_borrowck/src/type_check/relate_tys.rs+4-4| ... | ... | @@ -309,7 +309,7 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> { |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | impl<'bccx, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'bccx, 'tcx> { |
| 312 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 312 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 313 | 313 | self.type_checker.infcx.tcx |
| 314 | 314 | } |
| 315 | 315 | |
| ... | ... | @@ -370,7 +370,7 @@ impl<'bccx, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'bccx, 'tcx |
| 370 | 370 | // shouldn't ever fail. Instead, it unconditionally emits an |
| 371 | 371 | // alias-relate goal. |
| 372 | 372 | assert!(!self.type_checker.infcx.next_trait_solver()); |
| 373 | self.tcx().dcx().span_delayed_bug( | |
| 373 | self.cx().dcx().span_delayed_bug( | |
| 374 | 374 | self.span(), |
| 375 | 375 | "failure to relate an opaque to itself should result in an error later on", |
| 376 | 376 | ); |
| ... | ... | @@ -540,7 +540,7 @@ impl<'bccx, 'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for NllTypeRelating |
| 540 | 540 | &mut self, |
| 541 | 541 | obligations: impl IntoIterator<Item: ty::Upcast<TyCtxt<'tcx>, ty::Predicate<'tcx>>>, |
| 542 | 542 | ) { |
| 543 | let tcx = self.tcx(); | |
| 543 | let tcx = self.cx(); | |
| 544 | 544 | let param_env = self.param_env(); |
| 545 | 545 | self.register_goals( |
| 546 | 546 | obligations.into_iter().map(|to_pred| Goal::new(tcx, param_env, to_pred)), |
| ... | ... | @@ -559,7 +559,7 @@ impl<'bccx, 'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for NllTypeRelating |
| 559 | 559 | .into_iter() |
| 560 | 560 | .map(|goal| { |
| 561 | 561 | Obligation::new( |
| 562 | self.tcx(), | |
| 562 | self.cx(), | |
| 563 | 563 | ObligationCause::dummy_with_span(self.span()), |
| 564 | 564 | goal.param_env, |
| 565 | 565 | goal.predicate, |
compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs+11-11| ... | ... | @@ -1257,14 +1257,12 @@ pub fn prohibit_assoc_item_constraint( |
| 1257 | 1257 | }; |
| 1258 | 1258 | |
| 1259 | 1259 | // Now emit the suggestion |
| 1260 | if let Ok(suggestion) = tcx.sess.source_map().span_to_snippet(removal_span) { | |
| 1261 | e.span_suggestion_verbose( | |
| 1262 | removal_span, | |
| 1263 | format!("consider removing this associated item {}", constraint.kind.descr()), | |
| 1264 | suggestion, | |
| 1265 | Applicability::MaybeIncorrect, | |
| 1266 | ); | |
| 1267 | } | |
| 1260 | e.span_suggestion_verbose( | |
| 1261 | removal_span, | |
| 1262 | format!("consider removing this associated item {}", constraint.kind.descr()), | |
| 1263 | "", | |
| 1264 | Applicability::MaybeIncorrect, | |
| 1265 | ); | |
| 1268 | 1266 | }; |
| 1269 | 1267 | |
| 1270 | 1268 | // Suggest replacing the associated item binding with a generic argument. |
| ... | ... | @@ -1340,11 +1338,13 @@ pub fn prohibit_assoc_item_constraint( |
| 1340 | 1338 | format!("<{lifetimes}{type_with_constraints}>"), |
| 1341 | 1339 | ) |
| 1342 | 1340 | }; |
| 1343 | let suggestions = | |
| 1344 | vec![param_decl, (constraint.span, format!("{}", matching_param.name))]; | |
| 1341 | let suggestions = vec![ | |
| 1342 | param_decl, | |
| 1343 | (constraint.span.with_lo(constraint.ident.span.hi()), String::new()), | |
| 1344 | ]; | |
| 1345 | 1345 | |
| 1346 | 1346 | err.multipart_suggestion_verbose( |
| 1347 | format!("declare the type parameter right after the `impl` keyword"), | |
| 1347 | "declare the type parameter right after the `impl` keyword", | |
| 1348 | 1348 | suggestions, |
| 1349 | 1349 | Applicability::MaybeIncorrect, |
| 1350 | 1350 | ); |
compiler/rustc_infer/src/error_reporting/infer/mod.rs+1-1| ... | ... | @@ -1930,7 +1930,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1930 | 1930 | struct SameTypeModuloInfer<'a, 'tcx>(&'a InferCtxt<'tcx>); |
| 1931 | 1931 | |
| 1932 | 1932 | impl<'tcx> TypeRelation<TyCtxt<'tcx>> for SameTypeModuloInfer<'_, 'tcx> { |
| 1933 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 1933 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 1934 | 1934 | self.0.tcx |
| 1935 | 1935 | } |
| 1936 | 1936 |
compiler/rustc_infer/src/infer/outlives/test_type_match.rs+1-1| ... | ... | @@ -137,7 +137,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstHigherRankedOutlives<'tcx> |
| 137 | 137 | "MatchAgainstHigherRankedOutlives" |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 140 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 141 | 141 | self.tcx |
| 142 | 142 | } |
| 143 | 143 |
compiler/rustc_infer/src/infer/relate/generalize.rs+6-6| ... | ... | @@ -372,7 +372,7 @@ impl<'tcx> Generalizer<'_, 'tcx> { |
| 372 | 372 | |
| 373 | 373 | let is_nested_alias = mem::replace(&mut self.in_alias, true); |
| 374 | 374 | let result = match self.relate(alias, alias) { |
| 375 | Ok(alias) => Ok(alias.to_ty(self.tcx())), | |
| 375 | Ok(alias) => Ok(alias.to_ty(self.cx())), | |
| 376 | 376 | Err(e) => { |
| 377 | 377 | if is_nested_alias { |
| 378 | 378 | return Err(e); |
| ... | ... | @@ -397,7 +397,7 @@ impl<'tcx> Generalizer<'_, 'tcx> { |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 400 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 400 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 401 | 401 | self.infcx.tcx |
| 402 | 402 | } |
| 403 | 403 | |
| ... | ... | @@ -417,7 +417,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 417 | 417 | // (e.g., #41849). |
| 418 | 418 | relate::relate_args_invariantly(self, a_arg, b_arg) |
| 419 | 419 | } else { |
| 420 | let tcx = self.tcx(); | |
| 420 | let tcx = self.cx(); | |
| 421 | 421 | let opt_variances = tcx.variances_of(item_def_id); |
| 422 | 422 | relate::relate_args_with_variances( |
| 423 | 423 | self, |
| ... | ... | @@ -525,7 +525,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | debug!("replacing original vid={:?} with new={:?}", vid, new_var_id); |
| 528 | Ok(Ty::new_var(self.tcx(), new_var_id)) | |
| 528 | Ok(Ty::new_var(self.cx(), new_var_id)) | |
| 529 | 529 | } |
| 530 | 530 | } |
| 531 | 531 | } |
| ... | ... | @@ -654,7 +654,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 654 | 654 | { |
| 655 | 655 | variable_table.union(vid, new_var_id); |
| 656 | 656 | } |
| 657 | Ok(ty::Const::new_var(self.tcx(), new_var_id)) | |
| 657 | Ok(ty::Const::new_var(self.cx(), new_var_id)) | |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | } |
| ... | ... | @@ -672,7 +672,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 672 | 672 | args, |
| 673 | 673 | args, |
| 674 | 674 | )?; |
| 675 | Ok(ty::Const::new_unevaluated(self.tcx(), ty::UnevaluatedConst { def, args })) | |
| 675 | Ok(ty::Const::new_unevaluated(self.cx(), ty::UnevaluatedConst { def, args })) | |
| 676 | 676 | } |
| 677 | 677 | ty::ConstKind::Placeholder(placeholder) => { |
| 678 | 678 | if self.for_universe.can_name(placeholder.universe) { |
compiler/rustc_infer/src/infer/relate/glb.rs+2-2| ... | ... | @@ -27,7 +27,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Glb<'_, '_, 'tcx> { |
| 27 | 27 | "Glb" |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 30 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 31 | 31 | self.fields.tcx() |
| 32 | 32 | } |
| 33 | 33 | |
| ... | ... | @@ -61,7 +61,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Glb<'_, '_, 'tcx> { |
| 61 | 61 | let origin = SubregionOrigin::Subtype(Box::new(self.fields.trace.clone())); |
| 62 | 62 | // GLB(&'static u8, &'a u8) == &RegionLUB('static, 'a) u8 == &'static u8 |
| 63 | 63 | Ok(self.fields.infcx.inner.borrow_mut().unwrap_region_constraints().lub_regions( |
| 64 | self.tcx(), | |
| 64 | self.cx(), | |
| 65 | 65 | origin, |
| 66 | 66 | a, |
| 67 | 67 | b, |
compiler/rustc_infer/src/infer/relate/lub.rs+2-2| ... | ... | @@ -27,7 +27,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Lub<'_, '_, 'tcx> { |
| 27 | 27 | "Lub" |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 30 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 31 | 31 | self.fields.tcx() |
| 32 | 32 | } |
| 33 | 33 | |
| ... | ... | @@ -61,7 +61,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Lub<'_, '_, 'tcx> { |
| 61 | 61 | let origin = SubregionOrigin::Subtype(Box::new(self.fields.trace.clone())); |
| 62 | 62 | // LUB(&'static u8, &'a u8) == &RegionGLB('static, 'a) u8 == &'a u8 |
| 63 | 63 | Ok(self.fields.infcx.inner.borrow_mut().unwrap_region_constraints().glb_regions( |
| 64 | self.tcx(), | |
| 64 | self.cx(), | |
| 65 | 65 | origin, |
| 66 | 66 | a, |
| 67 | 67 | b, |
compiler/rustc_infer/src/infer/relate/type_relating.rs+5-5| ... | ... | @@ -32,7 +32,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> { |
| 32 | 32 | "TypeRelating" |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 35 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 36 | 36 | self.fields.infcx.tcx |
| 37 | 37 | } |
| 38 | 38 | |
| ... | ... | @@ -48,7 +48,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> { |
| 48 | 48 | // (e.g., #41849). |
| 49 | 49 | relate_args_invariantly(self, a_arg, b_arg) |
| 50 | 50 | } else { |
| 51 | let tcx = self.tcx(); | |
| 51 | let tcx = self.cx(); | |
| 52 | 52 | let opt_variances = tcx.variances_of(item_def_id); |
| 53 | 53 | relate_args_with_variances(self, item_def_id, opt_variances, a_arg, b_arg, false) |
| 54 | 54 | } |
| ... | ... | @@ -88,7 +88,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> { |
| 88 | 88 | // can't make progress on `A <: B` if both A and B are |
| 89 | 89 | // type variables, so record an obligation. |
| 90 | 90 | self.fields.goals.push(Goal::new( |
| 91 | self.tcx(), | |
| 91 | self.cx(), | |
| 92 | 92 | self.fields.param_env, |
| 93 | 93 | ty::Binder::dummy(ty::PredicateKind::Subtype(ty::SubtypePredicate { |
| 94 | 94 | a_is_expected: true, |
| ... | ... | @@ -101,7 +101,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> { |
| 101 | 101 | // can't make progress on `B <: A` if both A and B are |
| 102 | 102 | // type variables, so record an obligation. |
| 103 | 103 | self.fields.goals.push(Goal::new( |
| 104 | self.tcx(), | |
| 104 | self.cx(), | |
| 105 | 105 | self.fields.param_env, |
| 106 | 106 | ty::Binder::dummy(ty::PredicateKind::Subtype(ty::SubtypePredicate { |
| 107 | 107 | a_is_expected: false, |
| ... | ... | @@ -134,7 +134,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> { |
| 134 | 134 | |
| 135 | 135 | (&ty::Error(e), _) | (_, &ty::Error(e)) => { |
| 136 | 136 | infcx.set_tainted_by_errors(e); |
| 137 | return Ok(Ty::new_error(self.tcx(), e)); | |
| 137 | return Ok(Ty::new_error(self.cx(), e)); | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | ( |
compiler/rustc_macros/src/lift.rs+1-1| ... | ... | @@ -45,7 +45,7 @@ pub fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStre |
| 45 | 45 | quote! { |
| 46 | 46 | type Lifted = #lifted; |
| 47 | 47 | |
| 48 | fn lift_to_tcx(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> { | |
| 48 | fn lift_to_interner(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> { | |
| 49 | 49 | Some(match self { #body }) |
| 50 | 50 | } |
| 51 | 51 | }, |
compiler/rustc_middle/src/macros.rs+1-1| ... | ... | @@ -59,7 +59,7 @@ macro_rules! TrivialLiftImpls { |
| 59 | 59 | $( |
| 60 | 60 | impl<'tcx> $crate::ty::Lift<$crate::ty::TyCtxt<'tcx>> for $ty { |
| 61 | 61 | type Lifted = Self; |
| 62 | fn lift_to_tcx(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> { | |
| 62 | fn lift_to_interner(self, _: $crate::ty::TyCtxt<'tcx>) -> Option<Self> { | |
| 63 | 63 | Some(self) |
| 64 | 64 | } |
| 65 | 65 | } |
compiler/rustc_middle/src/ty/context.rs+4-4| ... | ... | @@ -1484,7 +1484,7 @@ impl<'tcx> TyCtxt<'tcx> { |
| 1484 | 1484 | } |
| 1485 | 1485 | |
| 1486 | 1486 | pub fn lift<T: Lift<TyCtxt<'tcx>>>(self, value: T) -> Option<T::Lifted> { |
| 1487 | value.lift_to_tcx(self) | |
| 1487 | value.lift_to_interner(self) | |
| 1488 | 1488 | } |
| 1489 | 1489 | |
| 1490 | 1490 | /// Creates a type context. To use the context call `fn enter` which |
| ... | ... | @@ -2087,7 +2087,7 @@ macro_rules! nop_lift { |
| 2087 | 2087 | ($set:ident; $ty:ty => $lifted:ty) => { |
| 2088 | 2088 | impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for $ty { |
| 2089 | 2089 | type Lifted = $lifted; |
| 2090 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2090 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2091 | 2091 | // Assert that the set has the right type. |
| 2092 | 2092 | // Given an argument that has an interned type, the return type has the type of |
| 2093 | 2093 | // the corresponding interner set. This won't actually return anything, we're |
| ... | ... | @@ -2122,7 +2122,7 @@ macro_rules! nop_list_lift { |
| 2122 | 2122 | ($set:ident; $ty:ty => $lifted:ty) => { |
| 2123 | 2123 | impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a List<$ty> { |
| 2124 | 2124 | type Lifted = &'tcx List<$lifted>; |
| 2125 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2125 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2126 | 2126 | // Assert that the set has the right type. |
| 2127 | 2127 | if false { |
| 2128 | 2128 | let _x: &InternedSet<'tcx, List<$lifted>> = &tcx.interners.$set; |
| ... | ... | @@ -2160,7 +2160,7 @@ macro_rules! nop_slice_lift { |
| 2160 | 2160 | ($ty:ty => $lifted:ty) => { |
| 2161 | 2161 | impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for &'a [$ty] { |
| 2162 | 2162 | type Lifted = &'tcx [$lifted]; |
| 2163 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2163 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 2164 | 2164 | if self.is_empty() { |
| 2165 | 2165 | return Some(&[]); |
| 2166 | 2166 | } |
compiler/rustc_middle/src/ty/generic_args.rs+1-1| ... | ... | @@ -308,7 +308,7 @@ impl<'tcx> GenericArg<'tcx> { |
| 308 | 308 | impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for GenericArg<'a> { |
| 309 | 309 | type Lifted = GenericArg<'tcx>; |
| 310 | 310 | |
| 311 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 311 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 312 | 312 | match self.unpack() { |
| 313 | 313 | GenericArgKind::Lifetime(lt) => tcx.lift(lt).map(|lt| lt.into()), |
| 314 | 314 | GenericArgKind::Type(ty) => tcx.lift(ty).map(|ty| ty.into()), |
compiler/rustc_middle/src/ty/print/pretty.rs+5-2| ... | ... | @@ -1214,11 +1214,14 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { |
| 1214 | 1214 | && let ty::Alias(_, alias_ty) = |
| 1215 | 1215 | self.tcx().fn_sig(fn_def_id).skip_binder().output().skip_binder().kind() |
| 1216 | 1216 | && alias_ty.def_id == def_id |
| 1217 | && let generics = self.tcx().generics_of(fn_def_id) | |
| 1218 | // FIXME(return_type_notation): We only support lifetime params for now. | |
| 1219 | && generics.own_params.iter().all(|param| matches!(param.kind, ty::GenericParamDefKind::Lifetime)) | |
| 1217 | 1220 | { |
| 1218 | let num_args = self.tcx().generics_of(fn_def_id).count(); | |
| 1221 | let num_args = generics.count(); | |
| 1219 | 1222 | write!(self, " {{ ")?; |
| 1220 | 1223 | self.print_def_path(fn_def_id, &args[..num_args])?; |
| 1221 | write!(self, "() }}")?; | |
| 1224 | write!(self, "(..) }}")?; | |
| 1222 | 1225 | } |
| 1223 | 1226 | |
| 1224 | 1227 | Ok(()) |
compiler/rustc_middle/src/ty/relate.rs+2-2| ... | ... | @@ -69,7 +69,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for ty::Pattern<'tcx> { |
| 69 | 69 | if inc_a != inc_b { |
| 70 | 70 | todo!() |
| 71 | 71 | } |
| 72 | Ok(relation.tcx().mk_pat(ty::PatternKind::Range { start, end, include_end: inc_a })) | |
| 72 | Ok(relation.cx().mk_pat(ty::PatternKind::Range { start, end, include_end: inc_a })) | |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
| ... | ... | @@ -81,7 +81,7 @@ impl<'tcx> Relate<TyCtxt<'tcx>> for &'tcx ty::List<ty::PolyExistentialPredicate< |
| 81 | 81 | a: Self, |
| 82 | 82 | b: Self, |
| 83 | 83 | ) -> RelateResult<'tcx, Self> { |
| 84 | let tcx = relation.tcx(); | |
| 84 | let tcx = relation.cx(); | |
| 85 | 85 | |
| 86 | 86 | // FIXME: this is wasteful, but want to do a perf run to see how slow it is. |
| 87 | 87 | // We need to perform this deduplication as we sometimes generate duplicate projections |
compiler/rustc_middle/src/ty/structural_impls.rs+2-2| ... | ... | @@ -283,7 +283,7 @@ TrivialTypeTraversalAndLiftImpls! { |
| 283 | 283 | |
| 284 | 284 | impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> { |
| 285 | 285 | type Lifted = Option<T::Lifted>; |
| 286 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 286 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 287 | 287 | Some(match self { |
| 288 | 288 | Some(x) => Some(tcx.lift(x)?), |
| 289 | 289 | None => None, |
| ... | ... | @@ -293,7 +293,7 @@ impl<'tcx, T: Lift<TyCtxt<'tcx>>> Lift<TyCtxt<'tcx>> for Option<T> { |
| 293 | 293 | |
| 294 | 294 | impl<'a, 'tcx> Lift<TyCtxt<'tcx>> for Term<'a> { |
| 295 | 295 | type Lifted = ty::Term<'tcx>; |
| 296 | fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 296 | fn lift_to_interner(self, tcx: TyCtxt<'tcx>) -> Option<Self::Lifted> { | |
| 297 | 297 | match self.unpack() { |
| 298 | 298 | TermKind::Ty(ty) => tcx.lift(ty).map(Into::into), |
| 299 | 299 | TermKind::Const(c) => tcx.lift(c).map(Into::into), |
compiler/rustc_parse/src/parser/diagnostics.rs+6-6| ... | ... | @@ -2240,11 +2240,11 @@ impl<'a> Parser<'a> { |
| 2240 | 2240 | } |
| 2241 | 2241 | _ => { |
| 2242 | 2242 | // Otherwise, try to get a type and emit a suggestion. |
| 2243 | if let Some(ty) = pat.to_ty() { | |
| 2243 | if let Some(_) = pat.to_ty() { | |
| 2244 | 2244 | err.span_suggestion_verbose( |
| 2245 | pat.span, | |
| 2245 | pat.span.shrink_to_lo(), | |
| 2246 | 2246 | "explicitly ignore the parameter name", |
| 2247 | format!("_: {}", pprust::ty_to_string(&ty)), | |
| 2247 | "_: ".to_string(), | |
| 2248 | 2248 | Applicability::MachineApplicable, |
| 2249 | 2249 | ); |
| 2250 | 2250 | err.note(rfc_note); |
| ... | ... | @@ -2256,7 +2256,7 @@ impl<'a> Parser<'a> { |
| 2256 | 2256 | |
| 2257 | 2257 | // `fn foo(a, b) {}`, `fn foo(a<x>, b<y>) {}` or `fn foo(usize, usize) {}` |
| 2258 | 2258 | if first_param { |
| 2259 | err.span_suggestion( | |
| 2259 | err.span_suggestion_verbose( | |
| 2260 | 2260 | self_span, |
| 2261 | 2261 | "if this is a `self` type, give it a parameter name", |
| 2262 | 2262 | self_sugg, |
| ... | ... | @@ -2266,14 +2266,14 @@ impl<'a> Parser<'a> { |
| 2266 | 2266 | // Avoid suggesting that `fn foo(HashMap<u32>)` is fixed with a change to |
| 2267 | 2267 | // `fn foo(HashMap: TypeName<u32>)`. |
| 2268 | 2268 | if self.token != token::Lt { |
| 2269 | err.span_suggestion( | |
| 2269 | err.span_suggestion_verbose( | |
| 2270 | 2270 | param_span, |
| 2271 | 2271 | "if this is a parameter name, give it a type", |
| 2272 | 2272 | param_sugg, |
| 2273 | 2273 | Applicability::HasPlaceholders, |
| 2274 | 2274 | ); |
| 2275 | 2275 | } |
| 2276 | err.span_suggestion( | |
| 2276 | err.span_suggestion_verbose( | |
| 2277 | 2277 | type_span, |
| 2278 | 2278 | "if this is a type, explicitly ignore the parameter name", |
| 2279 | 2279 | type_sugg, |
compiler/rustc_resolve/src/diagnostics.rs+10-8| ... | ... | @@ -371,6 +371,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { |
| 371 | 371 | }; |
| 372 | 372 | |
| 373 | 373 | let mut suggestion = None; |
| 374 | let mut span = binding_span; | |
| 374 | 375 | match import.kind { |
| 375 | 376 | ImportKind::Single { type_ns_only: true, .. } => { |
| 376 | 377 | suggestion = Some(format!("self as {suggested_name}")) |
| ... | ... | @@ -381,12 +382,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { |
| 381 | 382 | { |
| 382 | 383 | if let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(binding_span) { |
| 383 | 384 | if pos <= snippet.len() { |
| 384 | suggestion = Some(format!( | |
| 385 | "{} as {}{}", | |
| 386 | &snippet[..pos], | |
| 387 | suggested_name, | |
| 388 | if snippet.ends_with(';') { ";" } else { "" } | |
| 389 | )) | |
| 385 | span = binding_span | |
| 386 | .with_lo(binding_span.lo() + BytePos(pos as u32)) | |
| 387 | .with_hi( | |
| 388 | binding_span.hi() | |
| 389 | - BytePos(if snippet.ends_with(';') { 1 } else { 0 }), | |
| 390 | ); | |
| 391 | suggestion = Some(format!(" as {suggested_name}")); | |
| 390 | 392 | } |
| 391 | 393 | } |
| 392 | 394 | } |
| ... | ... | @@ -402,9 +404,9 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { |
| 402 | 404 | } |
| 403 | 405 | |
| 404 | 406 | if let Some(suggestion) = suggestion { |
| 405 | err.subdiagnostic(ChangeImportBindingSuggestion { span: binding_span, suggestion }); | |
| 407 | err.subdiagnostic(ChangeImportBindingSuggestion { span, suggestion }); | |
| 406 | 408 | } else { |
| 407 | err.subdiagnostic(ChangeImportBinding { span: binding_span }); | |
| 409 | err.subdiagnostic(ChangeImportBinding { span }); | |
| 408 | 410 | } |
| 409 | 411 | } |
| 410 | 412 |
compiler/rustc_trait_selection/src/traits/select/_match.rs+2-2| ... | ... | @@ -36,7 +36,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstFreshVars<'tcx> { |
| 36 | 36 | "MatchAgainstFreshVars" |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | fn tcx(&self) -> TyCtxt<'tcx> { | |
| 39 | fn cx(&self) -> TyCtxt<'tcx> { | |
| 40 | 40 | self.tcx |
| 41 | 41 | } |
| 42 | 42 | |
| ... | ... | @@ -77,7 +77,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstFreshVars<'tcx> { |
| 77 | 77 | Err(TypeError::Sorts(ExpectedFound::new(true, a, b))) |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | (&ty::Error(guar), _) | (_, &ty::Error(guar)) => Ok(Ty::new_error(self.tcx(), guar)), | |
| 80 | (&ty::Error(guar), _) | (_, &ty::Error(guar)) => Ok(Ty::new_error(self.cx(), guar)), | |
| 81 | 81 | |
| 82 | 82 | _ => structurally_relate_tys(self, a, b), |
| 83 | 83 | } |
compiler/rustc_type_ir/src/binder.rs+18-18| ... | ... | @@ -49,10 +49,10 @@ where |
| 49 | 49 | { |
| 50 | 50 | type Lifted = Binder<U, T::Lifted>; |
| 51 | 51 | |
| 52 | fn lift_to_tcx(self, tcx: U) -> Option<Self::Lifted> { | |
| 52 | fn lift_to_interner(self, cx: U) -> Option<Self::Lifted> { | |
| 53 | 53 | Some(Binder { |
| 54 | value: self.value.lift_to_tcx(tcx)?, | |
| 55 | bound_vars: self.bound_vars.lift_to_tcx(tcx)?, | |
| 54 | value: self.value.lift_to_interner(cx)?, | |
| 55 | bound_vars: self.bound_vars.lift_to_interner(cx)?, | |
| 56 | 56 | }) |
| 57 | 57 | } |
| 58 | 58 | } |
| ... | ... | @@ -439,11 +439,11 @@ impl<I: Interner, Iter: IntoIterator> EarlyBinder<I, Iter> |
| 439 | 439 | where |
| 440 | 440 | Iter::Item: TypeFoldable<I>, |
| 441 | 441 | { |
| 442 | pub fn iter_instantiated<A>(self, tcx: I, args: A) -> IterInstantiated<I, Iter, A> | |
| 442 | pub fn iter_instantiated<A>(self, cx: I, args: A) -> IterInstantiated<I, Iter, A> | |
| 443 | 443 | where |
| 444 | 444 | A: SliceLike<Item = I::GenericArg>, |
| 445 | 445 | { |
| 446 | IterInstantiated { it: self.value.into_iter(), tcx, args } | |
| 446 | IterInstantiated { it: self.value.into_iter(), cx, args } | |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | /// Similar to [`instantiate_identity`](EarlyBinder::instantiate_identity), |
| ... | ... | @@ -455,7 +455,7 @@ where |
| 455 | 455 | |
| 456 | 456 | pub struct IterInstantiated<I: Interner, Iter: IntoIterator, A> { |
| 457 | 457 | it: Iter::IntoIter, |
| 458 | tcx: I, | |
| 458 | cx: I, | |
| 459 | 459 | args: A, |
| 460 | 460 | } |
| 461 | 461 | |
| ... | ... | @@ -469,7 +469,7 @@ where |
| 469 | 469 | fn next(&mut self) -> Option<Self::Item> { |
| 470 | 470 | Some( |
| 471 | 471 | EarlyBinder { value: self.it.next()?, _tcx: PhantomData } |
| 472 | .instantiate(self.tcx, self.args), | |
| 472 | .instantiate(self.cx, self.args), | |
| 473 | 473 | ) |
| 474 | 474 | } |
| 475 | 475 | |
| ... | ... | @@ -487,7 +487,7 @@ where |
| 487 | 487 | fn next_back(&mut self) -> Option<Self::Item> { |
| 488 | 488 | Some( |
| 489 | 489 | EarlyBinder { value: self.it.next_back()?, _tcx: PhantomData } |
| 490 | .instantiate(self.tcx, self.args), | |
| 490 | .instantiate(self.cx, self.args), | |
| 491 | 491 | ) |
| 492 | 492 | } |
| 493 | 493 | } |
| ... | ... | @@ -507,10 +507,10 @@ where |
| 507 | 507 | { |
| 508 | 508 | pub fn iter_instantiated_copied( |
| 509 | 509 | self, |
| 510 | tcx: I, | |
| 510 | cx: I, | |
| 511 | 511 | args: &'s [I::GenericArg], |
| 512 | 512 | ) -> IterInstantiatedCopied<'s, I, Iter> { |
| 513 | IterInstantiatedCopied { it: self.value.into_iter(), tcx, args } | |
| 513 | IterInstantiatedCopied { it: self.value.into_iter(), cx, args } | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | /// Similar to [`instantiate_identity`](EarlyBinder::instantiate_identity), |
| ... | ... | @@ -522,7 +522,7 @@ where |
| 522 | 522 | |
| 523 | 523 | pub struct IterInstantiatedCopied<'a, I: Interner, Iter: IntoIterator> { |
| 524 | 524 | it: Iter::IntoIter, |
| 525 | tcx: I, | |
| 525 | cx: I, | |
| 526 | 526 | args: &'a [I::GenericArg], |
| 527 | 527 | } |
| 528 | 528 | |
| ... | ... | @@ -535,7 +535,7 @@ where |
| 535 | 535 | |
| 536 | 536 | fn next(&mut self) -> Option<Self::Item> { |
| 537 | 537 | self.it.next().map(|value| { |
| 538 | EarlyBinder { value: *value, _tcx: PhantomData }.instantiate(self.tcx, self.args) | |
| 538 | EarlyBinder { value: *value, _tcx: PhantomData }.instantiate(self.cx, self.args) | |
| 539 | 539 | }) |
| 540 | 540 | } |
| 541 | 541 | |
| ... | ... | @@ -552,7 +552,7 @@ where |
| 552 | 552 | { |
| 553 | 553 | fn next_back(&mut self) -> Option<Self::Item> { |
| 554 | 554 | self.it.next_back().map(|value| { |
| 555 | EarlyBinder { value: *value, _tcx: PhantomData }.instantiate(self.tcx, self.args) | |
| 555 | EarlyBinder { value: *value, _tcx: PhantomData }.instantiate(self.cx, self.args) | |
| 556 | 556 | }) |
| 557 | 557 | } |
| 558 | 558 | } |
| ... | ... | @@ -589,11 +589,11 @@ impl<I: Interner, T: Iterator> Iterator for EarlyBinderIter<I, T> { |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | 591 | impl<I: Interner, T: TypeFoldable<I>> ty::EarlyBinder<I, T> { |
| 592 | pub fn instantiate<A>(self, tcx: I, args: A) -> T | |
| 592 | pub fn instantiate<A>(self, cx: I, args: A) -> T | |
| 593 | 593 | where |
| 594 | 594 | A: SliceLike<Item = I::GenericArg>, |
| 595 | 595 | { |
| 596 | let mut folder = ArgFolder { tcx, args: args.as_slice(), binders_passed: 0 }; | |
| 596 | let mut folder = ArgFolder { cx, args: args.as_slice(), binders_passed: 0 }; | |
| 597 | 597 | self.value.fold_with(&mut folder) |
| 598 | 598 | } |
| 599 | 599 | |
| ... | ... | @@ -619,7 +619,7 @@ impl<I: Interner, T: TypeFoldable<I>> ty::EarlyBinder<I, T> { |
| 619 | 619 | // The actual instantiation engine itself is a type folder. |
| 620 | 620 | |
| 621 | 621 | struct ArgFolder<'a, I: Interner> { |
| 622 | tcx: I, | |
| 622 | cx: I, | |
| 623 | 623 | args: &'a [I::GenericArg], |
| 624 | 624 | |
| 625 | 625 | /// Number of region binders we have passed through while doing the instantiation |
| ... | ... | @@ -629,7 +629,7 @@ struct ArgFolder<'a, I: Interner> { |
| 629 | 629 | impl<'a, I: Interner> TypeFolder<I> for ArgFolder<'a, I> { |
| 630 | 630 | #[inline] |
| 631 | 631 | fn cx(&self) -> I { |
| 632 | self.tcx | |
| 632 | self.cx | |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | fn fold_binder<T: TypeFoldable<I>>(&mut self, t: ty::Binder<I, T>) -> ty::Binder<I, T> { |
| ... | ... | @@ -858,6 +858,6 @@ impl<'a, I: Interner> ArgFolder<'a, I> { |
| 858 | 858 | if self.binders_passed == 0 || !region.has_escaping_bound_vars() { |
| 859 | 859 | return region; |
| 860 | 860 | } |
| 861 | ty::fold::shift_region(self.tcx, region, self.binders_passed) | |
| 861 | ty::fold::shift_region(self.cx, region, self.binders_passed) | |
| 862 | 862 | } |
| 863 | 863 | } |
compiler/rustc_type_ir/src/canonical.rs+6-6| ... | ... | @@ -330,25 +330,25 @@ impl<I: Interner> CanonicalVarValues<I> { |
| 330 | 330 | |
| 331 | 331 | // Given a list of canonical variables, construct a set of values which are |
| 332 | 332 | // the identity response. |
| 333 | pub fn make_identity(tcx: I, infos: I::CanonicalVars) -> CanonicalVarValues<I> { | |
| 333 | pub fn make_identity(cx: I, infos: I::CanonicalVars) -> CanonicalVarValues<I> { | |
| 334 | 334 | CanonicalVarValues { |
| 335 | var_values: tcx.mk_args_from_iter(infos.iter().enumerate().map( | |
| 335 | var_values: cx.mk_args_from_iter(infos.iter().enumerate().map( | |
| 336 | 336 | |(i, info)| -> I::GenericArg { |
| 337 | 337 | match info.kind { |
| 338 | 338 | CanonicalVarKind::Ty(_) | CanonicalVarKind::PlaceholderTy(_) => { |
| 339 | Ty::new_anon_bound(tcx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 339 | Ty::new_anon_bound(cx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 340 | 340 | .into() |
| 341 | 341 | } |
| 342 | 342 | CanonicalVarKind::Region(_) | CanonicalVarKind::PlaceholderRegion(_) => { |
| 343 | Region::new_anon_bound(tcx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 343 | Region::new_anon_bound(cx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 344 | 344 | .into() |
| 345 | 345 | } |
| 346 | 346 | CanonicalVarKind::Effect => { |
| 347 | Const::new_anon_bound(tcx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 347 | Const::new_anon_bound(cx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 348 | 348 | .into() |
| 349 | 349 | } |
| 350 | 350 | CanonicalVarKind::Const(_) | CanonicalVarKind::PlaceholderConst(_) => { |
| 351 | Const::new_anon_bound(tcx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 351 | Const::new_anon_bound(cx, ty::INNERMOST, ty::BoundVar::from_usize(i)) | |
| 352 | 352 | .into() |
| 353 | 353 | } |
| 354 | 354 | } |
compiler/rustc_type_ir/src/effects.rs+10-10| ... | ... | @@ -10,38 +10,38 @@ pub enum EffectKind { |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | impl EffectKind { |
| 13 | pub fn try_from_def_id<I: Interner>(tcx: I, def_id: I::DefId) -> Option<EffectKind> { | |
| 14 | if tcx.is_lang_item(def_id, EffectsMaybe) { | |
| 13 | pub fn try_from_def_id<I: Interner>(cx: I, def_id: I::DefId) -> Option<EffectKind> { | |
| 14 | if cx.is_lang_item(def_id, EffectsMaybe) { | |
| 15 | 15 | Some(EffectKind::Maybe) |
| 16 | } else if tcx.is_lang_item(def_id, EffectsRuntime) { | |
| 16 | } else if cx.is_lang_item(def_id, EffectsRuntime) { | |
| 17 | 17 | Some(EffectKind::Runtime) |
| 18 | } else if tcx.is_lang_item(def_id, EffectsNoRuntime) { | |
| 18 | } else if cx.is_lang_item(def_id, EffectsNoRuntime) { | |
| 19 | 19 | Some(EffectKind::NoRuntime) |
| 20 | 20 | } else { |
| 21 | 21 | None |
| 22 | 22 | } |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | pub fn to_def_id<I: Interner>(self, tcx: I) -> I::DefId { | |
| 25 | pub fn to_def_id<I: Interner>(self, cx: I) -> I::DefId { | |
| 26 | 26 | let lang_item = match self { |
| 27 | 27 | EffectKind::Maybe => EffectsMaybe, |
| 28 | 28 | EffectKind::NoRuntime => EffectsNoRuntime, |
| 29 | 29 | EffectKind::Runtime => EffectsRuntime, |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | tcx.require_lang_item(lang_item) | |
| 32 | cx.require_lang_item(lang_item) | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | pub fn try_from_ty<I: Interner>(tcx: I, ty: I::Ty) -> Option<EffectKind> { | |
| 35 | pub fn try_from_ty<I: Interner>(cx: I, ty: I::Ty) -> Option<EffectKind> { | |
| 36 | 36 | if let crate::Adt(def, _) = ty.kind() { |
| 37 | Self::try_from_def_id(tcx, def.def_id()) | |
| 37 | Self::try_from_def_id(cx, def.def_id()) | |
| 38 | 38 | } else { |
| 39 | 39 | None |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | pub fn to_ty<I: Interner>(self, tcx: I) -> I::Ty { | |
| 44 | I::Ty::new_adt(tcx, tcx.adt_def(self.to_def_id(tcx)), Default::default()) | |
| 43 | pub fn to_ty<I: Interner>(self, cx: I) -> I::Ty { | |
| 44 | I::Ty::new_adt(cx, cx.adt_def(self.to_def_id(cx)), Default::default()) | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /// Returns an intersection between two effect kinds. If one effect kind |
compiler/rustc_type_ir/src/elaborate.rs+4-4| ... | ... | @@ -258,17 +258,17 @@ pub fn supertrait_def_ids<I: Interner>( |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | pub fn supertraits<I: Interner>( |
| 261 | tcx: I, | |
| 261 | cx: I, | |
| 262 | 262 | trait_ref: ty::Binder<I, ty::TraitRef<I>>, |
| 263 | 263 | ) -> FilterToTraits<I, Elaborator<I, I::Clause>> { |
| 264 | elaborate(tcx, [trait_ref.upcast(tcx)]).filter_only_self().filter_to_traits() | |
| 264 | elaborate(cx, [trait_ref.upcast(cx)]).filter_only_self().filter_to_traits() | |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | 267 | pub fn transitive_bounds<I: Interner>( |
| 268 | tcx: I, | |
| 268 | cx: I, | |
| 269 | 269 | trait_refs: impl Iterator<Item = ty::Binder<I, ty::TraitRef<I>>>, |
| 270 | 270 | ) -> FilterToTraits<I, Elaborator<I, I::Clause>> { |
| 271 | elaborate(tcx, trait_refs.map(|trait_ref| trait_ref.upcast(tcx))) | |
| 271 | elaborate(cx, trait_refs.map(|trait_ref| trait_ref.upcast(cx))) | |
| 272 | 272 | .filter_only_self() |
| 273 | 273 | .filter_to_traits() |
| 274 | 274 | } |
compiler/rustc_type_ir/src/fast_reject.rs+3-3| ... | ... | @@ -105,7 +105,7 @@ pub enum TreatParams { |
| 105 | 105 | /// |
| 106 | 106 | /// ¹ meaning that if the outermost layers are different, then the whole types are also different. |
| 107 | 107 | pub fn simplify_type<I: Interner>( |
| 108 | tcx: I, | |
| 108 | cx: I, | |
| 109 | 109 | ty: I::Ty, |
| 110 | 110 | treat_params: TreatParams, |
| 111 | 111 | ) -> Option<SimplifiedType<I::DefId>> { |
| ... | ... | @@ -119,10 +119,10 @@ pub fn simplify_type<I: Interner>( |
| 119 | 119 | ty::Str => Some(SimplifiedType::Str), |
| 120 | 120 | ty::Array(..) => Some(SimplifiedType::Array), |
| 121 | 121 | ty::Slice(..) => Some(SimplifiedType::Slice), |
| 122 | ty::Pat(ty, ..) => simplify_type(tcx, ty, treat_params), | |
| 122 | ty::Pat(ty, ..) => simplify_type(cx, ty, treat_params), | |
| 123 | 123 | ty::RawPtr(_, mutbl) => Some(SimplifiedType::Ptr(mutbl)), |
| 124 | 124 | ty::Dynamic(trait_info, ..) => match trait_info.principal_def_id() { |
| 125 | Some(principal_def_id) if !tcx.trait_is_auto(principal_def_id) => { | |
| 125 | Some(principal_def_id) if !cx.trait_is_auto(principal_def_id) => { | |
| 126 | 126 | Some(SimplifiedType::Trait(principal_def_id)) |
| 127 | 127 | } |
| 128 | 128 | _ => Some(SimplifiedType::MarkerTraitObject), |
compiler/rustc_type_ir/src/fold.rs+11-11| ... | ... | @@ -345,20 +345,20 @@ impl<I: Interner, T: TypeFoldable<I>, Ix: Idx> TypeFoldable<I> for IndexVec<Ix, |
| 345 | 345 | // `rustc_middle/src/ty/generic_args.rs` for more details. |
| 346 | 346 | |
| 347 | 347 | struct Shifter<I: Interner> { |
| 348 | tcx: I, | |
| 348 | cx: I, | |
| 349 | 349 | current_index: ty::DebruijnIndex, |
| 350 | 350 | amount: u32, |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | impl<I: Interner> Shifter<I> { |
| 354 | pub fn new(tcx: I, amount: u32) -> Self { | |
| 355 | Shifter { tcx, current_index: ty::INNERMOST, amount } | |
| 354 | pub fn new(cx: I, amount: u32) -> Self { | |
| 355 | Shifter { cx, current_index: ty::INNERMOST, amount } | |
| 356 | 356 | } |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | impl<I: Interner> TypeFolder<I> for Shifter<I> { |
| 360 | 360 | fn cx(&self) -> I { |
| 361 | self.tcx | |
| 361 | self.cx | |
| 362 | 362 | } |
| 363 | 363 | |
| 364 | 364 | fn fold_binder<T: TypeFoldable<I>>(&mut self, t: ty::Binder<I, T>) -> ty::Binder<I, T> { |
| ... | ... | @@ -372,7 +372,7 @@ impl<I: Interner> TypeFolder<I> for Shifter<I> { |
| 372 | 372 | match r.kind() { |
| 373 | 373 | ty::ReBound(debruijn, br) if debruijn >= self.current_index => { |
| 374 | 374 | let debruijn = debruijn.shifted_in(self.amount); |
| 375 | Region::new_bound(self.tcx, debruijn, br) | |
| 375 | Region::new_bound(self.cx, debruijn, br) | |
| 376 | 376 | } |
| 377 | 377 | _ => r, |
| 378 | 378 | } |
| ... | ... | @@ -382,7 +382,7 @@ impl<I: Interner> TypeFolder<I> for Shifter<I> { |
| 382 | 382 | match ty.kind() { |
| 383 | 383 | ty::Bound(debruijn, bound_ty) if debruijn >= self.current_index => { |
| 384 | 384 | let debruijn = debruijn.shifted_in(self.amount); |
| 385 | Ty::new_bound(self.tcx, debruijn, bound_ty) | |
| 385 | Ty::new_bound(self.cx, debruijn, bound_ty) | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | _ if ty.has_vars_bound_at_or_above(self.current_index) => ty.super_fold_with(self), |
| ... | ... | @@ -394,7 +394,7 @@ impl<I: Interner> TypeFolder<I> for Shifter<I> { |
| 394 | 394 | match ct.kind() { |
| 395 | 395 | ty::ConstKind::Bound(debruijn, bound_ct) if debruijn >= self.current_index => { |
| 396 | 396 | let debruijn = debruijn.shifted_in(self.amount); |
| 397 | Const::new_bound(self.tcx, debruijn, bound_ct) | |
| 397 | Const::new_bound(self.cx, debruijn, bound_ct) | |
| 398 | 398 | } |
| 399 | 399 | _ => ct.super_fold_with(self), |
| 400 | 400 | } |
| ... | ... | @@ -405,16 +405,16 @@ impl<I: Interner> TypeFolder<I> for Shifter<I> { |
| 405 | 405 | } |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | pub fn shift_region<I: Interner>(tcx: I, region: I::Region, amount: u32) -> I::Region { | |
| 408 | pub fn shift_region<I: Interner>(cx: I, region: I::Region, amount: u32) -> I::Region { | |
| 409 | 409 | match region.kind() { |
| 410 | 410 | ty::ReBound(debruijn, br) if amount > 0 => { |
| 411 | Region::new_bound(tcx, debruijn.shifted_in(amount), br) | |
| 411 | Region::new_bound(cx, debruijn.shifted_in(amount), br) | |
| 412 | 412 | } |
| 413 | 413 | _ => region, |
| 414 | 414 | } |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | pub fn shift_vars<I: Interner, T>(tcx: I, value: T, amount: u32) -> T | |
| 417 | pub fn shift_vars<I: Interner, T>(cx: I, value: T, amount: u32) -> T | |
| 418 | 418 | where |
| 419 | 419 | T: TypeFoldable<I>, |
| 420 | 420 | { |
| ... | ... | @@ -424,5 +424,5 @@ where |
| 424 | 424 | return value; |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | value.fold_with(&mut Shifter::new(tcx, amount)) | |
| 427 | value.fold_with(&mut Shifter::new(cx, amount)) | |
| 428 | 428 | } |
compiler/rustc_type_ir/src/inherent.rs+1-1| ... | ... | @@ -475,7 +475,7 @@ pub trait Clause<I: Interner<Clause = Self>>: |
| 475 | 475 | /// poly-trait-ref to supertraits that must hold if that |
| 476 | 476 | /// poly-trait-ref holds. This is slightly different from a normal |
| 477 | 477 | /// instantiation in terms of what happens with bound regions. |
| 478 | fn instantiate_supertrait(self, tcx: I, trait_ref: ty::Binder<I, ty::TraitRef<I>>) -> Self; | |
| 478 | fn instantiate_supertrait(self, cx: I, trait_ref: ty::Binder<I, ty::TraitRef<I>>) -> Self; | |
| 479 | 479 | } |
| 480 | 480 | |
| 481 | 481 | /// Common capabilities of placeholder kinds |
compiler/rustc_type_ir/src/lift.rs+1-1| ... | ... | @@ -17,5 +17,5 @@ |
| 17 | 17 | /// e.g., `()` or `u8`, was interned in a different context. |
| 18 | 18 | pub trait Lift<I>: std::fmt::Debug { |
| 19 | 19 | type Lifted: std::fmt::Debug; |
| 20 | fn lift_to_tcx(self, tcx: I) -> Option<Self::Lifted>; | |
| 20 | fn lift_to_interner(self, cx: I) -> Option<Self::Lifted>; | |
| 21 | 21 | } |
compiler/rustc_type_ir/src/opaque_ty.rs+5-5| ... | ... | @@ -22,8 +22,8 @@ pub struct OpaqueTypeKey<I: Interner> { |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | impl<I: Interner> OpaqueTypeKey<I> { |
| 25 | pub fn iter_captured_args(self, tcx: I) -> impl Iterator<Item = (usize, I::GenericArg)> { | |
| 26 | let variances = tcx.variances_of(self.def_id.into()); | |
| 25 | pub fn iter_captured_args(self, cx: I) -> impl Iterator<Item = (usize, I::GenericArg)> { | |
| 26 | let variances = cx.variances_of(self.def_id.into()); | |
| 27 | 27 | std::iter::zip(self.args.iter(), variances.iter()).enumerate().filter_map( |
| 28 | 28 | |(i, (arg, v))| match (arg.kind(), v) { |
| 29 | 29 | (_, ty::Invariant) => Some((i, arg)), |
| ... | ... | @@ -35,18 +35,18 @@ impl<I: Interner> OpaqueTypeKey<I> { |
| 35 | 35 | |
| 36 | 36 | pub fn fold_captured_lifetime_args( |
| 37 | 37 | self, |
| 38 | tcx: I, | |
| 38 | cx: I, | |
| 39 | 39 | mut f: impl FnMut(I::Region) -> I::Region, |
| 40 | 40 | ) -> Self { |
| 41 | 41 | let Self { def_id, args } = self; |
| 42 | let variances = tcx.variances_of(def_id.into()); | |
| 42 | let variances = cx.variances_of(def_id.into()); | |
| 43 | 43 | let args = |
| 44 | 44 | std::iter::zip(args.iter(), variances.iter()).map(|(arg, v)| match (arg.kind(), v) { |
| 45 | 45 | (ty::GenericArgKind::Lifetime(_), ty::Bivariant) => arg, |
| 46 | 46 | (ty::GenericArgKind::Lifetime(lt), _) => f(lt).into(), |
| 47 | 47 | _ => arg, |
| 48 | 48 | }); |
| 49 | let args = tcx.mk_args_from_iter(args); | |
| 49 | let args = cx.mk_args_from_iter(args); | |
| 50 | 50 | Self { def_id, args } |
| 51 | 51 | } |
| 52 | 52 | } |
compiler/rustc_type_ir/src/outlives.rs+7-7| ... | ... | @@ -54,15 +54,15 @@ pub enum Component<I: Interner> { |
| 54 | 54 | /// Push onto `out` all the things that must outlive `'a` for the condition |
| 55 | 55 | /// `ty0: 'a` to hold. Note that `ty0` must be a **fully resolved type**. |
| 56 | 56 | pub fn push_outlives_components<I: Interner>( |
| 57 | tcx: I, | |
| 57 | cx: I, | |
| 58 | 58 | ty: I::Ty, |
| 59 | 59 | out: &mut SmallVec<[Component<I>; 4]>, |
| 60 | 60 | ) { |
| 61 | ty.visit_with(&mut OutlivesCollector { tcx, out, visited: Default::default() }); | |
| 61 | ty.visit_with(&mut OutlivesCollector { cx, out, visited: Default::default() }); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | struct OutlivesCollector<'a, I: Interner> { |
| 65 | tcx: I, | |
| 65 | cx: I, | |
| 66 | 66 | out: &'a mut SmallVec<[Component<I>; 4]>, |
| 67 | 67 | visited: SsoHashSet<I::Ty>, |
| 68 | 68 | } |
| ... | ... | @@ -147,7 +147,7 @@ impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I> { |
| 147 | 147 | // OutlivesProjectionComponents. Continue walking |
| 148 | 148 | // through and constrain Pi. |
| 149 | 149 | let mut subcomponents = smallvec![]; |
| 150 | compute_alias_components_recursive(self.tcx, ty, &mut subcomponents); | |
| 150 | compute_alias_components_recursive(self.cx, ty, &mut subcomponents); | |
| 151 | 151 | self.out.push(Component::EscapingAlias(subcomponents.into_iter().collect())); |
| 152 | 152 | } |
| 153 | 153 | } |
| ... | ... | @@ -206,7 +206,7 @@ impl<I: Interner> TypeVisitor<I> for OutlivesCollector<'_, I> { |
| 206 | 206 | /// This should not be used to get the components of `parent` itself. |
| 207 | 207 | /// Use [push_outlives_components] instead. |
| 208 | 208 | pub fn compute_alias_components_recursive<I: Interner>( |
| 209 | tcx: I, | |
| 209 | cx: I, | |
| 210 | 210 | alias_ty: I::Ty, |
| 211 | 211 | out: &mut SmallVec<[Component<I>; 4]>, |
| 212 | 212 | ) { |
| ... | ... | @@ -215,9 +215,9 @@ pub fn compute_alias_components_recursive<I: Interner>( |
| 215 | 215 | }; |
| 216 | 216 | |
| 217 | 217 | let opt_variances = |
| 218 | if kind == ty::Opaque { Some(tcx.variances_of(alias_ty.def_id)) } else { None }; | |
| 218 | if kind == ty::Opaque { Some(cx.variances_of(alias_ty.def_id)) } else { None }; | |
| 219 | 219 | |
| 220 | let mut visitor = OutlivesCollector { tcx, out, visited: Default::default() }; | |
| 220 | let mut visitor = OutlivesCollector { cx, out, visited: Default::default() }; | |
| 221 | 221 | |
| 222 | 222 | for (index, child) in alias_ty.args.iter().enumerate() { |
| 223 | 223 | if opt_variances.and_then(|variances| variances.get(index)) == Some(ty::Bivariant) { |
compiler/rustc_type_ir/src/predicate.rs+18-20| ... | ... | @@ -34,8 +34,8 @@ where |
| 34 | 34 | { |
| 35 | 35 | type Lifted = OutlivesPredicate<U, A::Lifted>; |
| 36 | 36 | |
| 37 | fn lift_to_tcx(self, tcx: U) -> Option<Self::Lifted> { | |
| 38 | Some(OutlivesPredicate(self.0.lift_to_tcx(tcx)?, self.1.lift_to_tcx(tcx)?)) | |
| 37 | fn lift_to_interner(self, cx: U) -> Option<Self::Lifted> { | |
| 38 | Some(OutlivesPredicate(self.0.lift_to_interner(cx)?, self.1.lift_to_interner(cx)?)) | |
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| ... | ... | @@ -267,25 +267,23 @@ impl<I: Interner> ty::Binder<I, ExistentialPredicate<I>> { |
| 267 | 267 | /// Given an existential predicate like `?Self: PartialEq<u32>` (e.g., derived from `dyn PartialEq<u32>`), |
| 268 | 268 | /// and a concrete type `self_ty`, returns a full predicate where the existentially quantified variable `?Self` |
| 269 | 269 | /// has been replaced with `self_ty` (e.g., `self_ty: PartialEq<u32>`, in our example). |
| 270 | pub fn with_self_ty(&self, tcx: I, self_ty: I::Ty) -> I::Clause { | |
| 270 | pub fn with_self_ty(&self, cx: I, self_ty: I::Ty) -> I::Clause { | |
| 271 | 271 | match self.skip_binder() { |
| 272 | ExistentialPredicate::Trait(tr) => { | |
| 273 | self.rebind(tr).with_self_ty(tcx, self_ty).upcast(tcx) | |
| 274 | } | |
| 272 | ExistentialPredicate::Trait(tr) => self.rebind(tr).with_self_ty(cx, self_ty).upcast(cx), | |
| 275 | 273 | ExistentialPredicate::Projection(p) => { |
| 276 | self.rebind(p.with_self_ty(tcx, self_ty)).upcast(tcx) | |
| 274 | self.rebind(p.with_self_ty(cx, self_ty)).upcast(cx) | |
| 277 | 275 | } |
| 278 | 276 | ExistentialPredicate::AutoTrait(did) => { |
| 279 | let generics = tcx.generics_of(did); | |
| 277 | let generics = cx.generics_of(did); | |
| 280 | 278 | let trait_ref = if generics.count() == 1 { |
| 281 | ty::TraitRef::new(tcx, did, [self_ty]) | |
| 279 | ty::TraitRef::new(cx, did, [self_ty]) | |
| 282 | 280 | } else { |
| 283 | 281 | // If this is an ill-formed auto trait, then synthesize |
| 284 | 282 | // new error args for the missing generics. |
| 285 | let err_args = GenericArgs::extend_with_error(tcx, did, &[self_ty.into()]); | |
| 286 | ty::TraitRef::new_from_args(tcx, did, err_args) | |
| 283 | let err_args = GenericArgs::extend_with_error(cx, did, &[self_ty.into()]); | |
| 284 | ty::TraitRef::new_from_args(cx, did, err_args) | |
| 287 | 285 | }; |
| 288 | self.rebind(trait_ref).upcast(tcx) | |
| 286 | self.rebind(trait_ref).upcast(cx) | |
| 289 | 287 | } |
| 290 | 288 | } |
| 291 | 289 | } |
| ... | ... | @@ -345,8 +343,8 @@ impl<I: Interner> ty::Binder<I, ExistentialTraitRef<I>> { |
| 345 | 343 | /// we convert the principal trait-ref into a normal trait-ref, |
| 346 | 344 | /// you must give *some* self type. A common choice is `mk_err()` |
| 347 | 345 | /// or some placeholder type. |
| 348 | pub fn with_self_ty(&self, tcx: I, self_ty: I::Ty) -> ty::Binder<I, TraitRef<I>> { | |
| 349 | self.map_bound(|trait_ref| trait_ref.with_self_ty(tcx, self_ty)) | |
| 346 | pub fn with_self_ty(&self, cx: I, self_ty: I::Ty) -> ty::Binder<I, TraitRef<I>> { | |
| 347 | self.map_bound(|trait_ref| trait_ref.with_self_ty(cx, self_ty)) | |
| 350 | 348 | } |
| 351 | 349 | } |
| 352 | 350 | |
| ... | ... | @@ -406,8 +404,8 @@ impl<I: Interner> ExistentialProjection<I> { |
| 406 | 404 | } |
| 407 | 405 | |
| 408 | 406 | impl<I: Interner> ty::Binder<I, ExistentialProjection<I>> { |
| 409 | pub fn with_self_ty(&self, tcx: I, self_ty: I::Ty) -> ty::Binder<I, ProjectionPredicate<I>> { | |
| 410 | self.map_bound(|p| p.with_self_ty(tcx, self_ty)) | |
| 407 | pub fn with_self_ty(&self, cx: I, self_ty: I::Ty) -> ty::Binder<I, ProjectionPredicate<I>> { | |
| 408 | self.map_bound(|p| p.with_self_ty(cx, self_ty)) | |
| 411 | 409 | } |
| 412 | 410 | |
| 413 | 411 | pub fn item_def_id(&self) -> I::DefId { |
| ... | ... | @@ -669,21 +667,21 @@ impl<I: Interner> ProjectionPredicate<I> { |
| 669 | 667 | impl<I: Interner> ty::Binder<I, ProjectionPredicate<I>> { |
| 670 | 668 | /// Returns the `DefId` of the trait of the associated item being projected. |
| 671 | 669 | #[inline] |
| 672 | pub fn trait_def_id(&self, tcx: I) -> I::DefId { | |
| 673 | self.skip_binder().projection_term.trait_def_id(tcx) | |
| 670 | pub fn trait_def_id(&self, cx: I) -> I::DefId { | |
| 671 | self.skip_binder().projection_term.trait_def_id(cx) | |
| 674 | 672 | } |
| 675 | 673 | |
| 676 | 674 | /// Get the trait ref required for this projection to be well formed. |
| 677 | 675 | /// Note that for generic associated types the predicates of the associated |
| 678 | 676 | /// type also need to be checked. |
| 679 | 677 | #[inline] |
| 680 | pub fn required_poly_trait_ref(&self, tcx: I) -> ty::Binder<I, TraitRef<I>> { | |
| 678 | pub fn required_poly_trait_ref(&self, cx: I) -> ty::Binder<I, TraitRef<I>> { | |
| 681 | 679 | // Note: unlike with `TraitRef::to_poly_trait_ref()`, |
| 682 | 680 | // `self.0.trait_ref` is permitted to have escaping regions. |
| 683 | 681 | // This is because here `self` has a `Binder` and so does our |
| 684 | 682 | // return value, so we are preserving the number of binding |
| 685 | 683 | // levels. |
| 686 | self.map_bound(|predicate| predicate.projection_term.trait_ref(tcx)) | |
| 684 | self.map_bound(|predicate| predicate.projection_term.trait_ref(cx)) | |
| 687 | 685 | } |
| 688 | 686 | |
| 689 | 687 | pub fn term(&self) -> ty::Binder<I, I::Term> { |
compiler/rustc_type_ir/src/relate.rs+44-45| ... | ... | @@ -56,7 +56,7 @@ impl<I: Interner> VarianceDiagInfo<I> { |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | pub trait TypeRelation<I: Interner>: Sized { |
| 59 | fn tcx(&self) -> I; | |
| 59 | fn cx(&self) -> I; | |
| 60 | 60 | |
| 61 | 61 | /// Returns a static string we can use for printouts. |
| 62 | 62 | fn tag(&self) -> &'static str; |
| ... | ... | @@ -80,8 +80,8 @@ pub trait TypeRelation<I: Interner>: Sized { |
| 80 | 80 | item_def_id, a_arg, b_arg |
| 81 | 81 | ); |
| 82 | 82 | |
| 83 | let tcx = self.tcx(); | |
| 84 | let opt_variances = tcx.variances_of(item_def_id); | |
| 83 | let cx = self.cx(); | |
| 84 | let opt_variances = cx.variances_of(item_def_id); | |
| 85 | 85 | relate_args_with_variances(self, item_def_id, opt_variances, a_arg, b_arg, true) |
| 86 | 86 | } |
| 87 | 87 | |
| ... | ... | @@ -128,7 +128,7 @@ pub fn relate_args_invariantly<I: Interner, R: TypeRelation<I>>( |
| 128 | 128 | a_arg: I::GenericArgs, |
| 129 | 129 | b_arg: I::GenericArgs, |
| 130 | 130 | ) -> RelateResult<I, I::GenericArgs> { |
| 131 | relation.tcx().mk_args_from_iter(iter::zip(a_arg.iter(), b_arg.iter()).map(|(a, b)| { | |
| 131 | relation.cx().mk_args_from_iter(iter::zip(a_arg.iter(), b_arg.iter()).map(|(a, b)| { | |
| 132 | 132 | relation.relate_with_variance(ty::Invariant, VarianceDiagInfo::default(), a, b) |
| 133 | 133 | })) |
| 134 | 134 | } |
| ... | ... | @@ -141,14 +141,13 @@ pub fn relate_args_with_variances<I: Interner, R: TypeRelation<I>>( |
| 141 | 141 | b_arg: I::GenericArgs, |
| 142 | 142 | fetch_ty_for_diag: bool, |
| 143 | 143 | ) -> RelateResult<I, I::GenericArgs> { |
| 144 | let tcx = relation.tcx(); | |
| 144 | let cx = relation.cx(); | |
| 145 | 145 | |
| 146 | 146 | let mut cached_ty = None; |
| 147 | 147 | let params = iter::zip(a_arg.iter(), b_arg.iter()).enumerate().map(|(i, (a, b))| { |
| 148 | 148 | let variance = variances.get(i).unwrap(); |
| 149 | 149 | let variance_info = if variance == ty::Invariant && fetch_ty_for_diag { |
| 150 | let ty = | |
| 151 | *cached_ty.get_or_insert_with(|| tcx.type_of(ty_def_id).instantiate(tcx, a_arg)); | |
| 150 | let ty = *cached_ty.get_or_insert_with(|| cx.type_of(ty_def_id).instantiate(cx, a_arg)); | |
| 152 | 151 | VarianceDiagInfo::Invariant { ty, param_index: i.try_into().unwrap() } |
| 153 | 152 | } else { |
| 154 | 153 | VarianceDiagInfo::default() |
| ... | ... | @@ -156,7 +155,7 @@ pub fn relate_args_with_variances<I: Interner, R: TypeRelation<I>>( |
| 156 | 155 | relation.relate_with_variance(variance, variance_info, a, b) |
| 157 | 156 | }); |
| 158 | 157 | |
| 159 | tcx.mk_args_from_iter(params) | |
| 158 | cx.mk_args_from_iter(params) | |
| 160 | 159 | } |
| 161 | 160 | |
| 162 | 161 | impl<I: Interner> Relate<I> for ty::FnSig<I> { |
| ... | ... | @@ -165,7 +164,7 @@ impl<I: Interner> Relate<I> for ty::FnSig<I> { |
| 165 | 164 | a: ty::FnSig<I>, |
| 166 | 165 | b: ty::FnSig<I>, |
| 167 | 166 | ) -> RelateResult<I, ty::FnSig<I>> { |
| 168 | let tcx = relation.tcx(); | |
| 167 | let cx = relation.cx(); | |
| 169 | 168 | |
| 170 | 169 | if a.c_variadic != b.c_variadic { |
| 171 | 170 | return Err(TypeError::VariadicMismatch({ |
| ... | ... | @@ -210,7 +209,7 @@ impl<I: Interner> Relate<I> for ty::FnSig<I> { |
| 210 | 209 | r => r, |
| 211 | 210 | }); |
| 212 | 211 | Ok(ty::FnSig { |
| 213 | inputs_and_output: tcx.mk_type_list_from_iter(inputs_and_output)?, | |
| 212 | inputs_and_output: cx.mk_type_list_from_iter(inputs_and_output)?, | |
| 214 | 213 | c_variadic: a.c_variadic, |
| 215 | 214 | safety, |
| 216 | 215 | abi, |
| ... | ... | @@ -245,11 +244,11 @@ impl<I: Interner> Relate<I> for ty::AliasTy<I> { |
| 245 | 244 | ExpectedFound::new(true, a, b) |
| 246 | 245 | })) |
| 247 | 246 | } else { |
| 248 | let args = match a.kind(relation.tcx()) { | |
| 247 | let args = match a.kind(relation.cx()) { | |
| 249 | 248 | ty::Opaque => relate_args_with_variances( |
| 250 | 249 | relation, |
| 251 | 250 | a.def_id, |
| 252 | relation.tcx().variances_of(a.def_id), | |
| 251 | relation.cx().variances_of(a.def_id), | |
| 253 | 252 | a.args, |
| 254 | 253 | b.args, |
| 255 | 254 | false, // do not fetch `type_of(a_def_id)`, as it will cause a cycle |
| ... | ... | @@ -258,7 +257,7 @@ impl<I: Interner> Relate<I> for ty::AliasTy<I> { |
| 258 | 257 | relate_args_invariantly(relation, a.args, b.args)? |
| 259 | 258 | } |
| 260 | 259 | }; |
| 261 | Ok(ty::AliasTy::new_from_args(relation.tcx(), a.def_id, args)) | |
| 260 | Ok(ty::AliasTy::new_from_args(relation.cx(), a.def_id, args)) | |
| 262 | 261 | } |
| 263 | 262 | } |
| 264 | 263 | } |
| ... | ... | @@ -276,11 +275,11 @@ impl<I: Interner> Relate<I> for ty::AliasTerm<I> { |
| 276 | 275 | ExpectedFound::new(true, a, b) |
| 277 | 276 | })) |
| 278 | 277 | } else { |
| 279 | let args = match a.kind(relation.tcx()) { | |
| 278 | let args = match a.kind(relation.cx()) { | |
| 280 | 279 | ty::AliasTermKind::OpaqueTy => relate_args_with_variances( |
| 281 | 280 | relation, |
| 282 | 281 | a.def_id, |
| 283 | relation.tcx().variances_of(a.def_id), | |
| 282 | relation.cx().variances_of(a.def_id), | |
| 284 | 283 | a.args, |
| 285 | 284 | b.args, |
| 286 | 285 | false, // do not fetch `type_of(a_def_id)`, as it will cause a cycle |
| ... | ... | @@ -293,7 +292,7 @@ impl<I: Interner> Relate<I> for ty::AliasTerm<I> { |
| 293 | 292 | relate_args_invariantly(relation, a.args, b.args)? |
| 294 | 293 | } |
| 295 | 294 | }; |
| 296 | Ok(ty::AliasTerm::new_from_args(relation.tcx(), a.def_id, args)) | |
| 295 | Ok(ty::AliasTerm::new_from_args(relation.cx(), a.def_id, args)) | |
| 297 | 296 | } |
| 298 | 297 | } |
| 299 | 298 | } |
| ... | ... | @@ -343,7 +342,7 @@ impl<I: Interner> Relate<I> for ty::TraitRef<I> { |
| 343 | 342 | })) |
| 344 | 343 | } else { |
| 345 | 344 | let args = relate_args_invariantly(relation, a.args, b.args)?; |
| 346 | Ok(ty::TraitRef::new_from_args(relation.tcx(), a.def_id, args)) | |
| 345 | Ok(ty::TraitRef::new_from_args(relation.cx(), a.def_id, args)) | |
| 347 | 346 | } |
| 348 | 347 | } |
| 349 | 348 | } |
| ... | ... | @@ -377,7 +376,7 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 377 | 376 | a: I::Ty, |
| 378 | 377 | b: I::Ty, |
| 379 | 378 | ) -> RelateResult<I, I::Ty> { |
| 380 | let tcx = relation.tcx(); | |
| 379 | let cx = relation.cx(); | |
| 381 | 380 | match (a.kind(), b.kind()) { |
| 382 | 381 | (ty::Infer(_), _) | (_, ty::Infer(_)) => { |
| 383 | 382 | // The caller should handle these cases! |
| ... | ... | @@ -388,7 +387,7 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 388 | 387 | panic!("bound types encountered in structurally_relate_tys") |
| 389 | 388 | } |
| 390 | 389 | |
| 391 | (ty::Error(guar), _) | (_, ty::Error(guar)) => Ok(Ty::new_error(tcx, guar)), | |
| 390 | (ty::Error(guar), _) | (_, ty::Error(guar)) => Ok(Ty::new_error(cx, guar)), | |
| 392 | 391 | |
| 393 | 392 | (ty::Never, _) |
| 394 | 393 | | (ty::Char, _) |
| ... | ... | @@ -412,16 +411,16 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 412 | 411 | |
| 413 | 412 | (ty::Adt(a_def, a_args), ty::Adt(b_def, b_args)) if a_def == b_def => { |
| 414 | 413 | let args = relation.relate_item_args(a_def.def_id(), a_args, b_args)?; |
| 415 | Ok(Ty::new_adt(tcx, a_def, args)) | |
| 414 | Ok(Ty::new_adt(cx, a_def, args)) | |
| 416 | 415 | } |
| 417 | 416 | |
| 418 | (ty::Foreign(a_id), ty::Foreign(b_id)) if a_id == b_id => Ok(Ty::new_foreign(tcx, a_id)), | |
| 417 | (ty::Foreign(a_id), ty::Foreign(b_id)) if a_id == b_id => Ok(Ty::new_foreign(cx, a_id)), | |
| 419 | 418 | |
| 420 | 419 | (ty::Dynamic(a_obj, a_region, a_repr), ty::Dynamic(b_obj, b_region, b_repr)) |
| 421 | 420 | if a_repr == b_repr => |
| 422 | 421 | { |
| 423 | 422 | Ok(Ty::new_dynamic( |
| 424 | tcx, | |
| 423 | cx, | |
| 425 | 424 | relation.relate(a_obj, b_obj)?, |
| 426 | 425 | relation.relate(a_region, b_region)?, |
| 427 | 426 | a_repr, |
| ... | ... | @@ -433,7 +432,7 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 433 | 432 | // the (anonymous) type of the same coroutine expression. So |
| 434 | 433 | // all of their regions should be equated. |
| 435 | 434 | let args = relate_args_invariantly(relation, a_args, b_args)?; |
| 436 | Ok(Ty::new_coroutine(tcx, a_id, args)) | |
| 435 | Ok(Ty::new_coroutine(cx, a_id, args)) | |
| 437 | 436 | } |
| 438 | 437 | |
| 439 | 438 | (ty::CoroutineWitness(a_id, a_args), ty::CoroutineWitness(b_id, b_args)) |
| ... | ... | @@ -443,7 +442,7 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 443 | 442 | // the (anonymous) type of the same coroutine expression. So |
| 444 | 443 | // all of their regions should be equated. |
| 445 | 444 | let args = relate_args_invariantly(relation, a_args, b_args)?; |
| 446 | Ok(Ty::new_coroutine_witness(tcx, a_id, args)) | |
| 445 | Ok(Ty::new_coroutine_witness(cx, a_id, args)) | |
| 447 | 446 | } |
| 448 | 447 | |
| 449 | 448 | (ty::Closure(a_id, a_args), ty::Closure(b_id, b_args)) if a_id == b_id => { |
| ... | ... | @@ -451,14 +450,14 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 451 | 450 | // the (anonymous) type of the same closure expression. So |
| 452 | 451 | // all of their regions should be equated. |
| 453 | 452 | let args = relate_args_invariantly(relation, a_args, b_args)?; |
| 454 | Ok(Ty::new_closure(tcx, a_id, args)) | |
| 453 | Ok(Ty::new_closure(cx, a_id, args)) | |
| 455 | 454 | } |
| 456 | 455 | |
| 457 | 456 | (ty::CoroutineClosure(a_id, a_args), ty::CoroutineClosure(b_id, b_args)) |
| 458 | 457 | if a_id == b_id => |
| 459 | 458 | { |
| 460 | 459 | let args = relate_args_invariantly(relation, a_args, b_args)?; |
| 461 | Ok(Ty::new_coroutine_closure(tcx, a_id, args)) | |
| 460 | Ok(Ty::new_coroutine_closure(cx, a_id, args)) | |
| 462 | 461 | } |
| 463 | 462 | |
| 464 | 463 | (ty::RawPtr(a_ty, a_mutbl), ty::RawPtr(b_ty, b_mutbl)) => { |
| ... | ... | @@ -475,7 +474,7 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 475 | 474 | |
| 476 | 475 | let ty = relation.relate_with_variance(variance, info, a_ty, b_ty)?; |
| 477 | 476 | |
| 478 | Ok(Ty::new_ptr(tcx, ty, a_mutbl)) | |
| 477 | Ok(Ty::new_ptr(cx, ty, a_mutbl)) | |
| 479 | 478 | } |
| 480 | 479 | |
| 481 | 480 | (ty::Ref(a_r, a_ty, a_mutbl), ty::Ref(b_r, b_ty, b_mutbl)) => { |
| ... | ... | @@ -493,18 +492,18 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 493 | 492 | let r = relation.relate(a_r, b_r)?; |
| 494 | 493 | let ty = relation.relate_with_variance(variance, info, a_ty, b_ty)?; |
| 495 | 494 | |
| 496 | Ok(Ty::new_ref(tcx, r, ty, a_mutbl)) | |
| 495 | Ok(Ty::new_ref(cx, r, ty, a_mutbl)) | |
| 497 | 496 | } |
| 498 | 497 | |
| 499 | 498 | (ty::Array(a_t, sz_a), ty::Array(b_t, sz_b)) => { |
| 500 | 499 | let t = relation.relate(a_t, b_t)?; |
| 501 | 500 | match relation.relate(sz_a, sz_b) { |
| 502 | Ok(sz) => Ok(Ty::new_array_with_const_len(tcx, t, sz)), | |
| 501 | Ok(sz) => Ok(Ty::new_array_with_const_len(cx, t, sz)), | |
| 503 | 502 | Err(err) => { |
| 504 | 503 | // Check whether the lengths are both concrete/known values, |
| 505 | 504 | // but are unequal, for better diagnostics. |
| 506 | let sz_a = sz_a.try_to_target_usize(tcx); | |
| 507 | let sz_b = sz_b.try_to_target_usize(tcx); | |
| 505 | let sz_a = sz_a.try_to_target_usize(cx); | |
| 506 | let sz_b = sz_b.try_to_target_usize(cx); | |
| 508 | 507 | |
| 509 | 508 | match (sz_a, sz_b) { |
| 510 | 509 | (Some(sz_a_val), Some(sz_b_val)) if sz_a_val != sz_b_val => Err( |
| ... | ... | @@ -518,13 +517,13 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 518 | 517 | |
| 519 | 518 | (ty::Slice(a_t), ty::Slice(b_t)) => { |
| 520 | 519 | let t = relation.relate(a_t, b_t)?; |
| 521 | Ok(Ty::new_slice(tcx, t)) | |
| 520 | Ok(Ty::new_slice(cx, t)) | |
| 522 | 521 | } |
| 523 | 522 | |
| 524 | 523 | (ty::Tuple(as_), ty::Tuple(bs)) => { |
| 525 | 524 | if as_.len() == bs.len() { |
| 526 | 525 | Ok(Ty::new_tup_from_iter( |
| 527 | tcx, | |
| 526 | cx, | |
| 528 | 527 | iter::zip(as_.iter(), bs.iter()).map(|(a, b)| relation.relate(a, b)), |
| 529 | 528 | )?) |
| 530 | 529 | } else if !(as_.is_empty() || bs.is_empty()) { |
| ... | ... | @@ -536,25 +535,25 @@ pub fn structurally_relate_tys<I: Interner, R: TypeRelation<I>>( |
| 536 | 535 | |
| 537 | 536 | (ty::FnDef(a_def_id, a_args), ty::FnDef(b_def_id, b_args)) if a_def_id == b_def_id => { |
| 538 | 537 | let args = relation.relate_item_args(a_def_id, a_args, b_args)?; |
| 539 | Ok(Ty::new_fn_def(tcx, a_def_id, args)) | |
| 538 | Ok(Ty::new_fn_def(cx, a_def_id, args)) | |
| 540 | 539 | } |
| 541 | 540 | |
| 542 | 541 | (ty::FnPtr(a_fty), ty::FnPtr(b_fty)) => { |
| 543 | 542 | let fty = relation.relate(a_fty, b_fty)?; |
| 544 | Ok(Ty::new_fn_ptr(tcx, fty)) | |
| 543 | Ok(Ty::new_fn_ptr(cx, fty)) | |
| 545 | 544 | } |
| 546 | 545 | |
| 547 | 546 | // Alias tend to mostly already be handled downstream due to normalization. |
| 548 | 547 | (ty::Alias(a_kind, a_data), ty::Alias(b_kind, b_data)) => { |
| 549 | 548 | let alias_ty = relation.relate(a_data, b_data)?; |
| 550 | 549 | assert_eq!(a_kind, b_kind); |
| 551 | Ok(Ty::new_alias(tcx, a_kind, alias_ty)) | |
| 550 | Ok(Ty::new_alias(cx, a_kind, alias_ty)) | |
| 552 | 551 | } |
| 553 | 552 | |
| 554 | 553 | (ty::Pat(a_ty, a_pat), ty::Pat(b_ty, b_pat)) => { |
| 555 | 554 | let ty = relation.relate(a_ty, b_ty)?; |
| 556 | 555 | let pat = relation.relate(a_pat, b_pat)?; |
| 557 | Ok(Ty::new_pat(tcx, ty, pat)) | |
| 556 | Ok(Ty::new_pat(cx, ty, pat)) | |
| 558 | 557 | } |
| 559 | 558 | |
| 560 | 559 | _ => Err(TypeError::Sorts(ExpectedFound::new(true, a, b))), |
| ... | ... | @@ -573,11 +572,11 @@ pub fn structurally_relate_consts<I: Interner, R: TypeRelation<I>>( |
| 573 | 572 | mut b: I::Const, |
| 574 | 573 | ) -> RelateResult<I, I::Const> { |
| 575 | 574 | debug!("{}.structurally_relate_consts(a = {:?}, b = {:?})", relation.tag(), a, b); |
| 576 | let tcx = relation.tcx(); | |
| 575 | let cx = relation.cx(); | |
| 577 | 576 | |
| 578 | if tcx.features().generic_const_exprs() { | |
| 579 | a = tcx.expand_abstract_consts(a); | |
| 580 | b = tcx.expand_abstract_consts(b); | |
| 577 | if cx.features().generic_const_exprs() { | |
| 578 | a = cx.expand_abstract_consts(a); | |
| 579 | b = cx.expand_abstract_consts(b); | |
| 581 | 580 | } |
| 582 | 581 | |
| 583 | 582 | debug!("{}.structurally_relate_consts(normed_a = {:?}, normed_b = {:?})", relation.tag(), a, b); |
| ... | ... | @@ -607,8 +606,8 @@ pub fn structurally_relate_consts<I: Interner, R: TypeRelation<I>>( |
| 607 | 606 | // be stabilized. |
| 608 | 607 | (ty::ConstKind::Unevaluated(au), ty::ConstKind::Unevaluated(bu)) if au.def == bu.def => { |
| 609 | 608 | if cfg!(debug_assertions) { |
| 610 | let a_ty = tcx.type_of(au.def).instantiate(tcx, au.args); | |
| 611 | let b_ty = tcx.type_of(bu.def).instantiate(tcx, bu.args); | |
| 609 | let a_ty = cx.type_of(au.def).instantiate(cx, au.args); | |
| 610 | let b_ty = cx.type_of(bu.def).instantiate(cx, bu.args); | |
| 612 | 611 | assert_eq!(a_ty, b_ty); |
| 613 | 612 | } |
| 614 | 613 | |
| ... | ... | @@ -618,11 +617,11 @@ pub fn structurally_relate_consts<I: Interner, R: TypeRelation<I>>( |
| 618 | 617 | au.args, |
| 619 | 618 | bu.args, |
| 620 | 619 | )?; |
| 621 | return Ok(Const::new_unevaluated(tcx, ty::UnevaluatedConst { def: au.def, args })); | |
| 620 | return Ok(Const::new_unevaluated(cx, ty::UnevaluatedConst { def: au.def, args })); | |
| 622 | 621 | } |
| 623 | 622 | (ty::ConstKind::Expr(ae), ty::ConstKind::Expr(be)) => { |
| 624 | 623 | let expr = relation.relate(ae, be)?; |
| 625 | return Ok(Const::new_expr(tcx, expr)); | |
| 624 | return Ok(Const::new_expr(cx, expr)); | |
| 626 | 625 | } |
| 627 | 626 | _ => false, |
| 628 | 627 | }; |
compiler/rustc_type_ir/src/solve/mod.rs+4-4| ... | ... | @@ -106,13 +106,13 @@ pub struct Goal<I: Interner, P> { |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | impl<I: Interner, P> Goal<I, P> { |
| 109 | pub fn new(tcx: I, param_env: I::ParamEnv, predicate: impl Upcast<I, P>) -> Goal<I, P> { | |
| 110 | Goal { param_env, predicate: predicate.upcast(tcx) } | |
| 109 | pub fn new(cx: I, param_env: I::ParamEnv, predicate: impl Upcast<I, P>) -> Goal<I, P> { | |
| 110 | Goal { param_env, predicate: predicate.upcast(cx) } | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /// Updates the goal to one with a different `predicate` but the same `param_env`. |
| 114 | pub fn with<Q>(self, tcx: I, predicate: impl Upcast<I, Q>) -> Goal<I, Q> { | |
| 115 | Goal { param_env: self.param_env, predicate: predicate.upcast(tcx) } | |
| 114 | pub fn with<Q>(self, cx: I, predicate: impl Upcast<I, Q>) -> Goal<I, Q> { | |
| 115 | Goal { param_env: self.param_env, predicate: predicate.upcast(cx) } | |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 | 118 |
compiler/rustc_type_ir/src/ty_kind/closure.rs+17-17| ... | ... | @@ -136,9 +136,9 @@ pub struct ClosureArgsParts<I: Interner> { |
| 136 | 136 | impl<I: Interner> ClosureArgs<I> { |
| 137 | 137 | /// Construct `ClosureArgs` from `ClosureArgsParts`, containing `Args` |
| 138 | 138 | /// for the closure parent, alongside additional closure-specific components. |
| 139 | pub fn new(tcx: I, parts: ClosureArgsParts<I>) -> ClosureArgs<I> { | |
| 139 | pub fn new(cx: I, parts: ClosureArgsParts<I>) -> ClosureArgs<I> { | |
| 140 | 140 | ClosureArgs { |
| 141 | args: tcx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 141 | args: cx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 142 | 142 | parts.closure_kind_ty.into(), |
| 143 | 143 | parts.closure_sig_as_fn_ptr_ty.into(), |
| 144 | 144 | parts.tupled_upvars_ty.into(), |
| ... | ... | @@ -258,9 +258,9 @@ pub struct CoroutineClosureArgsParts<I: Interner> { |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | impl<I: Interner> CoroutineClosureArgs<I> { |
| 261 | pub fn new(tcx: I, parts: CoroutineClosureArgsParts<I>) -> CoroutineClosureArgs<I> { | |
| 261 | pub fn new(cx: I, parts: CoroutineClosureArgsParts<I>) -> CoroutineClosureArgs<I> { | |
| 262 | 262 | CoroutineClosureArgs { |
| 263 | args: tcx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 263 | args: cx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 264 | 264 | parts.closure_kind_ty.into(), |
| 265 | 265 | parts.signature_parts_ty.into(), |
| 266 | 266 | parts.tupled_upvars_ty.into(), |
| ... | ... | @@ -409,14 +409,14 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 409 | 409 | /// When the kind and upvars are known, use the other helper functions. |
| 410 | 410 | pub fn to_coroutine( |
| 411 | 411 | self, |
| 412 | tcx: I, | |
| 412 | cx: I, | |
| 413 | 413 | parent_args: I::GenericArgsSlice, |
| 414 | 414 | coroutine_kind_ty: I::Ty, |
| 415 | 415 | coroutine_def_id: I::DefId, |
| 416 | 416 | tupled_upvars_ty: I::Ty, |
| 417 | 417 | ) -> I::Ty { |
| 418 | 418 | let coroutine_args = ty::CoroutineArgs::new( |
| 419 | tcx, | |
| 419 | cx, | |
| 420 | 420 | ty::CoroutineArgsParts { |
| 421 | 421 | parent_args, |
| 422 | 422 | kind_ty: coroutine_kind_ty, |
| ... | ... | @@ -428,7 +428,7 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 428 | 428 | }, |
| 429 | 429 | ); |
| 430 | 430 | |
| 431 | Ty::new_coroutine(tcx, coroutine_def_id, coroutine_args.args) | |
| 431 | Ty::new_coroutine(cx, coroutine_def_id, coroutine_args.args) | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | /// Given known upvars and a [`ClosureKind`](ty::ClosureKind), compute the coroutine |
| ... | ... | @@ -438,7 +438,7 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 438 | 438 | /// that the `ClosureKind` is actually supported by the coroutine-closure. |
| 439 | 439 | pub fn to_coroutine_given_kind_and_upvars( |
| 440 | 440 | self, |
| 441 | tcx: I, | |
| 441 | cx: I, | |
| 442 | 442 | parent_args: I::GenericArgsSlice, |
| 443 | 443 | coroutine_def_id: I::DefId, |
| 444 | 444 | goal_kind: ty::ClosureKind, |
| ... | ... | @@ -447,7 +447,7 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 447 | 447 | coroutine_captures_by_ref_ty: I::Ty, |
| 448 | 448 | ) -> I::Ty { |
| 449 | 449 | let tupled_upvars_ty = Self::tupled_upvars_by_closure_kind( |
| 450 | tcx, | |
| 450 | cx, | |
| 451 | 451 | goal_kind, |
| 452 | 452 | self.tupled_inputs_ty, |
| 453 | 453 | closure_tupled_upvars_ty, |
| ... | ... | @@ -456,9 +456,9 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 456 | 456 | ); |
| 457 | 457 | |
| 458 | 458 | self.to_coroutine( |
| 459 | tcx, | |
| 459 | cx, | |
| 460 | 460 | parent_args, |
| 461 | Ty::from_coroutine_closure_kind(tcx, goal_kind), | |
| 461 | Ty::from_coroutine_closure_kind(cx, goal_kind), | |
| 462 | 462 | coroutine_def_id, |
| 463 | 463 | tupled_upvars_ty, |
| 464 | 464 | ) |
| ... | ... | @@ -474,7 +474,7 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 474 | 474 | /// lifetimes are related to the lifetime of the borrow on the closure made for |
| 475 | 475 | /// the call. This allows borrowck to enforce the self-borrows correctly. |
| 476 | 476 | pub fn tupled_upvars_by_closure_kind( |
| 477 | tcx: I, | |
| 477 | cx: I, | |
| 478 | 478 | kind: ty::ClosureKind, |
| 479 | 479 | tupled_inputs_ty: I::Ty, |
| 480 | 480 | closure_tupled_upvars_ty: I::Ty, |
| ... | ... | @@ -488,12 +488,12 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 488 | 488 | }; |
| 489 | 489 | let coroutine_captures_by_ref_ty = |
| 490 | 490 | sig.output().skip_binder().fold_with(&mut FoldEscapingRegions { |
| 491 | interner: tcx, | |
| 491 | interner: cx, | |
| 492 | 492 | region: env_region, |
| 493 | 493 | debruijn: ty::INNERMOST, |
| 494 | 494 | }); |
| 495 | 495 | Ty::new_tup_from_iter( |
| 496 | tcx, | |
| 496 | cx, | |
| 497 | 497 | tupled_inputs_ty |
| 498 | 498 | .tuple_fields() |
| 499 | 499 | .iter() |
| ... | ... | @@ -501,7 +501,7 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 501 | 501 | ) |
| 502 | 502 | } |
| 503 | 503 | ty::ClosureKind::FnOnce => Ty::new_tup_from_iter( |
| 504 | tcx, | |
| 504 | cx, | |
| 505 | 505 | tupled_inputs_ty |
| 506 | 506 | .tuple_fields() |
| 507 | 507 | .iter() |
| ... | ... | @@ -615,9 +615,9 @@ pub struct CoroutineArgsParts<I: Interner> { |
| 615 | 615 | impl<I: Interner> CoroutineArgs<I> { |
| 616 | 616 | /// Construct `CoroutineArgs` from `CoroutineArgsParts`, containing `Args` |
| 617 | 617 | /// for the coroutine parent, alongside additional coroutine-specific components. |
| 618 | pub fn new(tcx: I, parts: CoroutineArgsParts<I>) -> CoroutineArgs<I> { | |
| 618 | pub fn new(cx: I, parts: CoroutineArgsParts<I>) -> CoroutineArgs<I> { | |
| 619 | 619 | CoroutineArgs { |
| 620 | args: tcx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 620 | args: cx.mk_args_from_iter(parts.parent_args.iter().chain([ | |
| 621 | 621 | parts.kind_ty.into(), |
| 622 | 622 | parts.resume_ty.into(), |
| 623 | 623 | parts.yield_ty.into(), |
compiler/rustc_type_ir_macros/src/lib.rs+2-2| ... | ... | @@ -71,7 +71,7 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { |
| 71 | 71 | wc.push(parse_quote! { #ty: ::rustc_type_ir::lift::Lift<J, Lifted = #lifted_ty> }); |
| 72 | 72 | let bind = &bindings[index]; |
| 73 | 73 | quote! { |
| 74 | #bind.lift_to_tcx(interner)? | |
| 74 | #bind.lift_to_interner(interner)? | |
| 75 | 75 | } |
| 76 | 76 | }) |
| 77 | 77 | }); |
| ... | ... | @@ -89,7 +89,7 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { |
| 89 | 89 | quote! { |
| 90 | 90 | type Lifted = #lifted_ty; |
| 91 | 91 | |
| 92 | fn lift_to_tcx( | |
| 92 | fn lift_to_interner( | |
| 93 | 93 | self, |
| 94 | 94 | interner: J, |
| 95 | 95 | ) -> Option<Self::Lifted> { |
library/std/src/os/fd/owned.rs+10-3| ... | ... | @@ -24,9 +24,14 @@ use crate::sys_common::{AsInner, FromInner, IntoInner}; |
| 24 | 24 | /// passed as an argument, it is not captured or consumed, and it never has the |
| 25 | 25 | /// value `-1`. |
| 26 | 26 | /// |
| 27 | /// This type's `.to_owned()` implementation returns another `BorrowedFd` | |
| 28 | /// rather than an `OwnedFd`. It just makes a trivial copy of the raw file | |
| 29 | /// descriptor, which is then borrowed under the same lifetime. | |
| 27 | /// This type does not have a [`ToOwned`][crate::borrow::ToOwned] | |
| 28 | /// implementation. Calling `.to_owned()` on a variable of this type will call | |
| 29 | /// it on `&BorrowedFd` and use `Clone::clone()` like `ToOwned` does for all | |
| 30 | /// types implementing `Clone`. The result will be descriptor borrowed under | |
| 31 | /// the same lifetime. | |
| 32 | /// | |
| 33 | /// To obtain an [`OwnedFd`], you can use [`BorrowedFd::try_clone_to_owned`] | |
| 34 | /// instead, but this is not supported on all platforms. | |
| 30 | 35 | #[derive(Copy, Clone)] |
| 31 | 36 | #[repr(transparent)] |
| 32 | 37 | #[rustc_layout_scalar_valid_range_start(0)] |
| ... | ... | @@ -50,6 +55,8 @@ pub struct BorrowedFd<'fd> { |
| 50 | 55 | /// descriptor, so it can be used in FFI in places where a file descriptor is |
| 51 | 56 | /// passed as a consumed argument or returned as an owned value, and it never |
| 52 | 57 | /// has the value `-1`. |
| 58 | /// | |
| 59 | /// You can use [`AsFd::as_fd`] to obtain a [`BorrowedFd`]. | |
| 53 | 60 | #[repr(transparent)] |
| 54 | 61 | #[rustc_layout_scalar_valid_range_start(0)] |
| 55 | 62 | // libstd/os/raw/mod.rs assures me that every libstd-supported platform has a |
src/tools/run-make-support/src/lib.rs+1-1| ... | ... | @@ -61,7 +61,7 @@ pub use env::{env_var, env_var_os}; |
| 61 | 61 | pub use run::{cmd, run, run_fail, run_with_args}; |
| 62 | 62 | |
| 63 | 63 | /// Helpers for checking target information. |
| 64 | pub use targets::{is_darwin, is_msvc, is_windows, target, uname}; | |
| 64 | pub use targets::{is_darwin, is_msvc, is_windows, llvm_components_contain, target, uname}; | |
| 65 | 65 | |
| 66 | 66 | /// Helpers for building names of output artifacts that are potentially target-specific. |
| 67 | 67 | pub use artifact_names::{ |
src/tools/run-make-support/src/targets.rs+7| ... | ... | @@ -28,6 +28,13 @@ pub fn is_darwin() -> bool { |
| 28 | 28 | target().contains("darwin") |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | /// Check if `component` is within `LLVM_COMPONENTS` | |
| 32 | #[must_use] | |
| 33 | pub fn llvm_components_contain(component: &str) -> bool { | |
| 34 | // `LLVM_COMPONENTS` is a space-separated list of words | |
| 35 | env_var("LLVM_COMPONENTS").split_whitespace().find(|s| s == &component).is_some() | |
| 36 | } | |
| 37 | ||
| 31 | 38 | /// Run `uname`. This assumes that `uname` is available on the platform! |
| 32 | 39 | #[track_caller] |
| 33 | 40 | #[must_use] |
src/tools/tidy/src/allowed_run_make_makefiles.txt-1| ... | ... | @@ -1,5 +1,4 @@ |
| 1 | 1 | run-make/archive-duplicate-names/Makefile |
| 2 | run-make/atomic-lock-free/Makefile | |
| 3 | 2 | run-make/branch-protection-check-IBT/Makefile |
| 4 | 3 | run-make/c-dynamic-dylib/Makefile |
| 5 | 4 | run-make/c-dynamic-rlib/Makefile |
tests/run-make/atomic-lock-free/Makefile deleted-48| ... | ... | @@ -1,48 +0,0 @@ |
| 1 | include ../tools.mk | |
| 2 | ||
| 3 | # This tests ensure that atomic types are never lowered into runtime library calls that are not | |
| 4 | # guaranteed to be lock-free. | |
| 5 | ||
| 6 | all: | |
| 7 | ifeq ($(UNAME),Linux) | |
| 8 | ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86) | |
| 9 | 	$(RUSTC) --target=i686-unknown-linux-gnu atomic_lock_free.rs | |
| 10 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 11 | 	$(RUSTC) --target=x86_64-unknown-linux-gnu atomic_lock_free.rs | |
| 12 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 13 | endif | |
| 14 | ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm) | |
| 15 | 	$(RUSTC) --target=arm-unknown-linux-gnueabi atomic_lock_free.rs | |
| 16 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 17 | 	$(RUSTC) --target=arm-unknown-linux-gnueabihf atomic_lock_free.rs | |
| 18 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 19 | 	$(RUSTC) --target=armv7-unknown-linux-gnueabihf atomic_lock_free.rs | |
| 20 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 21 | 	$(RUSTC) --target=thumbv7neon-unknown-linux-gnueabihf atomic_lock_free.rs | |
| 22 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 23 | endif | |
| 24 | ifeq ($(filter aarch64,$(LLVM_COMPONENTS)),aarch64) | |
| 25 | 	$(RUSTC) --target=aarch64-unknown-linux-gnu atomic_lock_free.rs | |
| 26 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 27 | endif | |
| 28 | ifeq ($(filter mips,$(LLVM_COMPONENTS)),mips) | |
| 29 | 	$(RUSTC) --target=mips-unknown-linux-gnu atomic_lock_free.rs | |
| 30 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 31 | 	$(RUSTC) --target=mipsel-unknown-linux-gnu atomic_lock_free.rs | |
| 32 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 33 | endif | |
| 34 | ifeq ($(filter powerpc,$(LLVM_COMPONENTS)),powerpc) | |
| 35 | 	$(RUSTC) --target=powerpc-unknown-linux-gnu atomic_lock_free.rs | |
| 36 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 37 | 	$(RUSTC) --target=powerpc-unknown-linux-gnuspe atomic_lock_free.rs | |
| 38 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 39 | 	$(RUSTC) --target=powerpc64-unknown-linux-gnu atomic_lock_free.rs | |
| 40 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 41 | 	$(RUSTC) --target=powerpc64le-unknown-linux-gnu atomic_lock_free.rs | |
| 42 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 43 | endif | |
| 44 | ifeq ($(filter systemz,$(LLVM_COMPONENTS)),systemz) | |
| 45 | 	$(RUSTC) --target=s390x-unknown-linux-gnu atomic_lock_free.rs | |
| 46 | 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add | |
| 47 | endif | |
| 48 | endif |
tests/run-make/atomic-lock-free/rmake.rs created+52| ... | ... | @@ -0,0 +1,52 @@ |
| 1 | // This tests ensure that atomic types are never lowered into runtime library calls that are not | |
| 2 | // guaranteed to be lock-free. | |
| 3 | ||
| 4 | //@ only-linux | |
| 5 | ||
| 6 | use run_make_support::{llvm_components_contain, llvm_readobj, rustc}; | |
| 7 | ||
| 8 | fn compile(target: &str) { | |
| 9 | rustc().input("atomic_lock_free.rs").target(target).run(); | |
| 10 | } | |
| 11 | ||
| 12 | fn check() { | |
| 13 | llvm_readobj() | |
| 14 | .symbols() | |
| 15 | .input("libatomic_lock_free.rlib") | |
| 16 | .run() | |
| 17 | .assert_stdout_not_contains("__atomic_fetch_add"); | |
| 18 | } | |
| 19 | ||
| 20 | fn compile_and_check(target: &str) { | |
| 21 | compile(target); | |
| 22 | check(); | |
| 23 | } | |
| 24 | ||
| 25 | fn main() { | |
| 26 | if llvm_components_contain("x86") { | |
| 27 | compile_and_check("i686-unknown-linux-gnu"); | |
| 28 | compile_and_check("x86_64-unknown-linux-gnu"); | |
| 29 | } | |
| 30 | if llvm_components_contain("arm") { | |
| 31 | compile_and_check("arm-unknown-linux-gnueabi"); | |
| 32 | compile_and_check("arm-unknown-linux-gnueabihf"); | |
| 33 | compile_and_check("armv7-unknown-linux-gnueabihf"); | |
| 34 | compile_and_check("thumbv7neon-unknown-linux-gnueabihf"); | |
| 35 | } | |
| 36 | if llvm_components_contain("aarch64") { | |
| 37 | compile_and_check("aarch64-unknown-linux-gnu"); | |
| 38 | } | |
| 39 | if llvm_components_contain("mips") { | |
| 40 | compile_and_check("mips-unknown-linux-gnu"); | |
| 41 | compile_and_check("mipsel-unknown-linux-gnu"); | |
| 42 | } | |
| 43 | if llvm_components_contain("powerpc") { | |
| 44 | compile_and_check("powerpc-unknown-linux-gnu"); | |
| 45 | compile_and_check("powerpc-unknown-linux-gnuspe"); | |
| 46 | compile_and_check("powerpc64-unknown-linux-gnu"); | |
| 47 | compile_and_check("powerpc64le-unknown-linux-gnu"); | |
| 48 | } | |
| 49 | if llvm_components_contain("systemz") { | |
| 50 | compile_and_check("s390x-unknown-linux-gnu"); | |
| 51 | } | |
| 52 | } |
tests/rustdoc-ui/ice-unresolved-import-100241.stderr created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | error[E0432]: unresolved import `inner` | |
| 2 | --> $DIR/ice-unresolved-import-100241.rs:9:13 | |
| 3 | | | |
| 4 | LL | pub use inner::S; | |
| 5 | | ^^^^^ maybe a missing crate `inner`? | |
| 6 | | | |
| 7 | = help: consider adding `extern crate inner` to use the `inner` crate | |
| 8 | ||
| 9 | error: aborting due to 1 previous error | |
| 10 | ||
| 11 | For more information about this error, try `rustc --explain E0432`. |
tests/rustdoc-ui/invalid_associated_const.stderr+6-4| ... | ... | @@ -6,8 +6,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | type A: S<C<X = 0i32> = 34>; | |
| 10 | | ~~~~~~~~~~ | |
| 9 | LL - type A: S<C<X = 0i32> = 34>; | |
| 10 | LL + type A: S<C = 34>; | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/invalid_associated_const.rs:4:17 |
| ... | ... | @@ -18,8 +19,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | type A: S<C<X = 0i32> = 34>; | |
| 22 | | ~~~~~~~~~~ | |
| 22 | LL - type A: S<C<X = 0i32> = 34>; | |
| 23 | LL + type A: S<C = 34>; | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error: aborting due to 2 previous errors |
| 25 | 27 |
tests/rustdoc-ui/issue-102467.stderr+6-4| ... | ... | @@ -6,8 +6,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | type A: S<C<X = 0i32> = 34>; | |
| 10 | | ~~~~~~~~~~ | |
| 9 | LL - type A: S<C<X = 0i32> = 34>; | |
| 10 | LL + type A: S<C = 34>; | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/issue-102467.rs:7:17 |
| ... | ... | @@ -18,8 +19,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | type A: S<C<X = 0i32> = 34>; | |
| 22 | | ~~~~~~~~~~ | |
| 22 | LL - type A: S<C<X = 0i32> = 34>; | |
| 23 | LL + type A: S<C = 34>; | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error: aborting due to 2 previous errors |
| 25 | 27 |
tests/ui/anon-params/anon-params-denied-2018.stderr+4-4| ... | ... | @@ -48,7 +48,7 @@ LL | fn foo_with_qualified_path(<Bar as T>::Baz); |
| 48 | 48 | help: explicitly ignore the parameter name |
| 49 | 49 | | |
| 50 | 50 | LL | fn foo_with_qualified_path(_: <Bar as T>::Baz); |
| 51 | | ~~~~~~~~~~~~~~~~~~ | |
| 51 | | ++ | |
| 52 | 52 | |
| 53 | 53 | error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` |
| 54 | 54 | --> $DIR/anon-params-denied-2018.rs:15:56 |
| ... | ... | @@ -60,7 +60,7 @@ LL | fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz); |
| 60 | 60 | help: explicitly ignore the parameter name |
| 61 | 61 | | |
| 62 | 62 | LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz); |
| 63 | | ~~~~~~~~~~~~~~~~~~~ | |
| 63 | | ++ | |
| 64 | 64 | |
| 65 | 65 | error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,` |
| 66 | 66 | --> $DIR/anon-params-denied-2018.rs:18:57 |
| ... | ... | @@ -72,7 +72,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz); |
| 72 | 72 | help: explicitly ignore the parameter name |
| 73 | 73 | | |
| 74 | 74 | LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz); |
| 75 | | ~~~~~~~~~~~~~~~~~~ | |
| 75 | | ++ | |
| 76 | 76 | |
| 77 | 77 | error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)` |
| 78 | 78 | --> $DIR/anon-params-denied-2018.rs:18:74 |
| ... | ... | @@ -84,7 +84,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz); |
| 84 | 84 | help: explicitly ignore the parameter name |
| 85 | 85 | | |
| 86 | 86 | LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz); |
| 87 | | ~~~~~~~~~~~~~~~~~~ | |
| 87 | | ++ | |
| 88 | 88 | |
| 89 | 89 | error: expected one of `:`, `@`, or `|`, found `,` |
| 90 | 90 | --> $DIR/anon-params-denied-2018.rs:22:36 |
tests/ui/associated-consts/issue-102335-const.stderr+6-4| ... | ... | @@ -6,8 +6,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | type A: S<C<X = 0i32> = 34>; | |
| 10 | | ~~~~~~~~~~ | |
| 9 | LL - type A: S<C<X = 0i32> = 34>; | |
| 10 | LL + type A: S<C = 34>; | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/issue-102335-const.rs:4:17 |
| ... | ... | @@ -18,8 +19,9 @@ LL | type A: S<C<X = 0i32> = 34>; |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | type A: S<C<X = 0i32> = 34>; | |
| 22 | | ~~~~~~~~~~ | |
| 22 | LL - type A: S<C<X = 0i32> = 34>; | |
| 23 | LL + type A: S<C = 34>; | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error: aborting due to 2 previous errors |
| 25 | 27 |
tests/ui/associated-type-bounds/issue-102335-ty.stderr+12-8| ... | ... | @@ -6,8 +6,9 @@ LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | |
| 10 | | ~~~~~~~~~~~ | |
| 9 | LL - type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | |
| 10 | LL + type A: S<C = ()>; // Just one erroneous equality constraint | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/issue-102335-ty.rs:2:17 |
| ... | ... | @@ -18,8 +19,9 @@ LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | |
| 22 | | ~~~~~~~~~~~ | |
| 22 | LL - type A: S<C<i32 = u32> = ()>; // Just one erroneous equality constraint | |
| 23 | LL + type A: S<C = ()>; // Just one erroneous equality constraint | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error[E0229]: associated item constraints are not allowed here |
| 25 | 27 | --> $DIR/issue-102335-ty.rs:8:17 |
| ... | ... | @@ -29,8 +31,9 @@ LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equal |
| 29 | 31 | | |
| 30 | 32 | help: consider removing this associated item binding |
| 31 | 33 | | |
| 32 | LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | |
| 33 | | ~~~~~~~~~~ | |
| 34 | LL - type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | |
| 35 | LL + type A: S<C<X = i32> = ()>; // More than one erroneous equality constraints | |
| 36 | | | |
| 34 | 37 | |
| 35 | 38 | error[E0229]: associated item constraints are not allowed here |
| 36 | 39 | --> $DIR/issue-102335-ty.rs:8:17 |
| ... | ... | @@ -41,8 +44,9 @@ LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equal |
| 41 | 44 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 42 | 45 | help: consider removing this associated item binding |
| 43 | 46 | | |
| 44 | LL | type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | |
| 45 | | ~~~~~~~~~~ | |
| 47 | LL - type A: S<C<i32 = u32, X = i32> = ()>; // More than one erroneous equality constraints | |
| 48 | LL + type A: S<C<X = i32> = ()>; // More than one erroneous equality constraints | |
| 49 | | | |
| 46 | 50 | |
| 47 | 51 | error: aborting due to 4 previous errors |
| 48 | 52 |
tests/ui/associated-type-bounds/no-gat-position.stderr+3-2| ... | ... | @@ -6,8 +6,9 @@ LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item constraint |
| 8 | 8 | | |
| 9 | LL | fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; | |
| 10 | | ~~~~~~~~~~~ | |
| 9 | LL - fn next<'a>(&'a mut self) -> Option<Self::Item<'a, As1: Copy>>; | |
| 10 | LL + fn next<'a>(&'a mut self) -> Option<Self::Item<'a>>; | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error: aborting due to 1 previous error |
| 13 | 14 |
tests/ui/associated-type-bounds/return-type-notation/basic.without.stderr+2-2| ... | ... | @@ -13,12 +13,12 @@ error: future cannot be sent between threads safely |
| 13 | 13 | LL | is_send(foo::<T>()); |
| 14 | 14 | | ^^^^^^^^^^ future returned by `foo` is not `Send` |
| 15 | 15 | | |
| 16 | = help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is required by `impl Future<Output = Result<(), ()>>: Send` | |
| 16 | = help: within `impl Future<Output = Result<(), ()>>`, the trait `Send` is not implemented for `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is required by `impl Future<Output = Result<(), ()>>: Send` | |
| 17 | 17 | note: future is not `Send` as it awaits another future which is not `Send` |
| 18 | 18 | --> $DIR/basic.rs:13:5 |
| 19 | 19 | | |
| 20 | 20 | LL | T::method().await?; |
| 21 | | ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method() }`, which is not `Send` | |
| 21 | | ^^^^^^^^^^^ await occurs here on type `impl Future<Output = Result<(), ()>> { <T as Foo>::method(..) }`, which is not `Send` | |
| 22 | 22 | note: required by a bound in `is_send` |
| 23 | 23 | --> $DIR/basic.rs:17:20 |
| 24 | 24 | | |
tests/ui/associated-type-bounds/return-type-notation/display.rs created+25| ... | ... | @@ -0,0 +1,25 @@ |
| 1 | #![feature(return_type_notation)] | |
| 2 | //~^ WARN the feature `return_type_notation` is incomplete | |
| 3 | ||
| 4 | trait Trait {} | |
| 5 | fn needs_trait(_: impl Trait) {} | |
| 6 | ||
| 7 | trait Assoc { | |
| 8 | fn method() -> impl Sized; | |
| 9 | fn method_with_lt() -> impl Sized; | |
| 10 | fn method_with_ty<T>() -> impl Sized; | |
| 11 | fn method_with_ct<const N: usize>() -> impl Sized; | |
| 12 | } | |
| 13 | ||
| 14 | fn foo<T: Assoc>(t: T) { | |
| 15 | needs_trait(T::method()); | |
| 16 | //~^ ERROR the trait bound | |
| 17 | needs_trait(T::method_with_lt()); | |
| 18 | //~^ ERROR the trait bound | |
| 19 | needs_trait(T::method_with_ty()); | |
| 20 | //~^ ERROR the trait bound | |
| 21 | needs_trait(T::method_with_ct()); | |
| 22 | //~^ ERROR the trait bound | |
| 23 | } | |
| 24 | ||
| 25 | fn main() {} |
tests/ui/associated-type-bounds/return-type-notation/display.stderr created+78| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | warning: the feature `return_type_notation` is incomplete and may not be safe to use and/or cause compiler crashes | |
| 2 | --> $DIR/display.rs:1:12 | |
| 3 | | | |
| 4 | LL | #![feature(return_type_notation)] | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = note: see issue #109417 <https://github.com/rust-lang/rust/issues/109417> for more information | |
| 8 | = note: `#[warn(incomplete_features)]` on by default | |
| 9 | ||
| 10 | error[E0277]: the trait bound `impl Sized { <T as Assoc>::method(..) }: Trait` is not satisfied | |
| 11 | --> $DIR/display.rs:15:17 | |
| 12 | | | |
| 13 | LL | needs_trait(T::method()); | |
| 14 | | ----------- ^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { <T as Assoc>::method(..) }` | |
| 15 | | | | |
| 16 | | required by a bound introduced by this call | |
| 17 | | | |
| 18 | note: required by a bound in `needs_trait` | |
| 19 | --> $DIR/display.rs:5:24 | |
| 20 | | | |
| 21 | LL | fn needs_trait(_: impl Trait) {} | |
| 22 | | ^^^^^ required by this bound in `needs_trait` | |
| 23 | ||
| 24 | error[E0277]: the trait bound `impl Sized { <T as Assoc>::method_with_lt(..) }: Trait` is not satisfied | |
| 25 | --> $DIR/display.rs:17:17 | |
| 26 | | | |
| 27 | LL | needs_trait(T::method_with_lt()); | |
| 28 | | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized { <T as Assoc>::method_with_lt(..) }` | |
| 29 | | | | |
| 30 | | required by a bound introduced by this call | |
| 31 | | | |
| 32 | note: required by a bound in `needs_trait` | |
| 33 | --> $DIR/display.rs:5:24 | |
| 34 | | | |
| 35 | LL | fn needs_trait(_: impl Trait) {} | |
| 36 | | ^^^^^ required by this bound in `needs_trait` | |
| 37 | ||
| 38 | error[E0277]: the trait bound `impl Sized: Trait` is not satisfied | |
| 39 | --> $DIR/display.rs:19:17 | |
| 40 | | | |
| 41 | LL | needs_trait(T::method_with_ty()); | |
| 42 | | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` | |
| 43 | | | | |
| 44 | | required by a bound introduced by this call | |
| 45 | | | |
| 46 | help: this trait has no implementations, consider adding one | |
| 47 | --> $DIR/display.rs:4:1 | |
| 48 | | | |
| 49 | LL | trait Trait {} | |
| 50 | | ^^^^^^^^^^^ | |
| 51 | note: required by a bound in `needs_trait` | |
| 52 | --> $DIR/display.rs:5:24 | |
| 53 | | | |
| 54 | LL | fn needs_trait(_: impl Trait) {} | |
| 55 | | ^^^^^ required by this bound in `needs_trait` | |
| 56 | ||
| 57 | error[E0277]: the trait bound `impl Sized: Trait` is not satisfied | |
| 58 | --> $DIR/display.rs:21:17 | |
| 59 | | | |
| 60 | LL | needs_trait(T::method_with_ct()); | |
| 61 | | ----------- ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `impl Sized` | |
| 62 | | | | |
| 63 | | required by a bound introduced by this call | |
| 64 | | | |
| 65 | help: this trait has no implementations, consider adding one | |
| 66 | --> $DIR/display.rs:4:1 | |
| 67 | | | |
| 68 | LL | trait Trait {} | |
| 69 | | ^^^^^^^^^^^ | |
| 70 | note: required by a bound in `needs_trait` | |
| 71 | --> $DIR/display.rs:5:24 | |
| 72 | | | |
| 73 | LL | fn needs_trait(_: impl Trait) {} | |
| 74 | | ^^^^^ required by this bound in `needs_trait` | |
| 75 | ||
| 76 | error: aborting due to 4 previous errors; 1 warning emitted | |
| 77 | ||
| 78 | For more information about this error, try `rustc --explain E0277`. |
tests/ui/associated-types/associated-types-eq-2.stderr+24-16| ... | ... | @@ -50,8 +50,9 @@ LL | impl Tr1<A = usize> for usize { |
| 50 | 50 | | |
| 51 | 51 | help: consider removing this associated item binding |
| 52 | 52 | | |
| 53 | LL | impl Tr1<A = usize> for usize { | |
| 54 | | ~~~~~~~~~~~ | |
| 53 | LL - impl Tr1<A = usize> for usize { | |
| 54 | LL + impl Tr1 for usize { | |
| 55 | | | |
| 55 | 56 | |
| 56 | 57 | error[E0046]: not all trait items implemented, missing: `A` |
| 57 | 58 | --> $DIR/associated-types-eq-2.rs:20:1 |
| ... | ... | @@ -70,8 +71,9 @@ LL | fn baz<I: Tr1>(_x: &<I as Tr1<A=Bar>>::A) {} |
| 70 | 71 | | |
| 71 | 72 | help: consider removing this associated item binding |
| 72 | 73 | | |
| 73 | LL | fn baz<I: Tr1>(_x: &<I as Tr1<A=Bar>>::A) {} | |
| 74 | | ~~~~~~~ | |
| 74 | LL - fn baz<I: Tr1>(_x: &<I as Tr1<A=Bar>>::A) {} | |
| 75 | LL + fn baz<I: Tr1>(_x: &<I as Tr1>::A) {} | |
| 76 | | | |
| 75 | 77 | |
| 76 | 78 | error[E0107]: trait takes 3 generic arguments but 1 generic argument was supplied |
| 77 | 79 | --> $DIR/associated-types-eq-2.rs:40:6 |
| ... | ... | @@ -128,8 +130,9 @@ LL | impl Tr2<i32, t2 = Qux, T3 = usize> for Qux { |
| 128 | 130 | | |
| 129 | 131 | help: consider removing this associated item binding |
| 130 | 132 | | |
| 131 | LL | impl Tr2<i32, t2 = Qux, T3 = usize> for Qux { | |
| 132 | | ~~~~~~~~~~ | |
| 133 | LL - impl Tr2<i32, t2 = Qux, T3 = usize> for Qux { | |
| 134 | LL + impl Tr2<i32, T3 = usize> for Qux { | |
| 135 | | | |
| 133 | 136 | |
| 134 | 137 | error[E0107]: trait takes 3 generic arguments but 1 generic argument was supplied |
| 135 | 138 | --> $DIR/associated-types-eq-2.rs:54:6 |
| ... | ... | @@ -157,8 +160,9 @@ LL | impl Tr2<i32, X = Qux, Y = usize> for Bar { |
| 157 | 160 | | |
| 158 | 161 | help: consider removing this associated item binding |
| 159 | 162 | | |
| 160 | LL | impl Tr2<i32, X = Qux, Y = usize> for Bar { | |
| 161 | | ~~~~~~~~~ | |
| 163 | LL - impl Tr2<i32, X = Qux, Y = usize> for Bar { | |
| 164 | LL + impl Tr2<i32, Y = usize> for Bar { | |
| 165 | | | |
| 162 | 166 | |
| 163 | 167 | error[E0107]: trait takes 3 generic arguments but 2 generic arguments were supplied |
| 164 | 168 | --> $DIR/associated-types-eq-2.rs:61:6 |
| ... | ... | @@ -228,8 +232,9 @@ LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux { |
| 228 | 232 | | |
| 229 | 233 | help: consider removing this associated item binding |
| 230 | 234 | | |
| 231 | LL | impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux { | |
| 232 | | ~~~~~~~ | |
| 235 | LL - impl Tr3<n = 42, T2 = Qux, T3 = usize> for Qux { | |
| 236 | LL + impl Tr3<T2 = Qux, T3 = usize> for Qux { | |
| 237 | | | |
| 233 | 238 | |
| 234 | 239 | error[E0229]: associated item constraints are not allowed here |
| 235 | 240 | --> $DIR/associated-types-eq-2.rs:92:10 |
| ... | ... | @@ -239,8 +244,9 @@ LL | impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar { |
| 239 | 244 | | |
| 240 | 245 | help: consider removing this associated item binding |
| 241 | 246 | | |
| 242 | LL | impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar { | |
| 243 | | ~~~~~~~~ | |
| 247 | LL - impl Tr3<N = u32, T2 = Qux, T3 = usize> for Bar { | |
| 248 | LL + impl Tr3<T2 = Qux, T3 = usize> for Bar { | |
| 249 | | | |
| 244 | 250 | |
| 245 | 251 | error[E0107]: trait takes 3 generic arguments but 1 generic argument was supplied |
| 246 | 252 | --> $DIR/associated-types-eq-2.rs:98:6 |
| ... | ... | @@ -268,8 +274,9 @@ LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar { |
| 268 | 274 | | |
| 269 | 275 | help: consider removing this associated item binding |
| 270 | 276 | | |
| 271 | LL | impl Tr3<42, T2 = 42, T3 = usize> for Bar { | |
| 272 | | ~~~~~~~~~ | |
| 277 | LL - impl Tr3<42, T2 = 42, T3 = usize> for Bar { | |
| 278 | LL + impl Tr3<42, T3 = usize> for Bar { | |
| 279 | | | |
| 273 | 280 | |
| 274 | 281 | error[E0107]: trait takes 3 generic arguments but 0 generic arguments were supplied |
| 275 | 282 | --> $DIR/associated-types-eq-2.rs:106:6 |
| ... | ... | @@ -295,8 +302,9 @@ LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar { |
| 295 | 302 | | |
| 296 | 303 | help: consider removing this associated item binding |
| 297 | 304 | | |
| 298 | LL | impl Tr3<X = 42, Y = Qux, Z = usize> for Bar { | |
| 299 | | ~~~~~~~ | |
| 305 | LL - impl Tr3<X = 42, Y = Qux, Z = usize> for Bar { | |
| 306 | LL + impl Tr3<Y = Qux, Z = usize> for Bar { | |
| 307 | | | |
| 300 | 308 | |
| 301 | 309 | error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied |
| 302 | 310 | --> $DIR/associated-types-eq-2.rs:117:13 |
tests/ui/async-await/return-type-notation/issue-110963-early.stderr+4-4| ... | ... | @@ -18,8 +18,8 @@ LL | | } |
| 18 | 18 | LL | | }); |
| 19 | 19 | | |______^ implementation of `Send` is not general enough |
| 20 | 20 | | |
| 21 | = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>() }`, for any two lifetimes `'0` and `'1`... | |
| 22 | = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2` | |
| 21 | = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`... | |
| 22 | = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2` | |
| 23 | 23 | |
| 24 | 24 | error: implementation of `Send` is not general enough |
| 25 | 25 | --> $DIR/issue-110963-early.rs:14:5 |
| ... | ... | @@ -32,8 +32,8 @@ LL | | } |
| 32 | 32 | LL | | }); |
| 33 | 33 | | |______^ implementation of `Send` is not general enough |
| 34 | 34 | | |
| 35 | = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>() }`, for any two lifetimes `'0` and `'1`... | |
| 36 | = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>() }`, for some specific lifetime `'2` | |
| 35 | = note: `Send` would have to be implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'0>(..) }`, for any two lifetimes `'0` and `'1`... | |
| 36 | = note: ...but `Send` is actually implemented for the type `impl Future<Output = bool> { <HC as HealthCheck>::check<'2>(..) }`, for some specific lifetime `'2` | |
| 37 | 37 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 38 | 38 | |
| 39 | 39 | error: aborting due to 2 previous errors; 1 warning emitted |
tests/ui/async-await/return-type-notation/rtn-in-impl-signature.stderr+3-2| ... | ... | @@ -15,8 +15,9 @@ LL | impl Super1<'_, bar(..): Send> for () {} |
| 15 | 15 | | |
| 16 | 16 | help: consider removing this associated item constraint |
| 17 | 17 | | |
| 18 | LL | impl Super1<'_, bar(..): Send> for () {} | |
| 19 | | ~~~~~~~~~~~~~~~ | |
| 18 | LL - impl Super1<'_, bar(..): Send> for () {} | |
| 19 | LL + impl Super1<'_> for () {} | |
| 20 | | | |
| 20 | 21 | |
| 21 | 22 | error[E0046]: not all trait items implemented, missing: `bar` |
| 22 | 23 | --> $DIR/rtn-in-impl-signature.rs:10:1 |
tests/ui/blind/blind-item-block-item-shadow.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use foo::Bar; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use foo::Bar as OtherBar; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | +++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/blind/blind-item-item-shadow.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | use foo::foo; |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use foo::foo as other_foo; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/duplicate/duplicate-check-macro-exports.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | macro_rules! panic { () => {} } |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | pub use std::panic as other_panic; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/error-codes/E0229.stderr+9-6| ... | ... | @@ -6,8 +6,9 @@ LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 10 | | ~~~~~~~~~ | |
| 9 | LL - fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 10 | LL + fn baz<I>(x: &<I as Foo>::A) {} | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/E0229.rs:13:25 |
| ... | ... | @@ -18,8 +19,9 @@ LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 22 | | ~~~~~~~~~ | |
| 22 | LL - fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 23 | LL + fn baz<I>(x: &<I as Foo>::A) {} | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error[E0229]: associated item constraints are not allowed here |
| 25 | 27 | --> $DIR/E0229.rs:13:25 |
| ... | ... | @@ -30,8 +32,9 @@ LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} |
| 30 | 32 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 31 | 33 | help: consider removing this associated item binding |
| 32 | 34 | | |
| 33 | LL | fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 34 | | ~~~~~~~~~ | |
| 35 | LL - fn baz<I>(x: &<I as Foo<A = Bar>>::A) {} | |
| 36 | LL + fn baz<I>(x: &<I as Foo>::A) {} | |
| 37 | | | |
| 35 | 38 | |
| 36 | 39 | error[E0277]: the trait bound `I: Foo` is not satisfied |
| 37 | 40 | --> $DIR/E0229.rs:13:15 |
tests/ui/error-codes/E0252.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use bar::baz; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use bar::baz as other_baz; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ++++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/error-codes/E0254.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | use foo::alloc; |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use foo::alloc as other_alloc; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/error-codes/E0255.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | fn foo() {} |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use bar::foo as other_foo; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/generic-associated-types/issue-102335-gat.stderr+6-4| ... | ... | @@ -6,8 +6,9 @@ LL | type A: S<C<(), i32 = ()> = ()>; |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | type A: S<C<(), i32 = ()> = ()>; | |
| 10 | | ~~~~~~~~~~ | |
| 9 | LL - type A: S<C<(), i32 = ()> = ()>; | |
| 10 | LL + type A: S<C<()> = ()>; | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error[E0229]: associated item constraints are not allowed here |
| 13 | 14 | --> $DIR/issue-102335-gat.rs:2:21 |
| ... | ... | @@ -18,8 +19,9 @@ LL | type A: S<C<(), i32 = ()> = ()>; |
| 18 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 20 | help: consider removing this associated item binding |
| 20 | 21 | | |
| 21 | LL | type A: S<C<(), i32 = ()> = ()>; | |
| 22 | | ~~~~~~~~~~ | |
| 22 | LL - type A: S<C<(), i32 = ()> = ()>; | |
| 23 | LL + type A: S<C<()> = ()>; | |
| 24 | | | |
| 23 | 25 | |
| 24 | 26 | error: aborting due to 2 previous errors |
| 25 | 27 |
tests/ui/generics/impl-block-params-declared-in-wrong-spot-issue-113073.stderr+18-12| ... | ... | @@ -14,8 +14,9 @@ LL | impl Foo<T: Default> for String {} |
| 14 | 14 | | |
| 15 | 15 | help: declare the type parameter right after the `impl` keyword |
| 16 | 16 | | |
| 17 | LL | impl<T: Default> Foo<T> for String {} | |
| 18 | | ++++++++++++ ~ | |
| 17 | LL - impl Foo<T: Default> for String {} | |
| 18 | LL + impl<T: Default> Foo<T> for String {} | |
| 19 | | | |
| 19 | 20 | |
| 20 | 21 | error[E0229]: associated item constraints are not allowed here |
| 21 | 22 | --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:7:10 |
| ... | ... | @@ -25,8 +26,9 @@ LL | impl Foo<T: 'a + Default> for u8 {} |
| 25 | 26 | | |
| 26 | 27 | help: declare the type parameter right after the `impl` keyword |
| 27 | 28 | | |
| 28 | LL | impl<'a, T: 'a + Default> Foo<T> for u8 {} | |
| 29 | | +++++++++++++++++++++ ~ | |
| 29 | LL - impl Foo<T: 'a + Default> for u8 {} | |
| 30 | LL + impl<'a, T: 'a + Default> Foo<T> for u8 {} | |
| 31 | | | |
| 30 | 32 | |
| 31 | 33 | error[E0229]: associated item constraints are not allowed here |
| 32 | 34 | --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:13:13 |
| ... | ... | @@ -36,8 +38,9 @@ LL | impl<T> Foo<T: Default> for u16 {} |
| 36 | 38 | | |
| 37 | 39 | help: declare the type parameter right after the `impl` keyword |
| 38 | 40 | | |
| 39 | LL | impl<T, T: Default> Foo<T> for u16 {} | |
| 40 | | ++++++++++++ ~ | |
| 41 | LL - impl<T> Foo<T: Default> for u16 {} | |
| 42 | LL + impl<T, T: Default> Foo<T> for u16 {} | |
| 43 | | | |
| 41 | 44 | |
| 42 | 45 | error[E0229]: associated item constraints are not allowed here |
| 43 | 46 | --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:17:14 |
| ... | ... | @@ -47,8 +50,9 @@ LL | impl<'a> Foo<T: 'a + Default> for u32 {} |
| 47 | 50 | | |
| 48 | 51 | help: declare the type parameter right after the `impl` keyword |
| 49 | 52 | | |
| 50 | LL | impl<'a, 'a, T: 'a + Default> Foo<T> for u32 {} | |
| 51 | | +++++++++++++++++++++ ~ | |
| 53 | LL - impl<'a> Foo<T: 'a + Default> for u32 {} | |
| 54 | LL + impl<'a, 'a, T: 'a + Default> Foo<T> for u32 {} | |
| 55 | | | |
| 52 | 56 | |
| 53 | 57 | error[E0229]: associated item constraints are not allowed here |
| 54 | 58 | --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:23:10 |
| ... | ... | @@ -58,8 +62,9 @@ LL | impl Bar<T: Default, K: Default> for String {} |
| 58 | 62 | | |
| 59 | 63 | help: declare the type parameter right after the `impl` keyword |
| 60 | 64 | | |
| 61 | LL | impl<T: Default> Bar<T, K: Default> for String {} | |
| 62 | | ++++++++++++ ~ | |
| 65 | LL - impl Bar<T: Default, K: Default> for String {} | |
| 66 | LL + impl<T: Default> Bar<T, K: Default> for String {} | |
| 67 | | | |
| 63 | 68 | |
| 64 | 69 | error[E0107]: trait takes 2 generic arguments but 1 generic argument was supplied |
| 65 | 70 | --> $DIR/impl-block-params-declared-in-wrong-spot-issue-113073.rs:27:9 |
| ... | ... | @@ -87,8 +92,9 @@ LL | impl<T> Bar<T, K: Default> for u8 {} |
| 87 | 92 | | |
| 88 | 93 | help: declare the type parameter right after the `impl` keyword |
| 89 | 94 | | |
| 90 | LL | impl<T, K: Default> Bar<T, K> for u8 {} | |
| 91 | | ++++++++++++ ~ | |
| 95 | LL - impl<T> Bar<T, K: Default> for u8 {} | |
| 96 | LL + impl<T, K: Default> Bar<T, K> for u8 {} | |
| 97 | | | |
| 92 | 98 | |
| 93 | 99 | error: aborting due to 8 previous errors |
| 94 | 100 |
tests/ui/imports/double-import.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use sub2::foo; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use sub2::foo as other_foo; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ++++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-19498.stderr+3-3| ... | ... | @@ -11,7 +11,7 @@ LL | mod A {} |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use self::A as OtherA; |
| 14 | | ~~~~~~~~~~~~~~~~~ | |
| 14 | | +++++++++ | |
| 15 | 15 | |
| 16 | 16 | error[E0255]: the name `B` is defined multiple times |
| 17 | 17 | --> $DIR/issue-19498.rs:5:1 |
| ... | ... | @@ -26,7 +26,7 @@ LL | pub mod B {} |
| 26 | 26 | help: you can use `as` to change the binding name of the import |
| 27 | 27 | | |
| 28 | 28 | LL | use self::B as OtherB; |
| 29 | | ~~~~~~~~~~~~~~~~~ | |
| 29 | | +++++++++ | |
| 30 | 30 | |
| 31 | 31 | error[E0255]: the name `D` is defined multiple times |
| 32 | 32 | --> $DIR/issue-19498.rs:9:5 |
| ... | ... | @@ -40,7 +40,7 @@ LL | mod D {} |
| 40 | 40 | help: you can use `as` to change the binding name of the import |
| 41 | 41 | | |
| 42 | 42 | LL | use C::D as OtherD; |
| 43 | | ~~~~~~~~~~~~~~ | |
| 43 | | +++++++++ | |
| 44 | 44 | |
| 45 | 45 | error: aborting due to 3 previous errors |
| 46 | 46 |
tests/ui/imports/issue-24081.stderr+5-5| ... | ... | @@ -11,7 +11,7 @@ LL | type Add = bool; |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use std::ops::Add as OtherAdd; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | +++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error[E0255]: the name `Sub` is defined multiple times |
| 17 | 17 | --> $DIR/issue-24081.rs:9:1 |
| ... | ... | @@ -26,7 +26,7 @@ LL | struct Sub { x: f32 } |
| 26 | 26 | help: you can use `as` to change the binding name of the import |
| 27 | 27 | | |
| 28 | 28 | LL | use std::ops::Sub as OtherSub; |
| 29 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 29 | | +++++++++++ | |
| 30 | 30 | |
| 31 | 31 | error[E0255]: the name `Mul` is defined multiple times |
| 32 | 32 | --> $DIR/issue-24081.rs:11:1 |
| ... | ... | @@ -41,7 +41,7 @@ LL | enum Mul { A, B } |
| 41 | 41 | help: you can use `as` to change the binding name of the import |
| 42 | 42 | | |
| 43 | 43 | LL | use std::ops::Mul as OtherMul; |
| 44 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 44 | | +++++++++++ | |
| 45 | 45 | |
| 46 | 46 | error[E0255]: the name `Div` is defined multiple times |
| 47 | 47 | --> $DIR/issue-24081.rs:13:1 |
| ... | ... | @@ -56,7 +56,7 @@ LL | mod Div { } |
| 56 | 56 | help: you can use `as` to change the binding name of the import |
| 57 | 57 | | |
| 58 | 58 | LL | use std::ops::Div as OtherDiv; |
| 59 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 59 | | +++++++++++ | |
| 60 | 60 | |
| 61 | 61 | error[E0255]: the name `Rem` is defined multiple times |
| 62 | 62 | --> $DIR/issue-24081.rs:15:1 |
| ... | ... | @@ -71,7 +71,7 @@ LL | trait Rem { } |
| 71 | 71 | help: you can use `as` to change the binding name of the import |
| 72 | 72 | | |
| 73 | 73 | LL | use std::ops::Rem as OtherRem; |
| 74 | | ~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 74 | | +++++++++++ | |
| 75 | 75 | |
| 76 | 76 | error: aborting due to 5 previous errors |
| 77 | 77 |
tests/ui/imports/issue-25396.stderr+4-4| ... | ... | @@ -10,7 +10,7 @@ LL | use bar::baz; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use bar::baz as other_baz; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ++++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error[E0252]: the name `Quux` is defined multiple times |
| 16 | 16 | --> $DIR/issue-25396.rs:7:5 |
| ... | ... | @@ -24,7 +24,7 @@ LL | use bar::Quux; |
| 24 | 24 | help: you can use `as` to change the binding name of the import |
| 25 | 25 | | |
| 26 | 26 | LL | use bar::Quux as OtherQuux; |
| 27 | | ~~~~~~~~~~~~~~~~~~~~~~ | |
| 27 | | ++++++++++++ | |
| 28 | 28 | |
| 29 | 29 | error[E0252]: the name `blah` is defined multiple times |
| 30 | 30 | --> $DIR/issue-25396.rs:10:5 |
| ... | ... | @@ -38,7 +38,7 @@ LL | use bar::blah; |
| 38 | 38 | help: you can use `as` to change the binding name of the import |
| 39 | 39 | | |
| 40 | 40 | LL | use bar::blah as other_blah; |
| 41 | | ~~~~~~~~~~~~~~~~~~~~~~~ | |
| 41 | | +++++++++++++ | |
| 42 | 42 | |
| 43 | 43 | error[E0252]: the name `WOMP` is defined multiple times |
| 44 | 44 | --> $DIR/issue-25396.rs:13:5 |
| ... | ... | @@ -52,7 +52,7 @@ LL | use bar::WOMP; |
| 52 | 52 | help: you can use `as` to change the binding name of the import |
| 53 | 53 | | |
| 54 | 54 | LL | use bar::WOMP as OtherWOMP; |
| 55 | | ~~~~~~~~~~~~~~~~~~~~~~ | |
| 55 | | ++++++++++++ | |
| 56 | 56 | |
| 57 | 57 | error: aborting due to 4 previous errors |
| 58 | 58 |
tests/ui/imports/issue-32354-suggest-import-rename.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use extension2::ConstructorExtension; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use extension2::ConstructorExtension as OtherConstructorExtension; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ++++++++++++++++++++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-45829/import-self.stderr+1-1| ... | ... | @@ -48,7 +48,7 @@ LL | use foo::self; |
| 48 | 48 | help: you can use `as` to change the binding name of the import |
| 49 | 49 | | |
| 50 | 50 | LL | use foo as other_foo; |
| 51 | | ~~~~~~~~~~~~~~~~ | |
| 51 | | ~~~~~~~~~~~~ | |
| 52 | 52 | |
| 53 | 53 | error[E0252]: the name `A` is defined multiple times |
| 54 | 54 | --> $DIR/import-self.rs:16:11 |
tests/ui/imports/issue-45829/issue-45829.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use foo::{A, B as A}; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use foo::{A, B as OtherA}; |
| 13 | | ~~~~~~~~~~~ | |
| 13 | | ~~~~~~~~~ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-45829/rename-use-vs-extern.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use std as issue_45829_b; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use std as other_issue_45829_b; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-45829/rename-use-with-tabs.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use foo::{A, bar::B as A}; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use foo::{A, bar::B as OtherA}; |
| 13 | | ~~~~~~~~~~~~~~~~ | |
| 13 | | ~~~~~~~~~ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-45829/rename-with-path.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use std::{collections::HashMap as A, sync::Arc as A}; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use std::{collections::HashMap as A, sync::Arc as OtherA}; |
| 13 | | ~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ~~~~~~~~~ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-45829/rename.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | use std as core; |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use std as other_core; |
| 13 | | ~~~~~~~~~~~~~~~~~ | |
| 13 | | ~~~~~~~~~~~~~ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/imports/issue-52891.stderr+1-1| ... | ... | @@ -98,7 +98,7 @@ LL | use issue_52891::b::inner; |
| 98 | 98 | help: you can use `as` to change the binding name of the import |
| 99 | 99 | | |
| 100 | 100 | LL | use issue_52891::b::inner as other_inner; |
| 101 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 101 | | ++++++++++++++ | |
| 102 | 102 | |
| 103 | 103 | error[E0254]: the name `issue_52891` is defined multiple times |
| 104 | 104 | --> $DIR/issue-52891.rs:31:19 |
tests/ui/imports/issue-8640.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ LL | mod bar {} |
| 10 | 10 | help: you can use `as` to change the binding name of the import |
| 11 | 11 | | |
| 12 | 12 | LL | use baz::bar as other_bar; |
| 13 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 13 | | ++++++++++++ | |
| 14 | 14 | |
| 15 | 15 | error: aborting due to 1 previous error |
| 16 | 16 |
tests/ui/lifetimes/issue-83753-invalid-associated-type-supertrait-hrtb.stderr+3-2| ... | ... | @@ -6,8 +6,9 @@ LL | fn bar(foo: Foo<Target = usize>) {} |
| 6 | 6 | | |
| 7 | 7 | help: consider removing this associated item binding |
| 8 | 8 | | |
| 9 | LL | fn bar(foo: Foo<Target = usize>) {} | |
| 10 | | ~~~~~~~~~~~~~~~~ | |
| 9 | LL - fn bar(foo: Foo<Target = usize>) {} | |
| 10 | LL + fn bar(foo: Foo) {} | |
| 11 | | | |
| 11 | 12 | |
| 12 | 13 | error: aborting due to 1 previous error |
| 13 | 14 |
tests/ui/resolve/resolve-conflict-import-vs-extern-crate.stderr+1-1| ... | ... | @@ -8,7 +8,7 @@ LL | use std::slice as std; |
| 8 | 8 | help: you can use `as` to change the binding name of the import |
| 9 | 9 | | |
| 10 | 10 | LL | use std::slice as other_std; |
| 11 | | ~~~~~~~~~~~~~~~~~~~~~~~ | |
| 11 | | ~~~~~~~~~~~~ | |
| 12 | 12 | |
| 13 | 13 | error: aborting due to 1 previous error |
| 14 | 14 |
tests/ui/resolve/resolve-conflict-item-vs-import.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | fn transmute() {} |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use std::mem::transmute as other_transmute; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/resolve/resolve-conflict-type-vs-import.stderr+1-1| ... | ... | @@ -11,7 +11,7 @@ LL | struct Iter; |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | use std::slice::Iter as OtherIter; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | ++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error: aborting due to 1 previous error |
| 17 | 17 |
tests/ui/suggestions/issue-85347.stderr+6-4| ... | ... | @@ -22,8 +22,9 @@ LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; |
| 22 | 22 | | |
| 23 | 23 | help: consider removing this associated item binding |
| 24 | 24 | | |
| 25 | LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; | |
| 26 | | ~~~~~~~~~~~~~~~ | |
| 25 | LL - type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; | |
| 26 | LL + type Bar<'a>: Deref<Target = <Self>::Bar>; | |
| 27 | | | |
| 27 | 28 | |
| 28 | 29 | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied |
| 29 | 30 | --> $DIR/issue-85347.rs:3:42 |
| ... | ... | @@ -51,8 +52,9 @@ LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; |
| 51 | 52 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 52 | 53 | help: consider removing this associated item binding |
| 53 | 54 | | |
| 54 | LL | type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; | |
| 55 | | ~~~~~~~~~~~~~~~ | |
| 55 | LL - type Bar<'a>: Deref<Target = <Self>::Bar<Target = Self>>; | |
| 56 | LL + type Bar<'a>: Deref<Target = <Self>::Bar>; | |
| 57 | | | |
| 56 | 58 | |
| 57 | 59 | error: aborting due to 4 previous errors |
| 58 | 60 |
tests/ui/variants/variant-namespacing.stderr+6-6| ... | ... | @@ -11,7 +11,7 @@ LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; |
| 11 | 11 | help: you can use `as` to change the binding name of the import |
| 12 | 12 | | |
| 13 | 13 | LL | pub use variant_namespacing::XE::{XStruct as OtherXStruct, XTuple, XUnit}; |
| 14 | | ~~~~~~~~~~~~~~~~~~~~~~~ | |
| 14 | | +++++++++++++++ | |
| 15 | 15 | |
| 16 | 16 | error[E0255]: the name `XTuple` is defined multiple times |
| 17 | 17 | --> $DIR/variant-namespacing.rs:24:44 |
| ... | ... | @@ -26,7 +26,7 @@ LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; |
| 26 | 26 | help: you can use `as` to change the binding name of the import |
| 27 | 27 | | |
| 28 | 28 | LL | pub use variant_namespacing::XE::{XStruct, XTuple as OtherXTuple, XUnit}; |
| 29 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 29 | | ++++++++++++++ | |
| 30 | 30 | |
| 31 | 31 | error[E0255]: the name `XUnit` is defined multiple times |
| 32 | 32 | --> $DIR/variant-namespacing.rs:24:52 |
| ... | ... | @@ -41,7 +41,7 @@ LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit}; |
| 41 | 41 | help: you can use `as` to change the binding name of the import |
| 42 | 42 | | |
| 43 | 43 | LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit as OtherXUnit}; |
| 44 | | ~~~~~~~~~~~~~~~~~~~ | |
| 44 | | +++++++++++++ | |
| 45 | 45 | |
| 46 | 46 | error[E0255]: the name `Struct` is defined multiple times |
| 47 | 47 | --> $DIR/variant-namespacing.rs:28:13 |
| ... | ... | @@ -56,7 +56,7 @@ LL | pub use E::{Struct, Tuple, Unit}; |
| 56 | 56 | help: you can use `as` to change the binding name of the import |
| 57 | 57 | | |
| 58 | 58 | LL | pub use E::{Struct as OtherStruct, Tuple, Unit}; |
| 59 | | ~~~~~~~~~~~~~~~~~~~~~ | |
| 59 | | ++++++++++++++ | |
| 60 | 60 | |
| 61 | 61 | error[E0255]: the name `Tuple` is defined multiple times |
| 62 | 62 | --> $DIR/variant-namespacing.rs:28:21 |
| ... | ... | @@ -71,7 +71,7 @@ LL | pub use E::{Struct, Tuple, Unit}; |
| 71 | 71 | help: you can use `as` to change the binding name of the import |
| 72 | 72 | | |
| 73 | 73 | LL | pub use E::{Struct, Tuple as OtherTuple, Unit}; |
| 74 | | ~~~~~~~~~~~~~~~~~~~ | |
| 74 | | +++++++++++++ | |
| 75 | 75 | |
| 76 | 76 | error[E0255]: the name `Unit` is defined multiple times |
| 77 | 77 | --> $DIR/variant-namespacing.rs:28:28 |
| ... | ... | @@ -86,7 +86,7 @@ LL | pub use E::{Struct, Tuple, Unit}; |
| 86 | 86 | help: you can use `as` to change the binding name of the import |
| 87 | 87 | | |
| 88 | 88 | LL | pub use E::{Struct, Tuple, Unit as OtherUnit}; |
| 89 | | ~~~~~~~~~~~~~~~~~ | |
| 89 | | ++++++++++++ | |
| 90 | 90 | |
| 91 | 91 | error: aborting due to 6 previous errors |
| 92 | 92 |