| author | bors <bors@rust-lang.org> 2025-07-31 08:54:41 UTC |
| committer | bors <bors@rust-lang.org> 2025-07-31 08:54:41 UTC |
| log | 64ca23b6235732fa61c0a2b957c5d7e591e7c972 |
| tree | 4688ea8f1bef26095df721f0a4344b64e2e66f03 |
| parent | cc0a5b73053c62a3df5f84b3ee85079c9b65fa87 |
| parent | 017586c93abe3b7e6f495a1f2bf34df4f3693411 |
Rollup of 3 pull requests
Successful merges:
- rust-lang/rust#144657 (fix: Only "close the window" when its the last annotated file)
- rust-lang/rust#144665 (Re-block SRoA on SIMD types)
- rust-lang/rust#144713 (`rustc_middle::ty` cleanups)
r? `@ghost`
`@rustbot` modify labels: rollup30 files changed, 244 insertions(+), 152 deletions(-)
compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs+2-2| ... | ... | @@ -277,7 +277,7 @@ where |
| 277 | 277 | // `QueryNormalizeExt::query_normalize` used in the query and `normalize` called below: |
| 278 | 278 | // the former fails to normalize the `nll/relate_tys/impl-fn-ignore-binder-via-bottom.rs` |
| 279 | 279 | // test. Check after #85499 lands to see if its fixes have erased this difference. |
| 280 | let (param_env, value) = key.into_parts(); | |
| 280 | let ty::ParamEnvAnd { param_env, value } = key; | |
| 281 | 281 | let _ = ocx.normalize(&cause, param_env, value.value); |
| 282 | 282 | |
| 283 | 283 | let diag = try_extract_error_from_fulfill_cx( |
| ... | ... | @@ -324,7 +324,7 @@ where |
| 324 | 324 | mbcx.infcx.tcx.infer_ctxt().build_with_canonical(cause.span, &self.canonical_query); |
| 325 | 325 | let ocx = ObligationCtxt::new(&infcx); |
| 326 | 326 | |
| 327 | let (param_env, value) = key.into_parts(); | |
| 327 | let ty::ParamEnvAnd { param_env, value } = key; | |
| 328 | 328 | let _ = ocx.deeply_normalize(&cause, param_env, value.value); |
| 329 | 329 | |
| 330 | 330 | let diag = try_extract_error_from_fulfill_cx( |
compiler/rustc_errors/src/emitter.rs+5-2| ... | ... | @@ -1597,8 +1597,9 @@ impl HumanEmitter { |
| 1597 | 1597 | annotated_files.swap(0, pos); |
| 1598 | 1598 | } |
| 1599 | 1599 | |
| 1600 | let annotated_files_len = annotated_files.len(); | |
| 1600 | 1601 | // Print out the annotate source lines that correspond with the error |
| 1601 | for annotated_file in annotated_files { | |
| 1602 | for (file_idx, annotated_file) in annotated_files.into_iter().enumerate() { | |
| 1602 | 1603 | // we can't annotate anything if the source is unavailable. |
| 1603 | 1604 | if !should_show_source_code( |
| 1604 | 1605 | &self.ignored_directories_in_source_blocks, |
| ... | ... | @@ -1855,7 +1856,9 @@ impl HumanEmitter { |
| 1855 | 1856 | width_offset, |
| 1856 | 1857 | code_offset, |
| 1857 | 1858 | margin, |
| 1858 | !is_cont && line_idx + 1 == annotated_file.lines.len(), | |
| 1859 | !is_cont | |
| 1860 | && file_idx + 1 == annotated_files_len | |
| 1861 | && line_idx + 1 == annotated_file.lines.len(), | |
| 1859 | 1862 | ); |
| 1860 | 1863 | |
| 1861 | 1864 | let mut to_add = FxHashMap::default(); |
compiler/rustc_hir_typeck/src/fallback.rs+2-1| ... | ... | @@ -18,6 +18,7 @@ use rustc_span::{DUMMY_SP, Span}; |
| 18 | 18 | use rustc_trait_selection::traits::{ObligationCause, ObligationCtxt}; |
| 19 | 19 | use tracing::debug; |
| 20 | 20 | |
| 21 | use crate::typeck_root_ctxt::InferVarInfo; | |
| 21 | 22 | use crate::{FnCtxt, errors}; |
| 22 | 23 | |
| 23 | 24 | #[derive(Copy, Clone)] |
| ... | ... | @@ -345,7 +346,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> { |
| 345 | 346 | .map(|(_, info)| *info) |
| 346 | 347 | .collect(); |
| 347 | 348 | |
| 348 | let found_infer_var_info = ty::InferVarInfo { | |
| 349 | let found_infer_var_info = InferVarInfo { | |
| 349 | 350 | self_in_trait: infer_var_infos.items().any(|info| info.self_in_trait), |
| 350 | 351 | output: infer_var_infos.items().any(|info| info.output), |
| 351 | 352 | }; |
compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs+20-5| ... | ... | @@ -17,6 +17,21 @@ enum ClauseFlavor { |
| 17 | 17 | Const, |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | |
| 21 | enum ParamTerm { | |
| 22 | Ty(ty::ParamTy), | |
| 23 | Const(ty::ParamConst), | |
| 24 | } | |
| 25 | ||
| 26 | impl ParamTerm { | |
| 27 | fn index(self) -> usize { | |
| 28 | match self { | |
| 29 | ParamTerm::Ty(ty) => ty.index as usize, | |
| 30 | ParamTerm::Const(ct) => ct.index as usize, | |
| 31 | } | |
| 32 | } | |
| 33 | } | |
| 34 | ||
| 20 | 35 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 21 | 36 | pub(crate) fn adjust_fulfillment_error_for_expr_obligation( |
| 22 | 37 | &self, |
| ... | ... | @@ -77,17 +92,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 77 | 92 | _ => return false, |
| 78 | 93 | }; |
| 79 | 94 | |
| 80 | let find_param_matching = |matches: &dyn Fn(ty::ParamTerm) -> bool| { | |
| 95 | let find_param_matching = |matches: &dyn Fn(ParamTerm) -> bool| { | |
| 81 | 96 | predicate_args.iter().find_map(|arg| { |
| 82 | 97 | arg.walk().find_map(|arg| { |
| 83 | 98 | if let ty::GenericArgKind::Type(ty) = arg.kind() |
| 84 | 99 | && let ty::Param(param_ty) = *ty.kind() |
| 85 | && matches(ty::ParamTerm::Ty(param_ty)) | |
| 100 | && matches(ParamTerm::Ty(param_ty)) | |
| 86 | 101 | { |
| 87 | 102 | Some(arg) |
| 88 | 103 | } else if let ty::GenericArgKind::Const(ct) = arg.kind() |
| 89 | 104 | && let ty::ConstKind::Param(param_ct) = ct.kind() |
| 90 | && matches(ty::ParamTerm::Const(param_ct)) | |
| 105 | && matches(ParamTerm::Const(param_ct)) | |
| 91 | 106 | { |
| 92 | 107 | Some(arg) |
| 93 | 108 | } else { |
| ... | ... | @@ -106,14 +121,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 106 | 121 | // from a trait or impl, for example. |
| 107 | 122 | let mut fallback_param_to_point_at = find_param_matching(&|param_term| { |
| 108 | 123 | self.tcx.parent(generics.param_at(param_term.index(), self.tcx).def_id) != def_id |
| 109 | && !matches!(param_term, ty::ParamTerm::Ty(ty) if ty.name == kw::SelfUpper) | |
| 124 | && !matches!(param_term, ParamTerm::Ty(ty) if ty.name == kw::SelfUpper) | |
| 110 | 125 | }); |
| 111 | 126 | // Finally, the `Self` parameter is possibly the reason that the predicate |
| 112 | 127 | // is unsatisfied. This is less likely to be true for methods, because |
| 113 | 128 | // method probe means that we already kinda check that the predicates due |
| 114 | 129 | // to the `Self` type are true. |
| 115 | 130 | let mut self_param_to_point_at = find_param_matching( |
| 116 | &|param_term| matches!(param_term, ty::ParamTerm::Ty(ty) if ty.name == kw::SelfUpper), | |
| 131 | &|param_term| matches!(param_term, ParamTerm::Ty(ty) if ty.name == kw::SelfUpper), | |
| 117 | 132 | ); |
| 118 | 133 | |
| 119 | 134 | // Finally, for ambiguity-related errors, we actually want to look |
compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs+14-1| ... | ... | @@ -17,6 +17,19 @@ use tracing::{debug, instrument}; |
| 17 | 17 | |
| 18 | 18 | use super::callee::DeferredCallResolution; |
| 19 | 19 | |
| 20 | #[derive(Debug, Default, Copy, Clone)] | |
| 21 | pub(crate) struct InferVarInfo { | |
| 22 | /// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo` | |
| 23 | /// obligation, where: | |
| 24 | /// | |
| 25 | /// * `Foo` is not `Sized` | |
| 26 | /// * `(): Foo` may be satisfied | |
| 27 | pub self_in_trait: bool, | |
| 28 | /// This is true if we identified that this Ty (`?T`) is found in a `<_ as | |
| 29 | /// _>::AssocType = ?T` | |
| 30 | pub output: bool, | |
| 31 | } | |
| 32 | ||
| 20 | 33 | /// Data shared between a "typeck root" and its nested bodies, |
| 21 | 34 | /// e.g. closures defined within the function. For example: |
| 22 | 35 | /// ```ignore (illustrative) |
| ... | ... | @@ -71,7 +84,7 @@ pub(crate) struct TypeckRootCtxt<'tcx> { |
| 71 | 84 | /// fallback. See the `fallback` module for details. |
| 72 | 85 | pub(super) diverging_type_vars: RefCell<UnordSet<Ty<'tcx>>>, |
| 73 | 86 | |
| 74 | pub(super) infer_var_info: RefCell<UnordMap<ty::TyVid, ty::InferVarInfo>>, | |
| 87 | pub(super) infer_var_info: RefCell<UnordMap<ty::TyVid, InferVarInfo>>, | |
| 75 | 88 | } |
| 76 | 89 | |
| 77 | 90 | impl<'tcx> Deref for TypeckRootCtxt<'tcx> { |
compiler/rustc_infer/src/infer/canonical/canonicalizer.rs+1-1| ... | ... | @@ -44,7 +44,7 @@ impl<'tcx> InferCtxt<'tcx> { |
| 44 | 44 | where |
| 45 | 45 | V: TypeFoldable<TyCtxt<'tcx>>, |
| 46 | 46 | { |
| 47 | let (param_env, value) = value.into_parts(); | |
| 47 | let ty::ParamEnvAnd { param_env, value } = value; | |
| 48 | 48 | let canonical_param_env = self.tcx.canonical_param_env_cache.get_or_insert( |
| 49 | 49 | self.tcx, |
| 50 | 50 | param_env, |
compiler/rustc_infer/src/infer/relate/generalize.rs+26-10| ... | ... | @@ -19,6 +19,24 @@ use crate::infer::type_variable::TypeVariableValue; |
| 19 | 19 | use crate::infer::unify_key::ConstVariableValue; |
| 20 | 20 | use crate::infer::{InferCtxt, RegionVariableOrigin, relate}; |
| 21 | 21 | |
| 22 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] | |
| 23 | enum TermVid { | |
| 24 | Ty(ty::TyVid), | |
| 25 | Const(ty::ConstVid), | |
| 26 | } | |
| 27 | ||
| 28 | impl From<ty::TyVid> for TermVid { | |
| 29 | fn from(value: ty::TyVid) -> Self { | |
| 30 | TermVid::Ty(value) | |
| 31 | } | |
| 32 | } | |
| 33 | ||
| 34 | impl From<ty::ConstVid> for TermVid { | |
| 35 | fn from(value: ty::ConstVid) -> Self { | |
| 36 | TermVid::Const(value) | |
| 37 | } | |
| 38 | } | |
| 39 | ||
| 22 | 40 | impl<'tcx> InferCtxt<'tcx> { |
| 23 | 41 | /// The idea is that we should ensure that the type variable `target_vid` |
| 24 | 42 | /// is equal to, a subtype of, or a supertype of `source_ty`. |
| ... | ... | @@ -238,20 +256,18 @@ impl<'tcx> InferCtxt<'tcx> { |
| 238 | 256 | &self, |
| 239 | 257 | span: Span, |
| 240 | 258 | structurally_relate_aliases: StructurallyRelateAliases, |
| 241 | target_vid: impl Into<ty::TermVid>, | |
| 259 | target_vid: impl Into<TermVid>, | |
| 242 | 260 | ambient_variance: ty::Variance, |
| 243 | 261 | source_term: T, |
| 244 | 262 | ) -> RelateResult<'tcx, Generalization<T>> { |
| 245 | 263 | assert!(!source_term.has_escaping_bound_vars()); |
| 246 | 264 | let (for_universe, root_vid) = match target_vid.into() { |
| 247 | ty::TermVid::Ty(ty_vid) => { | |
| 248 | (self.probe_ty_var(ty_vid).unwrap_err(), ty::TermVid::Ty(self.root_var(ty_vid))) | |
| 265 | TermVid::Ty(ty_vid) => { | |
| 266 | (self.probe_ty_var(ty_vid).unwrap_err(), TermVid::Ty(self.root_var(ty_vid))) | |
| 249 | 267 | } |
| 250 | ty::TermVid::Const(ct_vid) => ( | |
| 268 | TermVid::Const(ct_vid) => ( | |
| 251 | 269 | self.probe_const_var(ct_vid).unwrap_err(), |
| 252 | ty::TermVid::Const( | |
| 253 | self.inner.borrow_mut().const_unification_table().find(ct_vid).vid, | |
| 254 | ), | |
| 270 | TermVid::Const(self.inner.borrow_mut().const_unification_table().find(ct_vid).vid), | |
| 255 | 271 | ), |
| 256 | 272 | }; |
| 257 | 273 | |
| ... | ... | @@ -299,7 +315,7 @@ struct Generalizer<'me, 'tcx> { |
| 299 | 315 | /// The vid of the type variable that is in the process of being |
| 300 | 316 | /// instantiated. If we find this within the value we are folding, |
| 301 | 317 | /// that means we would have created a cyclic value. |
| 302 | root_vid: ty::TermVid, | |
| 318 | root_vid: TermVid, | |
| 303 | 319 | |
| 304 | 320 | /// The universe of the type variable that is in the process of being |
| 305 | 321 | /// instantiated. If we find anything that this universe cannot name, |
| ... | ... | @@ -469,7 +485,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 469 | 485 | ty::Infer(ty::TyVar(vid)) => { |
| 470 | 486 | let mut inner = self.infcx.inner.borrow_mut(); |
| 471 | 487 | let vid = inner.type_variables().root_var(vid); |
| 472 | if ty::TermVid::Ty(vid) == self.root_vid { | |
| 488 | if TermVid::Ty(vid) == self.root_vid { | |
| 473 | 489 | // If sub-roots are equal, then `root_vid` and |
| 474 | 490 | // `vid` are related via subtyping. |
| 475 | 491 | Err(self.cyclic_term_error()) |
| ... | ... | @@ -621,7 +637,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> { |
| 621 | 637 | // If root const vids are equal, then `root_vid` and |
| 622 | 638 | // `vid` are related and we'd be inferring an infinitely |
| 623 | 639 | // deep const. |
| 624 | if ty::TermVid::Const( | |
| 640 | if TermVid::Const( | |
| 625 | 641 | self.infcx.inner.borrow_mut().const_unification_table().find(vid).vid, |
| 626 | 642 | ) == self.root_vid |
| 627 | 643 | { |
compiler/rustc_interface/src/passes.rs+2-2| ... | ... | @@ -29,7 +29,7 @@ use rustc_parse::{ |
| 29 | 29 | new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal, validate_attr, |
| 30 | 30 | }; |
| 31 | 31 | use rustc_passes::{abi_test, input_stats, layout_test}; |
| 32 | use rustc_resolve::Resolver; | |
| 32 | use rustc_resolve::{Resolver, ResolverOutputs}; | |
| 33 | 33 | use rustc_session::config::{CrateType, Input, OutFileName, OutputFilenames, OutputType}; |
| 34 | 34 | use rustc_session::cstore::Untracked; |
| 35 | 35 | use rustc_session::output::{collect_crate_types, filename_for_input}; |
| ... | ... | @@ -793,7 +793,7 @@ fn resolver_for_lowering_raw<'tcx>( |
| 793 | 793 | // Make sure we don't mutate the cstore from here on. |
| 794 | 794 | tcx.untracked().cstore.freeze(); |
| 795 | 795 | |
| 796 | let ty::ResolverOutputs { | |
| 796 | let ResolverOutputs { | |
| 797 | 797 | global_ctxt: untracked_resolutions, |
| 798 | 798 | ast_lowering: untracked_resolver_for_lowering, |
| 799 | 799 | } = resolver.into_outputs(); |
compiler/rustc_middle/src/ty/codec.rs-3| ... | ... | @@ -510,12 +510,9 @@ impl_decodable_via_ref! { |
| 510 | 510 | &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>>, |
| 511 | 511 | &'tcx traits::ImplSource<'tcx, ()>, |
| 512 | 512 | &'tcx mir::Body<'tcx>, |
| 513 | &'tcx mir::ConcreteOpaqueTypes<'tcx>, | |
| 514 | 513 | &'tcx ty::List<ty::BoundVariableKind>, |
| 515 | 514 | &'tcx ty::List<ty::Pattern<'tcx>>, |
| 516 | 515 | &'tcx ty::ListWithCachedTypeInfo<ty::Clause<'tcx>>, |
| 517 | &'tcx ty::List<FieldIdx>, | |
| 518 | &'tcx ty::List<(VariantIdx, FieldIdx)>, | |
| 519 | 516 | } |
| 520 | 517 | |
| 521 | 518 | #[macro_export] |
compiler/rustc_middle/src/ty/mod.rs+3-100| ... | ... | @@ -49,7 +49,7 @@ use rustc_serialize::{Decodable, Encodable}; |
| 49 | 49 | use rustc_session::lint::LintBuffer; |
| 50 | 50 | pub use rustc_session::lint::RegisteredTools; |
| 51 | 51 | use rustc_span::hygiene::MacroKind; |
| 52 | use rustc_span::{DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol, kw, sym}; | |
| 52 | use rustc_span::{DUMMY_SP, ExpnId, ExpnKind, Ident, Span, Symbol, sym}; | |
| 53 | 53 | pub use rustc_type_ir::data_structures::{DelayedMap, DelayedSet}; |
| 54 | 54 | pub use rustc_type_ir::fast_reject::DeepRejectCtxt; |
| 55 | 55 | #[allow( |
| ... | ... | @@ -168,11 +168,6 @@ mod visit; |
| 168 | 168 | |
| 169 | 169 | // Data types |
| 170 | 170 | |
| 171 | pub struct ResolverOutputs { | |
| 172 | pub global_ctxt: ResolverGlobalCtxt, | |
| 173 | pub ast_lowering: ResolverAstLowering, | |
| 174 | } | |
| 175 | ||
| 176 | 171 | #[derive(Debug, HashStable)] |
| 177 | 172 | pub struct ResolverGlobalCtxt { |
| 178 | 173 | pub visibilities_for_hashing: Vec<(LocalDefId, Visibility)>, |
| ... | ... | @@ -253,18 +248,6 @@ impl MainDefinition { |
| 253 | 248 | } |
| 254 | 249 | } |
| 255 | 250 | |
| 256 | /// The "header" of an impl is everything outside the body: a Self type, a trait | |
| 257 | /// ref (in the case of a trait impl), and a set of predicates (from the | |
| 258 | /// bounds / where-clauses). | |
| 259 | #[derive(Clone, Debug, TypeFoldable, TypeVisitable)] | |
| 260 | pub struct ImplHeader<'tcx> { | |
| 261 | pub impl_def_id: DefId, | |
| 262 | pub impl_args: ty::GenericArgsRef<'tcx>, | |
| 263 | pub self_ty: Ty<'tcx>, | |
| 264 | pub trait_ref: Option<TraitRef<'tcx>>, | |
| 265 | pub predicates: Vec<Predicate<'tcx>>, | |
| 266 | } | |
| 267 | ||
| 268 | 251 | #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)] |
| 269 | 252 | pub struct ImplTraitHeader<'tcx> { |
| 270 | 253 | pub trait_ref: ty::EarlyBinder<'tcx, ty::TraitRef<'tcx>>, |
| ... | ... | @@ -468,14 +451,6 @@ impl<'tcx> rustc_type_ir::Flags for Ty<'tcx> { |
| 468 | 451 | } |
| 469 | 452 | } |
| 470 | 453 | |
| 471 | impl EarlyParamRegion { | |
| 472 | /// Does this early bound region have a name? Early bound regions normally | |
| 473 | /// always have names except when using anonymous lifetimes (`'_`). | |
| 474 | pub fn is_named(&self) -> bool { | |
| 475 | self.name != kw::UnderscoreLifetime | |
| 476 | } | |
| 477 | } | |
| 478 | ||
| 479 | 454 | /// The crate outlives map is computed during typeck and contains the |
| 480 | 455 | /// outlives of every item in the local crate. You should not use it |
| 481 | 456 | /// directly, because to do so will make your pass dependent on the |
| ... | ... | @@ -696,39 +671,6 @@ impl<'tcx> TermKind<'tcx> { |
| 696 | 671 | } |
| 697 | 672 | } |
| 698 | 673 | |
| 699 | #[derive(Copy, Clone, PartialEq, Eq, Debug)] | |
| 700 | pub enum ParamTerm { | |
| 701 | Ty(ParamTy), | |
| 702 | Const(ParamConst), | |
| 703 | } | |
| 704 | ||
| 705 | impl ParamTerm { | |
| 706 | pub fn index(self) -> usize { | |
| 707 | match self { | |
| 708 | ParamTerm::Ty(ty) => ty.index as usize, | |
| 709 | ParamTerm::Const(ct) => ct.index as usize, | |
| 710 | } | |
| 711 | } | |
| 712 | } | |
| 713 | ||
| 714 | #[derive(Copy, Clone, Eq, PartialEq, Debug)] | |
| 715 | pub enum TermVid { | |
| 716 | Ty(ty::TyVid), | |
| 717 | Const(ty::ConstVid), | |
| 718 | } | |
| 719 | ||
| 720 | impl From<ty::TyVid> for TermVid { | |
| 721 | fn from(value: ty::TyVid) -> Self { | |
| 722 | TermVid::Ty(value) | |
| 723 | } | |
| 724 | } | |
| 725 | ||
| 726 | impl From<ty::ConstVid> for TermVid { | |
| 727 | fn from(value: ty::ConstVid) -> Self { | |
| 728 | TermVid::Const(value) | |
| 729 | } | |
| 730 | } | |
| 731 | ||
| 732 | 674 | /// Represents the bounds declared on a particular set of type |
| 733 | 675 | /// parameters. Should eventually be generalized into a flag list of |
| 734 | 676 | /// where-clauses. You can obtain an `InstantiatedPredicates` list from a |
| ... | ... | @@ -1067,12 +1009,6 @@ pub struct ParamEnvAnd<'tcx, T> { |
| 1067 | 1009 | pub value: T, |
| 1068 | 1010 | } |
| 1069 | 1011 | |
| 1070 | impl<'tcx, T> ParamEnvAnd<'tcx, T> { | |
| 1071 | pub fn into_parts(self) -> (ParamEnv<'tcx>, T) { | |
| 1072 | (self.param_env, self.value) | |
| 1073 | } | |
| 1074 | } | |
| 1075 | ||
| 1076 | 1012 | /// The environment in which to do trait solving. |
| 1077 | 1013 | /// |
| 1078 | 1014 | /// Most of the time you only need to care about the `ParamEnv` |
| ... | ... | @@ -1768,15 +1704,6 @@ impl<'tcx> TyCtxt<'tcx> { |
| 1768 | 1704 | } |
| 1769 | 1705 | } |
| 1770 | 1706 | |
| 1771 | // FIXME(@lcnr): Remove this function. | |
| 1772 | pub fn get_attrs_unchecked(self, did: DefId) -> &'tcx [hir::Attribute] { | |
| 1773 | if let Some(did) = did.as_local() { | |
| 1774 | self.hir_attrs(self.local_def_id_to_hir_id(did)) | |
| 1775 | } else { | |
| 1776 | self.attrs_for_def(did) | |
| 1777 | } | |
| 1778 | } | |
| 1779 | ||
| 1780 | 1707 | /// Gets all attributes with the given name. |
| 1781 | 1708 | pub fn get_attrs( |
| 1782 | 1709 | self, |
| ... | ... | @@ -1788,7 +1715,8 @@ impl<'tcx> TyCtxt<'tcx> { |
| 1788 | 1715 | |
| 1789 | 1716 | /// Gets all attributes. |
| 1790 | 1717 | /// |
| 1791 | /// To see if an item has a specific attribute, you should use [`rustc_attr_data_structures::find_attr!`] so you can use matching. | |
| 1718 | /// To see if an item has a specific attribute, you should use | |
| 1719 | /// [`rustc_attr_data_structures::find_attr!`] so you can use matching. | |
| 1792 | 1720 | pub fn get_all_attrs(self, did: impl Into<DefId>) -> &'tcx [hir::Attribute] { |
| 1793 | 1721 | let did: DefId = did.into(); |
| 1794 | 1722 | if let Some(did) = did.as_local() { |
| ... | ... | @@ -2302,34 +2230,9 @@ impl<'tcx> fmt::Debug for SymbolName<'tcx> { |
| 2302 | 2230 | } |
| 2303 | 2231 | } |
| 2304 | 2232 | |
| 2305 | #[derive(Debug, Default, Copy, Clone)] | |
| 2306 | pub struct InferVarInfo { | |
| 2307 | /// This is true if we identified that this Ty (`?T`) is found in a `?T: Foo` | |
| 2308 | /// obligation, where: | |
| 2309 | /// | |
| 2310 | /// * `Foo` is not `Sized` | |
| 2311 | /// * `(): Foo` may be satisfied | |
| 2312 | pub self_in_trait: bool, | |
| 2313 | /// This is true if we identified that this Ty (`?T`) is found in a `<_ as | |
| 2314 | /// _>::AssocType = ?T` | |
| 2315 | pub output: bool, | |
| 2316 | } | |
| 2317 | ||
| 2318 | 2233 | /// The constituent parts of a type level constant of kind ADT or array. |
| 2319 | 2234 | #[derive(Copy, Clone, Debug, HashStable)] |
| 2320 | 2235 | pub struct DestructuredConst<'tcx> { |
| 2321 | 2236 | pub variant: Option<VariantIdx>, |
| 2322 | 2237 | pub fields: &'tcx [ty::Const<'tcx>], |
| 2323 | 2238 | } |
| 2324 | ||
| 2325 | // Some types are used a lot. Make sure they don't unintentionally get bigger. | |
| 2326 | #[cfg(target_pointer_width = "64")] | |
| 2327 | mod size_asserts { | |
| 2328 | use rustc_data_structures::static_assert_size; | |
| 2329 | ||
| 2330 | use super::*; | |
| 2331 | // tidy-alphabetical-start | |
| 2332 | static_assert_size!(PredicateKind<'_>, 32); | |
| 2333 | static_assert_size!(WithCachedTypeInfo<TyKind<'_>>, 48); | |
| 2334 | // tidy-alphabetical-end | |
| 2335 | } |
compiler/rustc_middle/src/ty/predicate.rs+12| ... | ... | @@ -704,3 +704,15 @@ impl<'tcx> Predicate<'tcx> { |
| 704 | 704 | } |
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | ||
| 708 | // Some types are used a lot. Make sure they don't unintentionally get bigger. | |
| 709 | #[cfg(target_pointer_width = "64")] | |
| 710 | mod size_asserts { | |
| 711 | use rustc_data_structures::static_assert_size; | |
| 712 | ||
| 713 | use super::*; | |
| 714 | // tidy-alphabetical-start | |
| 715 | static_assert_size!(PredicateKind<'_>, 32); | |
| 716 | static_assert_size!(WithCachedTypeInfo<PredicateKind<'_>>, 56); | |
| 717 | // tidy-alphabetical-end | |
| 718 | } |
compiler/rustc_middle/src/ty/region.rs+20| ... | ... | @@ -324,6 +324,14 @@ pub struct EarlyParamRegion { |
| 324 | 324 | pub name: Symbol, |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | impl EarlyParamRegion { | |
| 328 | /// Does this early bound region have a name? Early bound regions normally | |
| 329 | /// always have names except when using anonymous lifetimes (`'_`). | |
| 330 | pub fn is_named(&self) -> bool { | |
| 331 | self.name != kw::UnderscoreLifetime | |
| 332 | } | |
| 333 | } | |
| 334 | ||
| 327 | 335 | impl rustc_type_ir::inherent::ParamLike for EarlyParamRegion { |
| 328 | 336 | fn index(self) -> u32 { |
| 329 | 337 | self.index |
| ... | ... | @@ -487,3 +495,15 @@ impl BoundRegionKind { |
| 487 | 495 | } |
| 488 | 496 | } |
| 489 | 497 | } |
| 498 | ||
| 499 | // Some types are used a lot. Make sure they don't unintentionally get bigger. | |
| 500 | #[cfg(target_pointer_width = "64")] | |
| 501 | mod size_asserts { | |
| 502 | use rustc_data_structures::static_assert_size; | |
| 503 | ||
| 504 | use super::*; | |
| 505 | // tidy-alphabetical-start | |
| 506 | static_assert_size!(RegionKind<'_>, 20); | |
| 507 | static_assert_size!(ty::WithCachedTypeInfo<RegionKind<'_>>, 48); | |
| 508 | // tidy-alphabetical-end | |
| 509 | } |
compiler/rustc_middle/src/ty/sty.rs+2-2| ... | ... | @@ -2040,7 +2040,7 @@ mod size_asserts { |
| 2040 | 2040 | |
| 2041 | 2041 | use super::*; |
| 2042 | 2042 | // tidy-alphabetical-start |
| 2043 | static_assert_size!(ty::RegionKind<'_>, 20); | |
| 2044 | static_assert_size!(ty::TyKind<'_>, 24); | |
| 2043 | static_assert_size!(TyKind<'_>, 24); | |
| 2044 | static_assert_size!(ty::WithCachedTypeInfo<TyKind<'_>>, 48); | |
| 2045 | 2045 | // tidy-alphabetical-end |
| 2046 | 2046 | } |
compiler/rustc_mir_transform/src/sroa.rs+5-1| ... | ... | @@ -72,8 +72,12 @@ fn escaping_locals<'tcx>( |
| 72 | 72 | return true; |
| 73 | 73 | } |
| 74 | 74 | if let ty::Adt(def, _args) = ty.kind() |
| 75 | && tcx.is_lang_item(def.did(), LangItem::DynMetadata) | |
| 75 | && (def.repr().simd() || tcx.is_lang_item(def.did(), LangItem::DynMetadata)) | |
| 76 | 76 | { |
| 77 | // Exclude #[repr(simd)] types so that they are not de-optimized into an array | |
| 78 | // (MCP#838 banned projections into SIMD types, but if the value is unused | |
| 79 | // this pass sees "all the uses are of the fields" and expands it.) | |
| 80 | ||
| 77 | 81 | // codegen wants to see the `DynMetadata<T>`, |
| 78 | 82 | // not the inner reference-to-opaque-type. |
| 79 | 83 | return true; |
compiler/rustc_resolve/src/lib.rs+7-2| ... | ... | @@ -64,8 +64,8 @@ use rustc_middle::middle::privacy::EffectiveVisibilities; |
| 64 | 64 | use rustc_middle::query::Providers; |
| 65 | 65 | use rustc_middle::span_bug; |
| 66 | 66 | use rustc_middle::ty::{ |
| 67 | self, DelegationFnSig, Feed, MainDefinition, RegisteredTools, ResolverGlobalCtxt, | |
| 68 | ResolverOutputs, TyCtxt, TyCtxtFeed, Visibility, | |
| 67 | self, DelegationFnSig, Feed, MainDefinition, RegisteredTools, ResolverAstLowering, | |
| 68 | ResolverGlobalCtxt, TyCtxt, TyCtxtFeed, Visibility, | |
| 69 | 69 | }; |
| 70 | 70 | use rustc_query_system::ich::StableHashingContext; |
| 71 | 71 | use rustc_session::lint::builtin::PRIVATE_MACRO_USE; |
| ... | ... | @@ -1037,6 +1037,11 @@ impl MacroData { |
| 1037 | 1037 | } |
| 1038 | 1038 | } |
| 1039 | 1039 | |
| 1040 | pub struct ResolverOutputs { | |
| 1041 | pub global_ctxt: ResolverGlobalCtxt, | |
| 1042 | pub ast_lowering: ResolverAstLowering, | |
| 1043 | } | |
| 1044 | ||
| 1040 | 1045 | /// The main resolver class. |
| 1041 | 1046 | /// |
| 1042 | 1047 | /// This is the visitor that walks the whole crate. |
compiler/rustc_trait_selection/src/traits/coherence.rs+19-6| ... | ... | @@ -12,6 +12,7 @@ use rustc_hir::def::DefKind; |
| 12 | 12 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; |
| 13 | 13 | use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, TyCtxtInferExt}; |
| 14 | 14 | use rustc_infer::traits::PredicateObligations; |
| 15 | use rustc_macros::{TypeFoldable, TypeVisitable}; | |
| 15 | 16 | use rustc_middle::bug; |
| 16 | 17 | use rustc_middle::traits::query::NoSolution; |
| 17 | 18 | use rustc_middle::traits::solve::{CandidateSource, Certainty, Goal}; |
| ... | ... | @@ -37,8 +38,20 @@ use crate::traits::{ |
| 37 | 38 | SelectionContext, SkipLeakCheck, util, |
| 38 | 39 | }; |
| 39 | 40 | |
| 41 | /// The "header" of an impl is everything outside the body: a Self type, a trait | |
| 42 | /// ref (in the case of a trait impl), and a set of predicates (from the | |
| 43 | /// bounds / where-clauses). | |
| 44 | #[derive(Clone, Debug, TypeFoldable, TypeVisitable)] | |
| 45 | pub struct ImplHeader<'tcx> { | |
| 46 | pub impl_def_id: DefId, | |
| 47 | pub impl_args: ty::GenericArgsRef<'tcx>, | |
| 48 | pub self_ty: Ty<'tcx>, | |
| 49 | pub trait_ref: Option<ty::TraitRef<'tcx>>, | |
| 50 | pub predicates: Vec<ty::Predicate<'tcx>>, | |
| 51 | } | |
| 52 | ||
| 40 | 53 | pub struct OverlapResult<'tcx> { |
| 41 | pub impl_header: ty::ImplHeader<'tcx>, | |
| 54 | pub impl_header: ImplHeader<'tcx>, | |
| 42 | 55 | pub intercrate_ambiguity_causes: FxIndexSet<IntercrateAmbiguityCause<'tcx>>, |
| 43 | 56 | |
| 44 | 57 | /// `true` if the overlap might've been permitted before the shift |
| ... | ... | @@ -151,11 +164,11 @@ pub fn overlapping_impls( |
| 151 | 164 | } |
| 152 | 165 | } |
| 153 | 166 | |
| 154 | fn fresh_impl_header<'tcx>(infcx: &InferCtxt<'tcx>, impl_def_id: DefId) -> ty::ImplHeader<'tcx> { | |
| 167 | fn fresh_impl_header<'tcx>(infcx: &InferCtxt<'tcx>, impl_def_id: DefId) -> ImplHeader<'tcx> { | |
| 155 | 168 | let tcx = infcx.tcx; |
| 156 | 169 | let impl_args = infcx.fresh_args_for_item(DUMMY_SP, impl_def_id); |
| 157 | 170 | |
| 158 | ty::ImplHeader { | |
| 171 | ImplHeader { | |
| 159 | 172 | impl_def_id, |
| 160 | 173 | impl_args, |
| 161 | 174 | self_ty: tcx.type_of(impl_def_id).instantiate(tcx, impl_args), |
| ... | ... | @@ -173,7 +186,7 @@ fn fresh_impl_header_normalized<'tcx>( |
| 173 | 186 | infcx: &InferCtxt<'tcx>, |
| 174 | 187 | param_env: ty::ParamEnv<'tcx>, |
| 175 | 188 | impl_def_id: DefId, |
| 176 | ) -> ty::ImplHeader<'tcx> { | |
| 189 | ) -> ImplHeader<'tcx> { | |
| 177 | 190 | let header = fresh_impl_header(infcx, impl_def_id); |
| 178 | 191 | |
| 179 | 192 | let InferOk { value: mut header, obligations } = |
| ... | ... | @@ -287,8 +300,8 @@ fn overlap<'tcx>( |
| 287 | 300 | fn equate_impl_headers<'tcx>( |
| 288 | 301 | infcx: &InferCtxt<'tcx>, |
| 289 | 302 | param_env: ty::ParamEnv<'tcx>, |
| 290 | impl1: &ty::ImplHeader<'tcx>, | |
| 291 | impl2: &ty::ImplHeader<'tcx>, | |
| 303 | impl1: &ImplHeader<'tcx>, | |
| 304 | impl2: &ImplHeader<'tcx>, | |
| 292 | 305 | ) -> Option<PredicateObligations<'tcx>> { |
| 293 | 306 | let result = |
| 294 | 307 | match (impl1.trait_ref, impl2.trait_ref) { |
compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs+1-1| ... | ... | @@ -44,7 +44,7 @@ pub fn type_op_ascribe_user_type_with_span<'tcx>( |
| 44 | 44 | key: ParamEnvAnd<'tcx, AscribeUserType<'tcx>>, |
| 45 | 45 | span: Span, |
| 46 | 46 | ) -> Result<(), NoSolution> { |
| 47 | let (param_env, AscribeUserType { mir_ty, user_ty }) = key.into_parts(); | |
| 47 | let ty::ParamEnvAnd { param_env, value: AscribeUserType { mir_ty, user_ty } } = key; | |
| 48 | 48 | debug!("type_op_ascribe_user_type: mir_ty={:?} user_ty={:?}", mir_ty, user_ty); |
| 49 | 49 | match user_ty.kind { |
| 50 | 50 | UserTypeKind::Ty(user_ty) => relate_mir_and_user_ty(ocx, param_env, span, mir_ty, user_ty)?, |
compiler/rustc_traits/src/implied_outlives_bounds.rs+2-2| ... | ... | @@ -7,7 +7,7 @@ use rustc_infer::infer::canonical::{self, Canonical}; |
| 7 | 7 | use rustc_infer::traits::query::OutlivesBound; |
| 8 | 8 | use rustc_infer::traits::query::type_op::ImpliedOutlivesBounds; |
| 9 | 9 | use rustc_middle::query::Providers; |
| 10 | use rustc_middle::ty::TyCtxt; | |
| 10 | use rustc_middle::ty::{ParamEnvAnd, TyCtxt}; | |
| 11 | 11 | use rustc_span::DUMMY_SP; |
| 12 | 12 | use rustc_trait_selection::infer::InferCtxtBuilderExt; |
| 13 | 13 | use rustc_trait_selection::traits::query::type_op::implied_outlives_bounds::compute_implied_outlives_bounds_inner; |
| ... | ... | @@ -25,7 +25,7 @@ fn implied_outlives_bounds<'tcx>( |
| 25 | 25 | NoSolution, |
| 26 | 26 | > { |
| 27 | 27 | tcx.infer_ctxt().enter_canonical_trait_query(&goal, |ocx, key| { |
| 28 | let (param_env, ImpliedOutlivesBounds { ty }) = key.into_parts(); | |
| 28 | let ParamEnvAnd { param_env, value: ImpliedOutlivesBounds { ty } } = key; | |
| 29 | 29 | compute_implied_outlives_bounds_inner( |
| 30 | 30 | ocx, |
| 31 | 31 | param_env, |
compiler/rustc_traits/src/type_op.rs+2-2| ... | ... | @@ -43,7 +43,7 @@ fn type_op_normalize<'tcx, T>( |
| 43 | 43 | where |
| 44 | 44 | T: fmt::Debug + TypeFoldable<TyCtxt<'tcx>>, |
| 45 | 45 | { |
| 46 | let (param_env, Normalize { value }) = key.into_parts(); | |
| 46 | let ParamEnvAnd { param_env, value: Normalize { value } } = key; | |
| 47 | 47 | let Normalized { value, obligations } = |
| 48 | 48 | ocx.infcx.at(&ObligationCause::dummy(), param_env).query_normalize(value)?; |
| 49 | 49 | ocx.register_obligations(obligations); |
| ... | ... | @@ -96,6 +96,6 @@ pub fn type_op_prove_predicate_with_cause<'tcx>( |
| 96 | 96 | key: ParamEnvAnd<'tcx, ProvePredicate<'tcx>>, |
| 97 | 97 | cause: ObligationCause<'tcx>, |
| 98 | 98 | ) { |
| 99 | let (param_env, ProvePredicate { predicate }) = key.into_parts(); | |
| 99 | let ParamEnvAnd { param_env, value: ProvePredicate { predicate } } = key; | |
| 100 | 100 | ocx.register_obligation(Obligation::new(ocx.infcx.tcx, cause, param_env, predicate)); |
| 101 | 101 | } |
src/librustdoc/clean/inline.rs+1-1| ... | ... | @@ -217,7 +217,7 @@ pub(crate) fn try_inline_glob( |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | pub(crate) fn load_attrs<'hir>(cx: &DocContext<'hir>, did: DefId) -> &'hir [hir::Attribute] { |
| 220 | cx.tcx.get_attrs_unchecked(did) | |
| 220 | cx.tcx.get_all_attrs(did) | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | pub(crate) fn item_relative_path(tcx: TyCtxt<'_>, def_id: DefId) -> Vec<Symbol> { |
src/librustdoc/clean/types.rs+2-5| ... | ... | @@ -404,10 +404,7 @@ impl Item { |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | pub(crate) fn inner_docs(&self, tcx: TyCtxt<'_>) -> bool { |
| 407 | self.item_id | |
| 408 | .as_def_id() | |
| 409 | .map(|did| inner_docs(tcx.get_attrs_unchecked(did))) | |
| 410 | .unwrap_or(false) | |
| 407 | self.item_id.as_def_id().map(|did| inner_docs(tcx.get_all_attrs(did))).unwrap_or(false) | |
| 411 | 408 | } |
| 412 | 409 | |
| 413 | 410 | pub(crate) fn span(&self, tcx: TyCtxt<'_>) -> Option<Span> { |
| ... | ... | @@ -452,7 +449,7 @@ impl Item { |
| 452 | 449 | kind: ItemKind, |
| 453 | 450 | cx: &mut DocContext<'_>, |
| 454 | 451 | ) -> Item { |
| 455 | let hir_attrs = cx.tcx.get_attrs_unchecked(def_id); | |
| 452 | let hir_attrs = cx.tcx.get_all_attrs(def_id); | |
| 456 | 453 | |
| 457 | 454 | Self::from_def_id_and_attrs_and_parts( |
| 458 | 455 | def_id, |
src/tools/clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs+1-1| ... | ... | @@ -185,7 +185,7 @@ impl<'a, 'tcx> SigDropChecker<'a, 'tcx> { |
| 185 | 185 | if let Some(adt) = ty.ty_adt_def() |
| 186 | 186 | && get_attr( |
| 187 | 187 | self.cx.sess(), |
| 188 | self.cx.tcx.get_attrs_unchecked(adt.did()), | |
| 188 | self.cx.tcx.get_all_attrs(adt.did()), | |
| 189 | 189 | sym::has_significant_drop, |
| 190 | 190 | ) |
| 191 | 191 | .count() |
src/tools/clippy/clippy_lints/src/significant_drop_tightening.rs+1-1| ... | ... | @@ -168,7 +168,7 @@ impl<'cx, 'others, 'tcx> AttrChecker<'cx, 'others, 'tcx> { |
| 168 | 168 | if let Some(adt) = ty.ty_adt_def() { |
| 169 | 169 | let mut iter = get_attr( |
| 170 | 170 | self.cx.sess(), |
| 171 | self.cx.tcx.get_attrs_unchecked(adt.did()), | |
| 171 | self.cx.tcx.get_all_attrs(adt.did()), | |
| 172 | 172 | sym::has_significant_drop, |
| 173 | 173 | ); |
| 174 | 174 | if iter.next().is_some() { |
src/tools/clippy/clippy_utils/src/macros.rs+1-1| ... | ... | @@ -42,7 +42,7 @@ pub fn is_format_macro(cx: &LateContext<'_>, macro_def_id: DefId) -> bool { |
| 42 | 42 | } else { |
| 43 | 43 | // Allow users to tag any macro as being format!-like |
| 44 | 44 | // TODO: consider deleting FORMAT_MACRO_DIAG_ITEMS and using just this method |
| 45 | get_unique_attr(cx.sess(), cx.tcx.get_attrs_unchecked(macro_def_id), sym::format_args).is_some() | |
| 45 | get_unique_attr(cx.sess(), cx.tcx.get_all_attrs(macro_def_id), sym::format_args).is_some() | |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 |
tests/mir-opt/sroa/simd_sroa.foo.ScalarReplacementOfAggregates.diff created+32| ... | ... | @@ -0,0 +1,32 @@ |
| 1 | - // MIR for `foo` before ScalarReplacementOfAggregates | |
| 2 | + // MIR for `foo` after ScalarReplacementOfAggregates | |
| 3 | ||
| 4 | fn foo(_1: &[Simd<u8, 16>], _2: Simd<u8, 16>) -> () { | |
| 5 | debug simds => _1; | |
| 6 | debug _unused => _2; | |
| 7 | let mut _0: (); | |
| 8 | let _3: std::simd::Simd<u8, 16>; | |
| 9 | let _4: usize; | |
| 10 | let mut _5: usize; | |
| 11 | let mut _6: bool; | |
| 12 | scope 1 { | |
| 13 | debug a => _3; | |
| 14 | } | |
| 15 | ||
| 16 | bb0: { | |
| 17 | StorageLive(_3); | |
| 18 | StorageLive(_4); | |
| 19 | _4 = const 0_usize; | |
| 20 | _5 = PtrMetadata(copy _1); | |
| 21 | _6 = Lt(copy _4, copy _5); | |
| 22 | assert(move _6, "index out of bounds: the length is {} but the index is {}", move _5, copy _4) -> [success: bb1, unwind continue]; | |
| 23 | } | |
| 24 | ||
| 25 | bb1: { | |
| 26 | _3 = copy (*_1)[_4]; | |
| 27 | StorageDead(_4); | |
| 28 | StorageDead(_3); | |
| 29 | return; | |
| 30 | } | |
| 31 | } | |
| 32 |
tests/mir-opt/sroa/simd_sroa.rs created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | //@ needs-unwind | |
| 2 | #![feature(portable_simd)] | |
| 3 | ||
| 4 | // SRoA expands things even if they're unused | |
| 5 | // <https://github.com/rust-lang/rust/issues/144621> | |
| 6 | ||
| 7 | use std::simd::Simd; | |
| 8 | ||
| 9 | // EMIT_MIR simd_sroa.foo.ScalarReplacementOfAggregates.diff | |
| 10 | pub(crate) fn foo(simds: &[Simd<u8, 16>], _unused: Simd<u8, 16>) { | |
| 11 | // CHECK-LABEL: fn foo | |
| 12 | // CHECK-NOT: [u8; 16] | |
| 13 | // CHECK: let [[SIMD:_.+]]: std::simd::Simd<u8, 16>; | |
| 14 | // CHECK-NOT: [u8; 16] | |
| 15 | // CHECK: [[SIMD]] = copy (*_1)[0 of 1]; | |
| 16 | // CHECK-NOT: [u8; 16] | |
| 17 | let a = simds[0]; | |
| 18 | } |
tests/ui/error-emitter/auxiliary/close_window.rs created+4| ... | ... | @@ -0,0 +1,4 @@ |
| 1 | pub struct S; | |
| 2 | impl S { | |
| 3 | fn method(&self) {} | |
| 4 | } |
tests/ui/error-emitter/close_window.ascii.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error[E0624]: method `method` is private | |
| 2 | --> $DIR/close_window.rs:9:7 | |
| 3 | | | |
| 4 | LL | s.method(); | |
| 5 | | ^^^^^^ private method | |
| 6 | | | |
| 7 | ::: $DIR/auxiliary/close_window.rs:3:5 | |
| 8 | | | |
| 9 | LL | fn method(&self) {} | |
| 10 | | ---------------- private method defined here | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 | ||
| 14 | For more information about this error, try `rustc --explain E0624`. |
tests/ui/error-emitter/close_window.rs created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | //@ aux-build:close_window.rs | |
| 2 | //@ revisions: ascii unicode | |
| 3 | //@[unicode] compile-flags: -Zunstable-options --error-format=human-unicode | |
| 4 | ||
| 5 | extern crate close_window; | |
| 6 | ||
| 7 | fn main() { | |
| 8 | let s = close_window::S; | |
| 9 | s.method(); | |
| 10 | //[ascii]~^ ERROR method `method` is private | |
| 11 | } |
tests/ui/error-emitter/close_window.unicode.stderr created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | error[E0624]: method `method` is private | |
| 2 | ╭▸ $DIR/close_window.rs:9:7 | |
| 3 | │ | |
| 4 | LL │ s.method(); | |
| 5 | │ ━━━━━━ private method | |
| 6 | │ | |
| 7 | ⸬ $DIR/auxiliary/close_window.rs:3:5 | |
| 8 | │ | |
| 9 | LL │ fn method(&self) {} | |
| 10 | ╰╴ ──────────────── private method defined here | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 | ||
| 14 | For more information about this error, try `rustc --explain E0624`. |