diff --git a/src/liballoc/collections/btree/map.rs b/src/liballoc/collections/btree/map.rs index 3ba7befc04609..bde66c406af7f 100644 --- a/src/liballoc/collections/btree/map.rs +++ b/src/liballoc/collections/btree/map.rs @@ -196,7 +196,7 @@ impl Clone for BTreeMap { (root, length) }; - out_node.push(k, v, subroot.unwrap_or_else(|| node::Root::new_leaf())); + out_node.push(k, v, subroot.unwrap_or_else(node::Root::new_leaf)); out_tree.length += 1 + sublength; } } @@ -2147,7 +2147,7 @@ impl BTreeMap { /// If the root node is the empty (non-allocated) root node, allocate our /// own node. fn ensure_root_is_owned(&mut self) -> &mut node::Root { - self.root.get_or_insert_with(|| node::Root::new_leaf()) + self.root.get_or_insert_with(node::Root::new_leaf) } } diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index 40192d072eb0f..f3ae2b3d57a8f 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -245,7 +245,7 @@ impl DepGraph { C: DepGraphSafe + StableHashingContextProvider<'a>, { if let Some(ref data) = self.data { - let task_deps = create_task(key).map(|deps| Lock::new(deps)); + let task_deps = create_task(key).map(Lock::new); // In incremental mode, hash the result of the task. We don't // do anything with the hash yet, but we are computing it diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index 9474f05b55df7..dd2a3f6c29a76 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -796,7 +796,7 @@ impl UndefMask { } // FIXME(oli-obk): optimize this for allocations larger than a block. - let idx = (start.bytes()..end.bytes()).map(|i| Size::from_bytes(i)).find(|&i| !self.get(i)); + let idx = (start.bytes()..end.bytes()).map(Size::from_bytes).find(|&i| !self.get(i)); match idx { Some(idx) => Err(idx), diff --git a/src/librustc_ast/ast.rs b/src/librustc_ast/ast.rs index b7b50617eaaf8..9d00cbe1951ea 100644 --- a/src/librustc_ast/ast.rs +++ b/src/librustc_ast/ast.rs @@ -250,7 +250,7 @@ impl ParenthesizedArgs { pub fn as_angle_bracketed_args(&self) -> AngleBracketedArgs { AngleBracketedArgs { span: self.span, - args: self.inputs.iter().cloned().map(|input| GenericArg::Type(input)).collect(), + args: self.inputs.iter().cloned().map(GenericArg::Type).collect(), constraints: vec![], } } diff --git a/src/librustc_ast_lowering/path.rs b/src/librustc_ast_lowering/path.rs index b5b0a3089ce0f..91b61ebbce69a 100644 --- a/src/librustc_ast_lowering/path.rs +++ b/src/librustc_ast_lowering/path.rs @@ -272,7 +272,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { if !generic_args.parenthesized && !has_lifetimes { generic_args.args = self .elided_path_lifetimes(path_span, expected_lifetimes) - .map(|lt| GenericArg::Lifetime(lt)) + .map(GenericArg::Lifetime) .chain(generic_args.args.into_iter()) .collect(); if expected_lifetimes > 0 && param_mode == ParamMode::Explicit { diff --git a/src/librustc_builtin_macros/deriving/generic/ty.rs b/src/librustc_builtin_macros/deriving/generic/ty.rs index bd54a73531197..d83c98572a272 100644 --- a/src/librustc_builtin_macros/deriving/generic/ty.rs +++ b/src/librustc_builtin_macros/deriving/generic/ty.rs @@ -76,8 +76,8 @@ impl<'a> Path<'a> { self.params.iter().map(|t| t.to_ty(cx, span, self_ty, self_generics)).collect(); let params = lt .into_iter() - .map(|lt| GenericArg::Lifetime(lt)) - .chain(tys.into_iter().map(|ty| GenericArg::Type(ty))) + .map(GenericArg::Lifetime) + .chain(tys.into_iter().map(GenericArg::Type)) .collect(); match self.kind { diff --git a/src/librustc_builtin_macros/source_util.rs b/src/librustc_builtin_macros/source_util.rs index 718498f04b94e..51a15f9df1bc7 100644 --- a/src/librustc_builtin_macros/source_util.rs +++ b/src/librustc_builtin_macros/source_util.rs @@ -6,7 +6,7 @@ use rustc_ast_pretty::pprust; use rustc_expand::base::{self, *}; use rustc_expand::module::DirectoryOwnership; use rustc_expand::panictry; -use rustc_parse::{self, new_sub_parser_from_file, parser::Parser}; +use rustc_parse::{self, new_parser_from_file, parser::Parser}; use rustc_session::lint::builtin::INCOMPLETE_INCLUDE; use rustc_span::symbol::Symbol; use rustc_span::{self, Pos, Span}; @@ -110,7 +110,7 @@ pub fn expand_include<'cx>( return DummyResult::any(sp); } }; - let p = new_sub_parser_from_file(cx.parse_sess(), &file, None, sp); + let p = new_parser_from_file(cx.parse_sess(), &file, Some(sp)); // If in the included file we have e.g., `mod bar;`, // then the path of `bar.rs` should be relative to the directory of `file`. diff --git a/src/librustc_codegen_ssa/mir/constant.rs b/src/librustc_codegen_ssa/mir/constant.rs index 4248627dccaf2..74a9646a0c0af 100644 --- a/src/librustc_codegen_ssa/mir/constant.rs +++ b/src/librustc_codegen_ssa/mir/constant.rs @@ -40,31 +40,26 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { &mut self, constant: &mir::Constant<'tcx>, ) -> Result, ErrorHandled> { - match constant.literal.val { - ty::ConstKind::Unevaluated(def_id, substs, promoted) => { - let substs = self.monomorphize(&substs); - self.cx - .tcx() - .const_eval_resolve(ty::ParamEnv::reveal_all(), def_id, substs, promoted, None) - .map_err(|err| { - if promoted.is_none() { - self.cx - .tcx() - .sess - .span_err(constant.span, "erroneous constant encountered"); - } - err - }) - } + match self.monomorphize(&constant.literal).val { + ty::ConstKind::Unevaluated(def_id, substs, promoted) => self + .cx + .tcx() + .const_eval_resolve(ty::ParamEnv::reveal_all(), def_id, substs, promoted, None) + .map_err(|err| { + if promoted.is_none() { + self.cx + .tcx() + .sess + .span_err(constant.span, "erroneous constant encountered"); + } + err + }), ty::ConstKind::Value(value) => Ok(value), - _ => { - let const_ = self.monomorphize(&constant.literal); - if let ty::ConstKind::Value(value) = const_.val { - Ok(value) - } else { - span_bug!(constant.span, "encountered bad ConstKind in codegen: {:?}", const_); - } - } + err => span_bug!( + constant.span, + "encountered bad ConstKind after monomorphizing: {:?}", + err + ), } } diff --git a/src/librustc_data_structures/sharded.rs b/src/librustc_data_structures/sharded.rs index d08d46a7414d0..485719c517564 100644 --- a/src/librustc_data_structures/sharded.rs +++ b/src/librustc_data_structures/sharded.rs @@ -30,7 +30,7 @@ pub struct Sharded { impl Default for Sharded { #[inline] fn default() -> Self { - Self::new(|| T::default()) + Self::new(T::default) } } diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index 008d2e92418f9..fffae0bfd24d9 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -162,7 +162,7 @@ impl<'a> DiagnosticBuilder<'a> { message: &str, span: Option, ) -> &mut Self { - let span = span.map(|s| s.into()).unwrap_or_else(|| MultiSpan::new()); + let span = span.map(|s| s.into()).unwrap_or_else(MultiSpan::new); self.0.diagnostic.sub(level, message, span, None); self } diff --git a/src/librustc_expand/mbe/macro_rules.rs b/src/librustc_expand/mbe/macro_rules.rs index 3de2169f1142e..b6b69400bad43 100644 --- a/src/librustc_expand/mbe/macro_rules.rs +++ b/src/librustc_expand/mbe/macro_rules.rs @@ -259,8 +259,6 @@ fn generic_extension<'cx>( } let mut p = Parser::new(sess, tts, false, None); - p.root_module_name = - cx.current_expansion.module.mod_path.last().map(|id| id.to_string()); p.last_type_ascription = cx.current_expansion.prior_type_ascription; // Let the context choose how to interpret the result. diff --git a/src/librustc_expand/module.rs b/src/librustc_expand/module.rs index 2d5e4d4e8894d..aad92a09743b3 100644 --- a/src/librustc_expand/module.rs +++ b/src/librustc_expand/module.rs @@ -1,7 +1,7 @@ use rustc_ast::ast::{self, Attribute, Ident, Mod}; use rustc_ast::{attr, token}; use rustc_errors::{struct_span_err, PResult}; -use rustc_parse::new_sub_parser_from_file; +use rustc_parse::new_parser_from_file; use rustc_session::parse::ParseSess; use rustc_span::source_map::{FileName, Span}; use rustc_span::symbol::sym; @@ -59,9 +59,8 @@ crate fn parse_external_mod( *pop_mod_stack = true; // We have pushed, so notify caller. drop(included_mod_stack); - // Actually parse the external file as amodule. - let mut p0 = new_sub_parser_from_file(sess, &mp.path, Some(id.to_string()), span); - let mut module = p0.parse_mod(&token::Eof)?; + // Actually parse the external file as a module. + let mut module = new_parser_from_file(sess, &mp.path, Some(span)).parse_mod(&token::Eof)?; module.0.inline = false; module }; diff --git a/src/librustc_feature/lib.rs b/src/librustc_feature/lib.rs index 01546f7825774..f8bf0315d0c9f 100644 --- a/src/librustc_feature/lib.rs +++ b/src/librustc_feature/lib.rs @@ -51,7 +51,7 @@ pub struct Feature { impl Feature { fn issue(&self) -> Option { - self.issue.and_then(|i| NonZeroU32::new(i)) + self.issue.and_then(NonZeroU32::new) } } diff --git a/src/librustc_infer/infer/error_reporting/need_type_info.rs b/src/librustc_infer/infer/error_reporting/need_type_info.rs index 0eda4555e2565..ea8b4f41888dc 100644 --- a/src/librustc_infer/infer/error_reporting/need_type_info.rs +++ b/src/librustc_infer/infer/error_reporting/need_type_info.rs @@ -3,7 +3,7 @@ use crate::infer::InferCtxt; use rustc::hir::map::Map; use rustc::ty::print::Print; use rustc::ty::{self, DefIdTree, Infer, Ty, TyVar}; -use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder}; +use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder}; use rustc_hir as hir; use rustc_hir::def::{DefKind, Namespace}; use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor}; @@ -462,24 +462,19 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { e: &Expr<'_>, err: &mut DiagnosticBuilder<'_>, ) { - if let (Ok(snippet), Some(tables), None) = ( - self.tcx.sess.source_map().span_to_snippet(segment.ident.span), - self.in_progress_tables, - &segment.args, - ) { + if let (Some(tables), None) = (self.in_progress_tables, &segment.args) { let borrow = tables.borrow(); if let Some((DefKind::AssocFn, did)) = borrow.type_dependent_def(e.hir_id) { let generics = self.tcx.generics_of(did); if !generics.params.is_empty() { - err.span_suggestion( - segment.ident.span, + err.span_suggestion_verbose( + segment.ident.span.shrink_to_hi(), &format!( "consider specifying the type argument{} in the method call", - if generics.params.len() > 1 { "s" } else { "" }, + pluralize!(generics.params.len()), ), format!( - "{}::<{}>", - snippet, + "::<{}>", generics .params .iter() diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 8d9e287cdc9d6..cb1ed87b02fda 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -703,7 +703,7 @@ impl<'tcx> QueryContext<'tcx> { where F: FnOnce(TyCtxt<'tcx>) -> R, { - ty::tls::enter_global(self.0, |tcx| f(tcx)) + ty::tls::enter_global(self.0, f) } pub fn print_stats(&mut self) { diff --git a/src/librustc_metadata/locator.rs b/src/librustc_metadata/locator.rs index 2f9be599ba94b..c1a95c094b10c 100644 --- a/src/librustc_metadata/locator.rs +++ b/src/librustc_metadata/locator.rs @@ -327,7 +327,7 @@ impl<'a> CrateLocator<'a> { .into_iter() .filter_map(|entry| entry.files()) .flatten() - .map(|location| PathBuf::from(location)) + .map(PathBuf::from) .collect() } else { // SVH being specified means this is a transitive dependency, diff --git a/src/librustc_metadata/rmeta/decoder.rs b/src/librustc_metadata/rmeta/decoder.rs index 2bf74fe272ec9..754bae0ddb813 100644 --- a/src/librustc_metadata/rmeta/decoder.rs +++ b/src/librustc_metadata/rmeta/decoder.rs @@ -509,14 +509,6 @@ impl<'a, 'tcx> SpecializedDecoder for DecodeContext<'a, 'tcx> { } } -impl SpecializedDecoder for DecodeContext<'_, '_> { - fn specialized_decode(&mut self) -> Result { - // FIXME(jseyfried): intercrate hygiene - - Ok(Ident::with_dummy_span(Symbol::decode(self)?)) - } -} - impl<'a, 'tcx> SpecializedDecoder for DecodeContext<'a, 'tcx> { fn specialized_decode(&mut self) -> Result { Fingerprint::decode_opaque(&mut self.opaque) @@ -663,15 +655,27 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { &self.raw_proc_macros.unwrap()[pos] } - fn item_name(&self, item_index: DefIndex) -> Symbol { + fn item_ident(&self, item_index: DefIndex, sess: &Session) -> Ident { if !self.is_proc_macro(item_index) { - self.def_key(item_index) + let name = self + .def_key(item_index) .disambiguated_data .data .get_opt_name() - .expect("no name in item_name") + .expect("no name in item_ident"); + let span = self + .root + .per_def + .ident_span + .get(self, item_index) + .map(|data| data.decode((self, sess))) + .unwrap_or_else(|| panic!("Missing ident span for {:?} ({:?})", name, item_index)); + Ident::new(name, span) } else { - Symbol::intern(self.raw_proc_macro(item_index).name()) + Ident::new( + Symbol::intern(self.raw_proc_macro(item_index).name()), + self.get_span(item_index, sess), + ) } } @@ -750,6 +754,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { kind: &EntryKind, index: DefIndex, parent_did: DefId, + sess: &Session, ) -> ty::VariantDef { let data = match kind { EntryKind::Variant(data) | EntryKind::Struct(data, _) | EntryKind::Union(data, _) => { @@ -771,7 +776,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { ty::VariantDef::new( tcx, - Ident::with_dummy_span(self.item_name(index)), + self.item_ident(index, sess), variant_did, ctor_did, data.discr, @@ -783,7 +788,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { .decode(self) .map(|index| ty::FieldDef { did: self.local_def_id(index), - ident: Ident::with_dummy_span(self.item_name(index)), + ident: self.item_ident(index, sess), vis: self.get_visibility(index), }) .collect(), @@ -812,10 +817,10 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { .get(self, item_id) .unwrap_or(Lazy::empty()) .decode(self) - .map(|index| self.get_variant(tcx, &self.kind(index), index, did)) + .map(|index| self.get_variant(tcx, &self.kind(index), index, did, tcx.sess)) .collect() } else { - std::iter::once(self.get_variant(tcx, &kind, item_id, did)).collect() + std::iter::once(self.get_variant(tcx, &kind, item_id, did, tcx.sess)).collect() }; tcx.alloc_adt_def(did, adt_kind, variants, repr) @@ -1007,7 +1012,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { if let Some(kind) = self.def_kind(child_index) { callback(Export { res: Res::Def(kind, self.local_def_id(child_index)), - ident: Ident::with_dummy_span(self.item_name(child_index)), + ident: self.item_ident(child_index, sess), vis: self.get_visibility(child_index), span: self .root @@ -1028,10 +1033,11 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { let def_key = self.def_key(child_index); let span = self.get_span(child_index, sess); - if let (Some(kind), Some(name)) = - (self.def_kind(child_index), def_key.disambiguated_data.data.get_opt_name()) - { - let ident = Ident::with_dummy_span(name); + if let (Some(kind), true) = ( + self.def_kind(child_index), + def_key.disambiguated_data.data.get_opt_name().is_some(), + ) { + let ident = self.item_ident(child_index, sess); let vis = self.get_visibility(child_index); let def_id = self.local_def_id(child_index); let res = Res::Def(kind, def_id); @@ -1138,10 +1144,10 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { } } - fn get_associated_item(&self, id: DefIndex) -> ty::AssocItem { + fn get_associated_item(&self, id: DefIndex, sess: &Session) -> ty::AssocItem { let def_key = self.def_key(id); let parent = self.local_def_id(def_key.parent.unwrap()); - let name = def_key.disambiguated_data.data.get_opt_name().unwrap(); + let ident = self.item_ident(id, sess); let (kind, container, has_self) = match self.kind(id) { EntryKind::AssocConst(container, _, _) => (ty::AssocKind::Const, container, false), @@ -1155,7 +1161,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { }; ty::AssocItem { - ident: Ident::with_dummy_span(name), + ident, kind, vis: self.get_visibility(id), defaultness: container.defaultness(), @@ -1219,7 +1225,7 @@ impl<'a, 'tcx> CrateMetadataRef<'a> { .get(self, id) .unwrap_or(Lazy::empty()) .decode(self) - .map(|index| respan(self.get_span(index, sess), self.item_name(index))) + .map(|index| respan(self.get_span(index, sess), self.item_ident(index, sess).name)) .collect() } diff --git a/src/librustc_metadata/rmeta/decoder/cstore_impl.rs b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs index 1b15646ff9b52..c2ea981caa90d 100644 --- a/src/librustc_metadata/rmeta/decoder/cstore_impl.rs +++ b/src/librustc_metadata/rmeta/decoder/cstore_impl.rs @@ -110,7 +110,7 @@ provide! { <'tcx> tcx, def_id, other, cdata, |child| result.push(child.res.def_id()), tcx.sess); tcx.arena.alloc_slice(&result) } - associated_item => { cdata.get_associated_item(def_id.index) } + associated_item => { cdata.get_associated_item(def_id.index, tcx.sess) } impl_trait_ref => { cdata.get_impl_trait(def_id.index, tcx) } impl_polarity => { cdata.get_impl_polarity(def_id.index) } coerce_unsized_info => { @@ -442,8 +442,8 @@ impl CStore { ) } - pub fn associated_item_cloned_untracked(&self, def: DefId) -> ty::AssocItem { - self.get_crate_data(def.krate).get_associated_item(def.index) + pub fn associated_item_cloned_untracked(&self, def: DefId, sess: &Session) -> ty::AssocItem { + self.get_crate_data(def.krate).get_associated_item(def.index, sess) } pub fn crate_source_untracked(&self, cnum: CrateNum) -> CrateSource { diff --git a/src/librustc_metadata/rmeta/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs index 5963047fc760d..af6486fb9cdd1 100644 --- a/src/librustc_metadata/rmeta/encoder.rs +++ b/src/librustc_metadata/rmeta/encoder.rs @@ -13,7 +13,7 @@ use rustc::traits::specialization_graph; use rustc::ty::codec::{self as ty_codec, TyEncoder}; use rustc::ty::layout::VariantIdx; use rustc::ty::{self, SymbolName, Ty, TyCtxt}; -use rustc_ast::ast; +use rustc_ast::ast::{self, Ident}; use rustc_ast::attr; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::FxHashMap; @@ -30,7 +30,7 @@ use rustc_index::vec::Idx; use rustc_serialize::{opaque, Encodable, Encoder, SpecializedEncoder}; use rustc_session::config::{self, CrateType}; use rustc_span::source_map::Spanned; -use rustc_span::symbol::{kw, sym, Ident, Symbol}; +use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::{self, ExternalSource, FileName, SourceFile, Span}; use std::hash::Hash; use std::num::NonZeroUsize; @@ -220,13 +220,6 @@ impl<'tcx> SpecializedEncoder for EncodeContext<'tcx> { } } -impl SpecializedEncoder for EncodeContext<'tcx> { - fn specialized_encode(&mut self, ident: &Ident) -> Result<(), Self::Error> { - // FIXME(jseyfried): intercrate hygiene - ident.name.encode(self) - } -} - impl<'tcx> SpecializedEncoder for EncodeContext<'tcx> { #[inline] fn specialized_encode(&mut self, def_id: &LocalDefId) -> Result<(), Self::Error> { @@ -633,6 +626,7 @@ impl EncodeContext<'tcx> { assert!(f.did.is_local()); f.did.index })); + self.encode_ident_span(def_id, variant.ident); self.encode_stability(def_id); self.encode_deprecation(def_id); self.encode_item_type(def_id); @@ -735,6 +729,7 @@ impl EncodeContext<'tcx> { record!(self.per_def.visibility[def_id] <- field.vis); record!(self.per_def.span[def_id] <- self.tcx.def_span(def_id)); record!(self.per_def.attributes[def_id] <- variant_data.fields()[field_index].attrs); + self.encode_ident_span(def_id, field.ident); self.encode_stability(def_id); self.encode_deprecation(def_id); self.encode_item_type(def_id); @@ -869,6 +864,7 @@ impl EncodeContext<'tcx> { record!(self.per_def.visibility[def_id] <- trait_item.vis); record!(self.per_def.span[def_id] <- ast_item.span); record!(self.per_def.attributes[def_id] <- ast_item.attrs); + self.encode_ident_span(def_id, ast_item.ident); self.encode_stability(def_id); self.encode_const_stability(def_id); self.encode_deprecation(def_id); @@ -952,6 +948,7 @@ impl EncodeContext<'tcx> { record!(self.per_def.visibility[def_id] <- impl_item.vis); record!(self.per_def.span[def_id] <- ast_item.span); record!(self.per_def.attributes[def_id] <- ast_item.attrs); + self.encode_ident_span(def_id, impl_item.ident); self.encode_stability(def_id); self.encode_const_stability(def_id); self.encode_deprecation(def_id); @@ -1058,6 +1055,8 @@ impl EncodeContext<'tcx> { debug!("EncodeContext::encode_info_for_item({:?})", def_id); + self.encode_ident_span(def_id, item.ident); + record!(self.per_def.kind[def_id] <- match item.kind { hir::ItemKind::Static(_, hir::Mutability::Mut, _) => EntryKind::MutStatic, hir::ItemKind::Static(_, hir::Mutability::Not, _) => EntryKind::ImmStatic, @@ -1284,6 +1283,7 @@ impl EncodeContext<'tcx> { record!(self.per_def.visibility[def_id] <- ty::Visibility::Public); record!(self.per_def.span[def_id] <- macro_def.span); record!(self.per_def.attributes[def_id] <- macro_def.attrs); + self.encode_ident_span(def_id, macro_def.ident); self.encode_stability(def_id); self.encode_deprecation(def_id); } @@ -1528,6 +1528,7 @@ impl EncodeContext<'tcx> { ty::Visibility::from_hir(&nitem.vis, nitem.hir_id, self.tcx)); record!(self.per_def.span[def_id] <- nitem.span); record!(self.per_def.attributes[def_id] <- nitem.attrs); + self.encode_ident_span(def_id, nitem.ident); self.encode_stability(def_id); self.encode_const_stability(def_id); self.encode_deprecation(def_id); @@ -1622,6 +1623,10 @@ impl EncodeContext<'tcx> { } } + fn encode_ident_span(&mut self, def_id: DefId, ident: Ident) { + record!(self.per_def.ident_span[def_id] <- ident.span); + } + /// In some cases, along with the item itself, we also /// encode some sub-items. Usually we want some info from the item /// so it's easier to do that here then to wait until we would encounter diff --git a/src/librustc_metadata/rmeta/mod.rs b/src/librustc_metadata/rmeta/mod.rs index 448c1610c1368..3a4214e916acb 100644 --- a/src/librustc_metadata/rmeta/mod.rs +++ b/src/librustc_metadata/rmeta/mod.rs @@ -256,6 +256,7 @@ define_per_def_tables! { kind: Table>, visibility: Table>, span: Table>, + ident_span: Table>, attributes: Table>, children: Table>, stability: Table>, diff --git a/src/librustc_mir/dataflow/generic/graphviz.rs b/src/librustc_mir/dataflow/generic/graphviz.rs index 36decf7f5a9c3..c15f2a726ee70 100644 --- a/src/librustc_mir/dataflow/generic/graphviz.rs +++ b/src/librustc_mir/dataflow/generic/graphviz.rs @@ -577,7 +577,7 @@ fn write_diff>( let mut clear = HybridBitSet::new_empty(len); // FIXME: Implement a lazy iterator over the symmetric difference of two bitsets. - for i in (0..len).map(|i| A::Idx::new(i)) { + for i in (0..len).map(A::Idx::new) { match (from.contains(i), to.contains(i)) { (false, true) => set.insert(i), (true, false) => clear.insert(i), diff --git a/src/librustc_mir/monomorphize/collector.rs b/src/librustc_mir/monomorphize/collector.rs index a592e8d9c05fe..cbd19f080eb9e 100644 --- a/src/librustc_mir/monomorphize/collector.rs +++ b/src/librustc_mir/monomorphize/collector.rs @@ -895,7 +895,7 @@ fn create_mono_items_for_vtable_methods<'tcx>( .unwrap() }) .filter(|&instance| should_monomorphize_locally(tcx, &instance)) - .map(|instance| create_fn_mono_item(instance)); + .map(create_fn_mono_item); output.extend(methods); } diff --git a/src/librustc_mir_build/hair/pattern/_match.rs b/src/librustc_mir_build/hair/pattern/_match.rs index 82810f356759d..89063a4227fa9 100644 --- a/src/librustc_mir_build/hair/pattern/_match.rs +++ b/src/librustc_mir_build/hair/pattern/_match.rs @@ -2066,7 +2066,7 @@ fn split_grouped_constructors<'p, 'tcx>( } intersection }) - .flat_map(|range| range_borders(range)); + .flat_map(range_borders); let ctor_borders = range_borders(ctor_range.clone()); let mut borders: Vec<_> = row_borders.chain(ctor_borders).collect(); borders.sort_unstable(); diff --git a/src/librustc_parse/lib.rs b/src/librustc_parse/lib.rs index 58db7d286e7e6..13fb85db84779 100644 --- a/src/librustc_parse/lib.rs +++ b/src/librustc_parse/lib.rs @@ -50,7 +50,7 @@ macro_rules! panictry_buffer { } pub fn parse_crate_from_file<'a>(input: &Path, sess: &'a ParseSess) -> PResult<'a, ast::Crate> { - let mut parser = new_parser_from_file(sess, input); + let mut parser = new_parser_from_file(sess, input, None); parser.parse_crate_mod() } @@ -58,7 +58,7 @@ pub fn parse_crate_attrs_from_file<'a>( input: &Path, sess: &'a ParseSess, ) -> PResult<'a, Vec> { - let mut parser = new_parser_from_file(sess, input); + let mut parser = new_parser_from_file(sess, input, None); parser.parse_inner_attributes() } @@ -106,8 +106,9 @@ pub fn maybe_new_parser_from_source_str( } /// Creates a new parser, handling errors as appropriate if the file doesn't exist. -pub fn new_parser_from_file<'a>(sess: &'a ParseSess, path: &Path) -> Parser<'a> { - source_file_to_parser(sess, file_to_source_file(sess, path, None)) +/// If a span is given, that is used on an error as the as the source of the problem. +pub fn new_parser_from_file<'a>(sess: &'a ParseSess, path: &Path, sp: Option) -> Parser<'a> { + source_file_to_parser(sess, file_to_source_file(sess, path, sp)) } /// Creates a new parser, returning buffered diagnostics if the file doesn't exist, @@ -120,20 +121,6 @@ pub fn maybe_new_parser_from_file<'a>( maybe_source_file_to_parser(sess, file) } -/// Given a session, a crate config, a path, and a span, add -/// the file at the given path to the `source_map`, and returns a parser. -/// On an error, uses the given span as the source of the problem. -pub fn new_sub_parser_from_file<'a>( - sess: &'a ParseSess, - path: &Path, - module_name: Option, - sp: Span, -) -> Parser<'a> { - let mut p = source_file_to_parser(sess, file_to_source_file(sess, path, Some(sp))); - p.root_module_name = module_name; - p -} - /// Given a `source_file` and config, returns a parser. fn source_file_to_parser(sess: &ParseSess, source_file: Lrc) -> Parser<'_> { panictry_buffer!(&sess.span_diagnostic, maybe_source_file_to_parser(sess, source_file)) diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs index bb6793d08aa27..b987813e38d98 100644 --- a/src/librustc_parse/parser/mod.rs +++ b/src/librustc_parse/parser/mod.rs @@ -88,10 +88,6 @@ pub struct Parser<'a> { /// The previous token. pub prev_token: Token, restrictions: Restrictions, - /// Name of the root module this parser originated from. If `None`, then the - /// name is not known. This does not change while the parser is descending - /// into modules, and sub-parsers have new values for this name. - pub root_module_name: Option, expected_tokens: Vec, token_cursor: TokenCursor, desugar_doc_comments: bool, @@ -350,7 +346,6 @@ impl<'a> Parser<'a> { token: Token::dummy(), prev_token: Token::dummy(), restrictions: Restrictions::empty(), - root_module_name: None, expected_tokens: Vec::new(), token_cursor: TokenCursor { frame: TokenCursorFrame::new(DelimSpan::dummy(), token::NoDelim, &tokens), diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index a3510737b7edc..d680b9e002678 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1038,7 +1038,7 @@ impl<'a, 'tcx> NamePrivacyVisitor<'a, 'tcx> { def.variant_descr(), self.tcx.def_path_str(def.did) ) - .span_label(span, format!("field `{}` is private", field.ident)) + .span_label(span, "private field") .emit(); } } @@ -1180,7 +1180,11 @@ impl<'a, 'tcx> TypePrivacyVisitor<'a, 'tcx> { fn check_def_id(&mut self, def_id: DefId, kind: &str, descr: &dyn fmt::Display) -> bool { let is_error = !self.item_is_accessible(def_id); if is_error { - self.tcx.sess.span_err(self.span, &format!("{} `{}` is private", kind, descr)); + self.tcx + .sess + .struct_span_err(self.span, &format!("{} `{}` is private", kind, descr)) + .span_label(self.span, &format!("private {}", kind)) + .emit(); } is_error } @@ -1313,8 +1317,12 @@ impl<'a, 'tcx> Visitor<'tcx> for TypePrivacyVisitor<'a, 'tcx> { hir::QPath::Resolved(_, ref path) => path.to_string(), hir::QPath::TypeRelative(_, ref segment) => segment.ident.to_string(), }; - let msg = format!("{} `{}` is private", kind.descr(def_id), name); - self.tcx.sess.span_err(span, &msg); + let kind = kind.descr(def_id); + self.tcx + .sess + .struct_span_err(span, &format!("{} `{}` is private", kind, name)) + .span_label(span, &format!("private {}", kind)) + .emit(); return; } } diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 77d6e4560ab93..d29ec83bfa09a 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -904,7 +904,10 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> { self.insert_field_names(def_id, field_names); } Res::Def(DefKind::AssocFn, def_id) => { - if cstore.associated_item_cloned_untracked(def_id).method_has_self_argument { + if cstore + .associated_item_cloned_untracked(def_id, self.r.session) + .method_has_self_argument + { self.r.has_self.insert(def_id); } } diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 9e5ff32391486..9cd066b629c07 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -796,7 +796,7 @@ impl<'a> Resolver<'a> { }); if let Some(span) = def_span { err.span_label( - span, + self.session.source_map().def_span(span), &format!( "similarly named {} `{}` defined here", suggestion.res.descr(), @@ -951,7 +951,7 @@ impl<'a> Resolver<'a> { let descr = get_descr(binding); let mut err = struct_span_err!(self.session, ident.span, E0603, "{} `{}` is private", descr, ident); - err.span_label(ident.span, &format!("this {} is private", descr)); + err.span_label(ident.span, &format!("private {}", descr)); if let Some(span) = ctor_fields_span { err.span_label(span, "a constructor is private if any of the fields is private"); } diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs index e1256551e24da..a8d4e7ce5f6ba 100644 --- a/src/librustc_resolve/late/diagnostics.rs +++ b/src/librustc_resolve/late/diagnostics.rs @@ -506,10 +506,10 @@ impl<'a> LateResolutionVisitor<'a, '_, '_> { match (res, source) { (Res::Def(DefKind::Macro(MacroKind::Bang), _), _) => { - err.span_suggestion( - span, + err.span_suggestion_verbose( + span.shrink_to_hi(), "use `!` to invoke the macro", - format!("{}!", path_str), + "!".to_string(), Applicability::MaybeIncorrect, ); if path_str == "try" && span.rust_2015() { diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 8d1a39eab89d8..a80c3b72044ef 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1148,7 +1148,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> { let sub_span = path.segments.last().unwrap().ident.span; if !self.span.filter_generated(sub_span) { - let ref_id = self.lookup_def_id(id).map(|id| id_from_def_id(id)); + let ref_id = self.lookup_def_id(id).map(id_from_def_id); let alias_span = alias.map(|i| self.span_from_span(i.span)); let span = self.span_from_span(sub_span); self.dumper.import( diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index bb717981a3be7..024633c3b3dec 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -326,7 +326,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> { .as_ref() .and_then(|t| self.lookup_def_id(t.ref_id)) .map(id_from_def_id) - .unwrap_or_else(|| null_id()), + .unwrap_or_else(null_id), }, Impl { id: impl_id, @@ -487,9 +487,9 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> { qualname, // FIXME you get better data here by using the visitor. value: String::new(), - parent: parent_scope.map(|id| id_from_def_id(id)), + parent: parent_scope.map(id_from_def_id), children: vec![], - decl_id: decl_id.map(|id| id_from_def_id(id)), + decl_id: decl_id.map(id_from_def_id), docs, sig: None, attributes: lower_attributes(attributes, self), @@ -541,7 +541,7 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> { .tcx .find_field_index(ident, variant) .map(|index| id_from_def_id(variant.fields[index].did)) - .unwrap_or_else(|| null_id()), + .unwrap_or_else(null_id), })) } ty::Tuple(..) => None, @@ -590,14 +590,11 @@ impl<'l, 'tcx> SaveContext<'l, 'tcx> { Some(Data::RefData(Ref { kind: RefKind::Function, span, - ref_id: def_id - .or(decl_id) - .map(|id| id_from_def_id(id)) - .unwrap_or_else(|| null_id()), + ref_id: def_id.or(decl_id).map(id_from_def_id).unwrap_or_else(|| null_id()), })) } ast::ExprKind::Path(_, ref path) => { - self.get_path_data(expr.id, path).map(|d| Data::RefData(d)) + self.get_path_data(expr.id, path).map(Data::RefData) } _ => { // FIXME @@ -1075,7 +1072,7 @@ fn id_from_def_id(id: DefId) -> rls_data::Id { fn id_from_node_id(id: NodeId, scx: &SaveContext<'_, '_>) -> rls_data::Id { let def_id = scx.tcx.hir().opt_local_def_id_from_node_id(id); - def_id.map(|id| id_from_def_id(id)).unwrap_or_else(|| { + def_id.map(id_from_def_id).unwrap_or_else(|| { // Create a *fake* `DefId` out of a `NodeId` by subtracting the `NodeId` // out of the maximum u32 value. This will work unless you have *billions* // of definitions in a single crate (very unlikely to actually happen). diff --git a/src/librustc_session/config.rs b/src/librustc_session/config.rs index f16e4ca93d80a..6c4d70c09a39a 100644 --- a/src/librustc_session/config.rs +++ b/src/librustc_session/config.rs @@ -1310,7 +1310,7 @@ fn select_incremental_path( (None, Some(path)) => Some(path), (None, None) => None, } - .map(|m| PathBuf::from(m)) + .map(PathBuf::from) } fn collect_print_requests( diff --git a/src/librustc_trait_selection/traits/error_reporting/mod.rs b/src/librustc_trait_selection/traits/error_reporting/mod.rs index ef62958a3f7d0..d001ced3e7ea1 100644 --- a/src/librustc_trait_selection/traits/error_reporting/mod.rs +++ b/src/librustc_trait_selection/traits/error_reporting/mod.rs @@ -815,11 +815,11 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // For example, if `expected_args_length` is 2, suggest `|_, _|`. if found_args.is_empty() && is_closure { let underscores = vec!["_"; expected_args.len()].join(", "); - err.span_suggestion( + err.span_suggestion_verbose( pipe_span, &format!( "consider changing the closure to take and ignore the expected argument{}", - if expected_args.len() < 2 { "" } else { "s" } + pluralize!(expected_args.len()) ), format!("|{}|", underscores), Applicability::MachineApplicable, @@ -833,7 +833,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { .map(|(name, _)| name.to_owned()) .collect::>() .join(", "); - err.span_suggestion( + err.span_suggestion_verbose( found_span, "change the closure to take multiple arguments instead of a single tuple", format!("|{}|", sugg), @@ -870,7 +870,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { String::new() }, ); - err.span_suggestion( + err.span_suggestion_verbose( found_span, "change the closure to accept a tuple instead of individual arguments", sugg, @@ -1420,15 +1420,14 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> { // | // = note: cannot resolve `_: Tt` - err.span_suggestion( - span, + err.span_suggestion_verbose( + span.shrink_to_hi(), &format!( "consider specifying the type argument{} in the function call", - if generics.params.len() > 1 { "s" } else { "" }, + pluralize!(generics.params.len()), ), format!( - "{}::<{}>", - snippet, + "::<{}>", generics .params .iter() @@ -1590,7 +1589,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> { [] => (span.shrink_to_hi(), ":"), [.., bound] => (bound.span().shrink_to_hi(), " + "), }; - err.span_suggestion( + err.span_suggestion_verbose( span, "consider relaxing the implicit `Sized` restriction", format!("{} ?Sized", separator), diff --git a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs index 40eb893e6daa8..fdb5def193031 100644 --- a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs +++ b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs @@ -390,7 +390,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { } let hir = self.tcx.hir(); // Get the name of the callable and the arguments to be used in the suggestion. - let snippet = match hir.get_if_local(def_id) { + let (snippet, sugg) = match hir.get_if_local(def_id) { Some(hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(_, decl, _, span, ..), .. @@ -401,7 +401,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { None => return, }; let args = decl.inputs.iter().map(|_| "_").collect::>().join(", "); - format!("{}({})", name, args) + let sugg = format!("({})", args); + (format!("{}{}", name, sugg), sugg) } Some(hir::Node::Item(hir::Item { ident, @@ -422,7 +423,8 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { }) .collect::>() .join(", "); - format!("{}({})", ident, args) + let sugg = format!("({})", args); + (format!("{}{}", ident, sugg), sugg) } _ => return, }; @@ -431,10 +433,10 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { // an argument, the `obligation.cause.span` points at the expression // of the argument, so we can provide a suggestion. This is signaled // by `points_at_arg`. Otherwise, we give a more general note. - err.span_suggestion( - obligation.cause.span, + err.span_suggestion_verbose( + obligation.cause.span.shrink_to_hi(), &msg, - snippet, + sugg, Applicability::HasPlaceholders, ); } else { @@ -619,7 +621,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { .source_map() .span_take_while(span, |c| c.is_whitespace() || *c == '&'); if points_at_arg && mutability == hir::Mutability::Not && refs_number > 0 { - err.span_suggestion( + err.span_suggestion_verbose( sp, "consider changing this borrow's mutability", "&mut ".to_string(), diff --git a/src/librustc_trait_selection/traits/fulfill.rs b/src/librustc_trait_selection/traits/fulfill.rs index 5def77ce7324c..260363a5d1fb5 100644 --- a/src/librustc_trait_selection/traits/fulfill.rs +++ b/src/librustc_trait_selection/traits/fulfill.rs @@ -131,7 +131,7 @@ impl<'a, 'tcx> FulfillmentContext<'tcx> { // FIXME: if we kept the original cache key, we could mark projection // obligations as complete for the projection cache here. - errors.extend(outcome.errors.into_iter().map(|e| to_fulfillment_error(e))); + errors.extend(outcome.errors.into_iter().map(to_fulfillment_error)); // If nothing new was added, no need to keep looping. if outcome.stalled { @@ -214,7 +214,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> { .predicates .to_errors(CodeAmbiguity) .into_iter() - .map(|e| to_fulfillment_error(e)) + .map(to_fulfillment_error) .collect(); if errors.is_empty() { Ok(()) } else { Err(errors) } } diff --git a/src/librustc_trait_selection/traits/object_safety.rs b/src/librustc_trait_selection/traits/object_safety.rs index 452f965014bff..5cc1da045fc37 100644 --- a/src/librustc_trait_selection/traits/object_safety.rs +++ b/src/librustc_trait_selection/traits/object_safety.rs @@ -39,7 +39,7 @@ pub fn astconv_object_safety_violations( let violations = traits::supertrait_def_ids(tcx, trait_def_id) .map(|def_id| predicates_reference_self(tcx, def_id, true)) .filter(|spans| !spans.is_empty()) - .map(|spans| ObjectSafetyViolation::SupertraitSelf(spans)) + .map(ObjectSafetyViolation::SupertraitSelf) .collect(); debug!("astconv_object_safety_violations(trait_def_id={:?}) = {:?}", trait_def_id, violations); diff --git a/src/librustc_trait_selection/traits/select.rs b/src/librustc_trait_selection/traits/select.rs index ca169d550e782..080eb8b3f3a00 100644 --- a/src/librustc_trait_selection/traits/select.rs +++ b/src/librustc_trait_selection/traits/select.rs @@ -2947,13 +2947,9 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let existential_predicates = data_a.map_bound(|data_a| { let iter = data_a .principal() - .map(|x| ty::ExistentialPredicate::Trait(x)) + .map(ty::ExistentialPredicate::Trait) .into_iter() - .chain( - data_a - .projection_bounds() - .map(|x| ty::ExistentialPredicate::Projection(x)), - ) + .chain(data_a.projection_bounds().map(ty::ExistentialPredicate::Projection)) .chain(data_b.auto_traits().map(ty::ExistentialPredicate::AutoTrait)); tcx.mk_existential_predicates(iter) }); diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 3ee6d5df7356b..e812fa81e6252 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1452,8 +1452,13 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { .expect("missing associated type"); if !assoc_ty.vis.is_accessible_from(def_scope, tcx) { - let msg = format!("associated type `{}` is private", binding.item_name); - tcx.sess.span_err(binding.span, &msg); + tcx.sess + .struct_span_err( + binding.span, + &format!("associated type `{}` is private", binding.item_name), + ) + .span_label(binding.span, "private associated type") + .emit(); } tcx.check_stability(assoc_ty.def_id, Some(hir_ref_id), binding.span); @@ -1693,9 +1698,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { }; // Erase the `dummy_self` (`trait_object_dummy_self`) used above. - let existential_trait_refs = regular_traits - .iter() - .map(|i| i.trait_ref().map_bound(|trait_ref| trait_ref_to_existential(trait_ref))); + let existential_trait_refs = + regular_traits.iter().map(|i| i.trait_ref().map_bound(trait_ref_to_existential)); let existential_projections = bounds.projection_bounds.iter().map(|(bound, _)| { bound.map_bound(|b| { let trait_ref = trait_ref_to_existential(b.projection_ty.trait_ref(tcx)); @@ -2316,8 +2320,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { let kind = DefKind::AssocTy; if !item.vis.is_accessible_from(def_scope, tcx) { - let msg = format!("{} `{}` is private", kind.descr(item.def_id), assoc_ident); - tcx.sess.span_err(span, &msg); + let kind = kind.descr(item.def_id); + let msg = format!("{} `{}` is private", kind, assoc_ident); + tcx.sess + .struct_span_err(span, &msg) + .span_label(span, &format!("private {}", kind)) + .emit(); } tcx.check_stability(item.def_id, Some(hir_ref_id), span); diff --git a/src/librustc_typeck/check/compare_method.rs b/src/librustc_typeck/check/compare_method.rs index 6178158e4e504..f666ef72d5278 100644 --- a/src/librustc_typeck/check/compare_method.rs +++ b/src/librustc_typeck/check/compare_method.rs @@ -677,7 +677,7 @@ fn compare_number_of_generics<'tcx>( impl_count, kind, pluralize!(impl_count), - suffix.unwrap_or_else(|| String::new()), + suffix.unwrap_or_else(String::new), ), ); } diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs index 7203980b2388f..b42f74cced98e 100644 --- a/src/librustc_typeck/check/expr.rs +++ b/src/librustc_typeck/check/expr.rs @@ -1580,13 +1580,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }; let mut err = struct_span_err!( self.tcx().sess, - expr.span, + field.span, E0616, "field `{}` of {} `{}` is private", field, kind_name, struct_path ); + err.span_label(field.span, "private field"); // Also check if an accessible method exists, which is often what is meant. if self.method_exists(field, expr_t, expr.hir_id, false) && !self.expr_in_place(expr.hir_id) { @@ -1611,7 +1612,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { field, expr_t ); - + err.span_label(field.span, "method, not a field"); if !self.expr_in_place(expr.hir_id) { self.suggest_method_call( &mut err, diff --git a/src/librustc_typeck/check/method/mod.rs b/src/librustc_typeck/check/method/mod.rs index 7068e3c521c81..962f9807546ac 100644 --- a/src/librustc_typeck/check/method/mod.rs +++ b/src/librustc_typeck/check/method/mod.rs @@ -137,7 +137,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self_ty: Ty<'tcx>, call_expr: &hir::Expr<'_>, ) { - let has_params = self + let params = self .probe_for_name( method_name.span, probe::Mode::MethodCall, @@ -147,26 +147,20 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { call_expr.hir_id, ProbeScope::TraitsInScope, ) - .and_then(|pick| { + .map(|pick| { let sig = self.tcx.fn_sig(pick.item.def_id); - Ok(sig.inputs().skip_binder().len() > 1) - }); + sig.inputs().skip_binder().len().saturating_sub(1) + }) + .unwrap_or(0); // Account for `foo.bar`; - let sugg_span = method_name.span.with_hi(call_expr.span.hi()); - let snippet = self - .tcx - .sess - .source_map() - .span_to_snippet(sugg_span) - .unwrap_or_else(|_| method_name.to_string()); - let (suggestion, applicability) = if has_params.unwrap_or_default() { - (format!("{}(...)", snippet), Applicability::HasPlaceholders) - } else { - (format!("{}()", snippet), Applicability::MaybeIncorrect) - }; + let sugg_span = call_expr.span.shrink_to_hi(); + let (suggestion, applicability) = ( + format!("({})", (0..params).map(|_| "_").collect::>().join(", ")), + if params > 0 { Applicability::HasPlaceholders } else { Applicability::MaybeIncorrect }, + ); - err.span_suggestion(sugg_span, msg, suggestion, applicability); + err.span_suggestion_verbose(sugg_span, msg, suggestion, applicability); } /// Performs method lookup. If lookup is successful, it will return the callee diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index 061433bcf6515..68996f5aaf973 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -758,25 +758,27 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { MethodError::Ambiguity(sources) => { let mut err = struct_span_err!( self.sess(), - span, + item_name.span, E0034, "multiple applicable items in scope" ); - err.span_label(span, format!("multiple `{}` found", item_name)); + err.span_label(item_name.span, format!("multiple `{}` found", item_name)); report_candidates(span, &mut err, sources, sugg_span); err.emit(); } MethodError::PrivateMatch(kind, def_id, out_of_scope_traits) => { + let kind = kind.descr(def_id); let mut err = struct_span_err!( self.tcx.sess, - span, + item_name.span, E0624, "{} `{}` is private", - kind.descr(def_id), + kind, item_name ); + err.span_label(item_name.span, &format!("private {}", kind)); self.suggest_valid_traits(&mut err, out_of_scope_traits); err.emit(); } diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 32f0f578d057f..3006ecc5d588c 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -4939,15 +4939,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { } _ => {} } - if let Ok(code) = self.sess().source_map().span_to_snippet(expr.span) { - err.span_suggestion( - expr.span, - &format!("use parentheses to {}", msg), - format!("{}({})", code, sugg_call), - applicability, - ); - return true; - } + err.span_suggestion_verbose( + expr.span.shrink_to_hi(), + &format!("use parentheses to {}", msg), + format!("({})", sugg_call), + applicability, + ); + return true; } false } diff --git a/src/librustc_typeck/check/pat.rs b/src/librustc_typeck/check/pat.rs index 0f3884de84e12..0d38fa98bd7f8 100644 --- a/src/librustc_typeck/check/pat.rs +++ b/src/librustc_typeck/check/pat.rs @@ -753,17 +753,21 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { res.descr(), ), ); - let (msg, sugg) = match parent_pat { - Some(Pat { kind: hir::PatKind::Struct(..), .. }) => ( - "bind the struct field to a different name instead", - format!("{}: other_{}", ident, ident.as_str().to_lowercase()), - ), - _ => ( - "introduce a new binding instead", - format!("other_{}", ident.as_str().to_lowercase()), - ), + match parent_pat { + Some(Pat { kind: hir::PatKind::Struct(..), .. }) => { + e.span_suggestion_verbose( + ident.span.shrink_to_hi(), + "bind the struct field to a different name instead", + format!(": other_{}", ident.as_str().to_lowercase()), + Applicability::HasPlaceholders, + ); + } + _ => { + let msg = "introduce a new binding instead"; + let sugg = format!("other_{}", ident.as_str().to_lowercase()); + e.span_suggestion(ident.span, msg, sugg, Applicability::HasPlaceholders); + } }; - e.span_suggestion(ident.span, msg, sugg, Applicability::HasPlaceholders); } } e.emit(); diff --git a/src/test/ui-fulldeps/mod_dir_path_canonicalized.rs b/src/test/ui-fulldeps/mod_dir_path_canonicalized.rs index 1046355a3433f..3c5738f574c26 100644 --- a/src/test/ui-fulldeps/mod_dir_path_canonicalized.rs +++ b/src/test/ui-fulldeps/mod_dir_path_canonicalized.rs @@ -28,6 +28,6 @@ fn parse() { let path = Path::new(file!()); let path = path.canonicalize().unwrap(); - let mut parser = new_parser_from_file(&parse_session, &path); + let mut parser = new_parser_from_file(&parse_session, &path, None); let _ = parser.parse_crate_mod(); } diff --git a/src/test/ui/associated-const/associated-const-ambiguity-report.stderr b/src/test/ui/associated-const/associated-const-ambiguity-report.stderr index 92a8d19021a2c..c5e32afbbce40 100644 --- a/src/test/ui/associated-const/associated-const-ambiguity-report.stderr +++ b/src/test/ui/associated-const/associated-const-ambiguity-report.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/associated-const-ambiguity-report.rs:17:16 + --> $DIR/associated-const-ambiguity-report.rs:17:23 | LL | const X: i32 = ::ID; - | ^^^^^^^^^ multiple `ID` found + | ^^ multiple `ID` found | note: candidate #1 is defined in an impl of the trait `Foo` for the type `i32` --> $DIR/associated-const-ambiguity-report.rs:10:5 diff --git a/src/test/ui/associated-const/associated-const-private-impl.stderr b/src/test/ui/associated-const/associated-const-private-impl.stderr index 7af55174b1905..1b9d7ac7e6c3f 100644 --- a/src/test/ui/associated-const/associated-const-private-impl.stderr +++ b/src/test/ui/associated-const/associated-const-private-impl.stderr @@ -1,8 +1,8 @@ error[E0624]: associated constant `ID` is private - --> $DIR/associated-const-private-impl.rs:13:19 + --> $DIR/associated-const-private-impl.rs:13:30 | LL | assert_eq!(1, bar1::Foo::ID); - | ^^^^^^^^^^^^^ + | ^^ private associated constant error: aborting due to previous error diff --git a/src/test/ui/const-generics/issues/issue-70125-1.rs b/src/test/ui/const-generics/issues/issue-70125-1.rs new file mode 100644 index 0000000000000..8b933c078ff26 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70125-1.rs @@ -0,0 +1,19 @@ +// run-pass +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +const L: usize = 4; + +pub trait Print { + fn print(&self) -> usize { + N + } +} + +pub struct Printer; +impl Print for Printer {} + +fn main() { + let p = Printer; + assert_eq!(p.print(), 4); +} diff --git a/src/test/ui/const-generics/issues/issue-70125-1.stderr b/src/test/ui/const-generics/issues/issue-70125-1.stderr new file mode 100644 index 0000000000000..f28f58cf5ce4d --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70125-1.stderr @@ -0,0 +1,8 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/issue-70125-1.rs:2:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + diff --git a/src/test/ui/const-generics/issues/issue-70125-2.rs b/src/test/ui/const-generics/issues/issue-70125-2.rs new file mode 100644 index 0000000000000..ea7a68c2f93d9 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70125-2.rs @@ -0,0 +1,16 @@ +// run-pass + +#![feature(const_generics)] +//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash + +fn main() { + <()>::foo(); +} + +trait Foo { + fn foo() -> usize { + X + } +} + +impl Foo<{3}> for () {} diff --git a/src/test/ui/const-generics/issues/issue-70125-2.stderr b/src/test/ui/const-generics/issues/issue-70125-2.stderr new file mode 100644 index 0000000000000..664aa7ba45161 --- /dev/null +++ b/src/test/ui/const-generics/issues/issue-70125-2.stderr @@ -0,0 +1,8 @@ +warning: the feature `const_generics` is incomplete and may cause the compiler to crash + --> $DIR/issue-70125-2.rs:3:12 + | +LL | #![feature(const_generics)] + | ^^^^^^^^^^^^^^ + | + = note: `#[warn(incomplete_features)]` on by default + diff --git a/src/test/ui/copy-a-resource.stderr b/src/test/ui/copy-a-resource.stderr index c95e8d239d2b9..a5c961a061acb 100644 --- a/src/test/ui/copy-a-resource.stderr +++ b/src/test/ui/copy-a-resource.stderr @@ -6,6 +6,14 @@ LL | struct Foo { ... LL | let _y = x.clone(); | ^^^^^ method not found in `Foo` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc` here + | the method is available for `std::rc::Rc` here | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: diff --git a/src/test/ui/derives/derive-assoc-type-not-impl.stderr b/src/test/ui/derives/derive-assoc-type-not-impl.stderr index c4c85773fbc1d..be446feb847eb 100644 --- a/src/test/ui/derives/derive-assoc-type-not-impl.stderr +++ b/src/test/ui/derives/derive-assoc-type-not-impl.stderr @@ -12,6 +12,14 @@ LL | struct NotClone; ... LL | Bar:: { x: 1 }.clone(); | ^^^^^ method not found in `Bar` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc>` here + | the method is available for `std::rc::Rc>` here | = note: the method `clone` exists but the following trait bounds were not satisfied: `NotClone: std::clone::Clone` diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index f5b41cd1cc0bb..8bf245648f84b 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -3,6 +3,14 @@ error[E0004]: non-exhaustive patterns: `None` and `Some(_)` not covered | LL | match x { } | ^ patterns `None` and `Some(_)` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | None, + | ---- not covered +... +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ---- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index 577c6e886d523..5028405e731a3 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -3,6 +3,11 @@ error[E0005]: refutable pattern in local binding: `None` not covered | LL | let Some(y) = x; | ^^^^^^^ pattern `None` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | None, + | ---- not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html diff --git a/src/test/ui/error-codes/E0034.stderr b/src/test/ui/error-codes/E0034.stderr index 6db2ef5051d83..7977e529a11a6 100644 --- a/src/test/ui/error-codes/E0034.stderr +++ b/src/test/ui/error-codes/E0034.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/E0034.rs:20:5 + --> $DIR/E0034.rs:20:11 | LL | Test::foo() - | ^^^^^^^^^ multiple `foo` found + | ^^^ multiple `foo` found | note: candidate #1 is defined in an impl of the trait `Trait1` for the type `Test` --> $DIR/E0034.rs:12:5 diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index f356a5b954d6d..e25fb09f15757 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -3,6 +3,11 @@ error[E0005]: refutable pattern in `for` loop binding: `None` not covered | LL | for Some(x) in xs {} | ^^^^^^^ pattern `None` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | None, + | ---- not covered error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0423.stderr b/src/test/ui/error-codes/E0423.stderr index 09792845d162c..a985e963e5726 100644 --- a/src/test/ui/error-codes/E0423.stderr +++ b/src/test/ui/error-codes/E0423.stderr @@ -29,20 +29,17 @@ LL | for _ in (std::ops::Range { start: 0, end: 10 }) {} error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo` --> $DIR/E0423.rs:4:13 | -LL | struct Foo { a: bool }; - | ---------------------- `Foo` defined here +LL | struct Foo { a: bool }; + | ---------------------- `Foo` defined here LL | -LL | let f = Foo(); - | ^^^ - | | - | did you mean `Foo { /* fields */ }`? - | help: a function with a similar name exists (notice the capitalization): `foo` +LL | let f = Foo(); + | ^^^ + | | + | did you mean `Foo { /* fields */ }`? + | help: a function with a similar name exists (notice the capitalization): `foo` ... -LL | / fn foo() { -LL | | for _ in std::ops::Range { start: 0, end: 10 } {} -LL | | -LL | | } - | |_- similarly named function `foo` defined here +LL | fn foo() { + | -------- similarly named function `foo` defined here error[E0423]: expected value, found struct `T` --> $DIR/E0423.rs:14:8 diff --git a/src/test/ui/error-codes/E0451.stderr b/src/test/ui/error-codes/E0451.stderr index 655f3a98d7f09..bb92c23e0f600 100644 --- a/src/test/ui/error-codes/E0451.stderr +++ b/src/test/ui/error-codes/E0451.stderr @@ -2,13 +2,13 @@ error[E0451]: field `b` of struct `bar::Foo` is private --> $DIR/E0451.rs:14:21 | LL | let bar::Foo{a, b} = foo; - | ^ field `b` is private + | ^ private field error[E0451]: field `b` of struct `bar::Foo` is private --> $DIR/E0451.rs:18:29 | LL | let f = bar::Foo{ a: 0, b: 0 }; - | ^^^^ field `b` is private + | ^^^^ private field error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0603.stderr b/src/test/ui/error-codes/E0603.stderr index 724d04954a3c7..ee902584f56da 100644 --- a/src/test/ui/error-codes/E0603.stderr +++ b/src/test/ui/error-codes/E0603.stderr @@ -2,7 +2,7 @@ error[E0603]: constant `PRIVATE` is private --> $DIR/E0603.rs:6:17 | LL | SomeModule::PRIVATE; - | ^^^^^^^ this constant is private + | ^^^^^^^ private constant | note: the constant `PRIVATE` is defined here --> $DIR/E0603.rs:2:5 diff --git a/src/test/ui/error-codes/E0615.stderr b/src/test/ui/error-codes/E0615.stderr index 772058719ae04..1bc047dd356e0 100644 --- a/src/test/ui/error-codes/E0615.stderr +++ b/src/test/ui/error-codes/E0615.stderr @@ -2,7 +2,12 @@ error[E0615]: attempted to take value of method `method` on type `Foo` --> $DIR/E0615.rs:11:7 | LL | f.method; - | ^^^^^^ help: use parentheses to call the method: `method()` + | ^^^^^^ method, not a field + | +help: use parentheses to call the method + | +LL | f.method(); + | ^^ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0616.stderr b/src/test/ui/error-codes/E0616.stderr index 556e5db10a944..422bf687e7bd4 100644 --- a/src/test/ui/error-codes/E0616.stderr +++ b/src/test/ui/error-codes/E0616.stderr @@ -1,8 +1,8 @@ error[E0616]: field `x` of struct `a::Foo` is private - --> $DIR/E0616.rs:13:5 + --> $DIR/E0616.rs:13:7 | LL | f.x; - | ^^^ + | ^ private field error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0624.stderr b/src/test/ui/error-codes/E0624.stderr index 65256c8dd2dd6..1d3336fb181a0 100644 --- a/src/test/ui/error-codes/E0624.stderr +++ b/src/test/ui/error-codes/E0624.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `method` is private --> $DIR/E0624.rs:11:9 | LL | foo.method(); - | ^^^^^^ + | ^^^^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/error-codes/ex-E0611.stderr b/src/test/ui/error-codes/ex-E0611.stderr index 8bd00a392d4f8..2d22bb395140b 100644 --- a/src/test/ui/error-codes/ex-E0611.stderr +++ b/src/test/ui/error-codes/ex-E0611.stderr @@ -1,8 +1,8 @@ error[E0616]: field `0` of struct `a::Foo` is private - --> $DIR/ex-E0611.rs:11:4 + --> $DIR/ex-E0611.rs:11:6 | LL | y.0; - | ^^^ + | ^ private field error: aborting due to previous error diff --git a/src/test/ui/error-festival.stderr b/src/test/ui/error-festival.stderr index fb5290bf64eb4..7f524230ef006 100644 --- a/src/test/ui/error-festival.stderr +++ b/src/test/ui/error-festival.stderr @@ -8,7 +8,7 @@ error[E0603]: constant `FOO` is private --> $DIR/error-festival.rs:22:10 | LL | foo::FOO; - | ^^^ this constant is private + | ^^^ private constant | note: the constant `FOO` is defined here --> $DIR/error-festival.rs:7:5 diff --git a/src/test/ui/explore-issue-38412.stderr b/src/test/ui/explore-issue-38412.stderr index 94a2cfe013d19..1855c0b14379d 100644 --- a/src/test/ui/explore-issue-38412.stderr +++ b/src/test/ui/explore-issue-38412.stderr @@ -17,22 +17,22 @@ LL | r.a_unstable_undeclared_pub; = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable error[E0616]: field `b_crate` of struct `pub_and_stability::Record` is private - --> $DIR/explore-issue-38412.rs:31:5 + --> $DIR/explore-issue-38412.rs:31:7 | LL | r.b_crate; - | ^^^^^^^^^ + | ^^^^^^^ private field error[E0616]: field `c_mod` of struct `pub_and_stability::Record` is private - --> $DIR/explore-issue-38412.rs:32:5 + --> $DIR/explore-issue-38412.rs:32:7 | LL | r.c_mod; - | ^^^^^^^ + | ^^^^^ private field error[E0616]: field `d_priv` of struct `pub_and_stability::Record` is private - --> $DIR/explore-issue-38412.rs:33:5 + --> $DIR/explore-issue-38412.rs:33:7 | LL | r.d_priv; - | ^^^^^^^^ + | ^^^^^^ private field error[E0658]: use of unstable library feature 'unstable_undeclared' --> $DIR/explore-issue-38412.rs:37:5 @@ -44,22 +44,22 @@ LL | t.2; = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable error[E0616]: field `3` of struct `pub_and_stability::Tuple` is private - --> $DIR/explore-issue-38412.rs:38:5 + --> $DIR/explore-issue-38412.rs:38:7 | LL | t.3; - | ^^^ + | ^ private field error[E0616]: field `4` of struct `pub_and_stability::Tuple` is private - --> $DIR/explore-issue-38412.rs:39:5 + --> $DIR/explore-issue-38412.rs:39:7 | LL | t.4; - | ^^^ + | ^ private field error[E0616]: field `5` of struct `pub_and_stability::Tuple` is private - --> $DIR/explore-issue-38412.rs:40:5 + --> $DIR/explore-issue-38412.rs:40:7 | LL | t.5; - | ^^^ + | ^ private field error[E0658]: use of unstable library feature 'unstable_undeclared' --> $DIR/explore-issue-38412.rs:44:7 @@ -83,19 +83,19 @@ error[E0624]: associated function `pub_crate` is private --> $DIR/explore-issue-38412.rs:50:7 | LL | r.pub_crate(); - | ^^^^^^^^^ + | ^^^^^^^^^ private associated function error[E0624]: associated function `pub_mod` is private --> $DIR/explore-issue-38412.rs:51:7 | LL | r.pub_mod(); - | ^^^^^^^ + | ^^^^^^^ private associated function error[E0624]: associated function `private` is private --> $DIR/explore-issue-38412.rs:52:7 | LL | r.private(); - | ^^^^^^^ + | ^^^^^^^ private associated function error[E0658]: use of unstable library feature 'unstable_undeclared' --> $DIR/explore-issue-38412.rs:57:7 @@ -119,19 +119,19 @@ error[E0624]: associated function `pub_crate` is private --> $DIR/explore-issue-38412.rs:63:7 | LL | t.pub_crate(); - | ^^^^^^^^^ + | ^^^^^^^^^ private associated function error[E0624]: associated function `pub_mod` is private --> $DIR/explore-issue-38412.rs:64:7 | LL | t.pub_mod(); - | ^^^^^^^ + | ^^^^^^^ private associated function error[E0624]: associated function `private` is private --> $DIR/explore-issue-38412.rs:65:7 | LL | t.private(); - | ^^^^^^^ + | ^^^^^^^ private associated function error: aborting due to 19 previous errors diff --git a/src/test/ui/export-import.stderr b/src/test/ui/export-import.stderr index 8160775ab589e..753424c7f88b8 100644 --- a/src/test/ui/export-import.stderr +++ b/src/test/ui/export-import.stderr @@ -2,7 +2,7 @@ error[E0603]: function `unexported` is private --> $DIR/export-import.rs:1:8 | LL | use m::unexported; - | ^^^^^^^^^^ this function is private + | ^^^^^^^^^^ private function | note: the function `unexported` is defined here --> $DIR/export-import.rs:7:5 diff --git a/src/test/ui/export-tag-variant.stderr b/src/test/ui/export-tag-variant.stderr index f4537a2fb6fae..f73bd454d3592 100644 --- a/src/test/ui/export-tag-variant.stderr +++ b/src/test/ui/export-tag-variant.stderr @@ -2,7 +2,7 @@ error[E0603]: enum `Y` is private --> $DIR/export-tag-variant.rs:7:26 | LL | fn main() { let z = foo::Y::Y1; } - | ^ this enum is private + | ^ private enum | note: the enum `Y` is defined here --> $DIR/export-tag-variant.rs:4:5 diff --git a/src/test/ui/export.stderr b/src/test/ui/export.stderr index 107f531c09a3a..23c29b31c6a8e 100644 --- a/src/test/ui/export.stderr +++ b/src/test/ui/export.stderr @@ -26,7 +26,7 @@ error[E0603]: function `z` is private --> $DIR/export.rs:10:18 | LL | fn main() { foo::z(10); } - | ^ this function is private + | ^ private function | note: the function `z` is defined here --> $DIR/export.rs:5:5 diff --git a/src/test/ui/extern/extern-crate-visibility.stderr b/src/test/ui/extern/extern-crate-visibility.stderr index d0c073d67a4ee..9eeb83ae1a73f 100644 --- a/src/test/ui/extern/extern-crate-visibility.stderr +++ b/src/test/ui/extern/extern-crate-visibility.stderr @@ -2,7 +2,7 @@ error[E0603]: crate import `core` is private --> $DIR/extern-crate-visibility.rs:6:10 | LL | use foo::core::cell; - | ^^^^ this crate import is private + | ^^^^ private crate import | note: the crate import `core` is defined here --> $DIR/extern-crate-visibility.rs:2:5 @@ -14,7 +14,7 @@ error[E0603]: crate import `core` is private --> $DIR/extern-crate-visibility.rs:9:10 | LL | foo::core::cell::Cell::new(0); - | ^^^^ this crate import is private + | ^^^^ private crate import | note: the crate import `core` is defined here --> $DIR/extern-crate-visibility.rs:2:5 diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr index 0c9165fd9585d..871757ec7b0c6 100644 --- a/src/test/ui/extern/extern-types-unsized.stderr +++ b/src/test/ui/extern/extern-types-unsized.stderr @@ -2,15 +2,17 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim --> $DIR/extern-types-unsized.rs:22:20 | LL | fn assert_sized() { } - | ------------ -- help: consider relaxing the implicit `Sized` restriction: `: ?Sized` - | | - | required by this bound in `assert_sized` + | ------------ - required by this bound in `assert_sized` ... LL | assert_sized::(); | ^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `A` = note: to learn more, visit +help: consider relaxing the implicit `Sized` restriction + | +LL | fn assert_sized() { } + | ^^^^^^^^ error[E0277]: the size for values of type `A` cannot be known at compilation time --> $DIR/extern-types-unsized.rs:25:5 diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index 08c36cece4cf9..3334e47019494 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -3,6 +3,11 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(_x) = foo(); | ^^^^^^ pattern `Err(_)` not covered + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | --- not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html diff --git a/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr b/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr index 2aeffc3e5e457..19703fc99fd27 100644 --- a/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr +++ b/src/test/ui/functional-struct-update/functional-struct-update-respects-privacy.stderr @@ -2,7 +2,7 @@ error[E0451]: field `secret_uid` of struct `foo::S` is private --> $DIR/functional-struct-update-respects-privacy.rs:28:49 | LL | let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ... - | ^^^ field `secret_uid` is private + | ^^^ private field error: aborting due to previous error diff --git a/src/test/ui/generic-associated-types/iterable.stderr b/src/test/ui/generic-associated-types/iterable.stderr index ccb1c9bcc7f4e..b5bc0c76c2fc5 100644 --- a/src/test/ui/generic-associated-types/iterable.stderr +++ b/src/test/ui/generic-associated-types/iterable.stderr @@ -5,6 +5,11 @@ LL | impl Iterable for Vec { | --------------------------- in this `impl` item LL | type Item<'a> where T: 'a = as Iterator>::Item; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found associated type + | + ::: $SRC_DIR/libcore/iter/traits/iterator.rs:LL:COL + | +LL | type Item; + | ---- associated type defined here | = note: expected reference `&T` found associated type ` as Iterable>::Item<'_>` @@ -18,6 +23,11 @@ LL | impl Iterable for [T] { | ------------------------ in this `impl` item LL | type Item<'a> where T: 'a = as Iterator>::Item; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found associated type + | + ::: $SRC_DIR/libcore/iter/traits/iterator.rs:LL:COL + | +LL | type Item; + | ---- associated type defined here | = note: expected reference `&T` found associated type `<[T] as Iterable>::Item<'_>` diff --git a/src/test/ui/glob-resolve1.stderr b/src/test/ui/glob-resolve1.stderr index 3db24431586da..efbd53fd223a4 100644 --- a/src/test/ui/glob-resolve1.stderr +++ b/src/test/ui/glob-resolve1.stderr @@ -47,7 +47,7 @@ error[E0412]: cannot find type `A` in this scope --> $DIR/glob-resolve1.rs:28:11 | LL | pub enum B { B1 } - | ----------------- similarly named enum `B` defined here + | ---------- similarly named enum `B` defined here ... LL | foo::(); | ^ @@ -65,7 +65,7 @@ error[E0412]: cannot find type `C` in this scope --> $DIR/glob-resolve1.rs:29:11 | LL | pub enum B { B1 } - | ----------------- similarly named enum `B` defined here + | ---------- similarly named enum `B` defined here ... LL | foo::(); | ^ @@ -83,7 +83,7 @@ error[E0412]: cannot find type `D` in this scope --> $DIR/glob-resolve1.rs:30:11 | LL | pub enum B { B1 } - | ----------------- similarly named enum `B` defined here + | ---------- similarly named enum `B` defined here ... LL | foo::(); | ^ diff --git a/src/test/ui/hygiene/fields.stderr b/src/test/ui/hygiene/fields.stderr index 89deef492020d..6d784408016f5 100644 --- a/src/test/ui/hygiene/fields.stderr +++ b/src/test/ui/hygiene/fields.stderr @@ -2,7 +2,7 @@ error: type `foo::S` is private --> $DIR/fields.rs:15:17 | LL | let s = S { x: 0 }; - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation @@ -13,7 +13,7 @@ error: type `foo::S` is private --> $DIR/fields.rs:16:17 | LL | let _ = s.x; - | ^ + | ^ private type ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation @@ -24,7 +24,7 @@ error: type `foo::T` is private --> $DIR/fields.rs:18:17 | LL | let t = T(0); - | ^^^^ + | ^^^^ private type ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation @@ -35,7 +35,7 @@ error: type `foo::T` is private --> $DIR/fields.rs:19:17 | LL | let _ = t.0; - | ^ + | ^ private type ... LL | let s = foo::m!(S, x); | ------------- in this macro invocation diff --git a/src/test/ui/hygiene/impl_items.stderr b/src/test/ui/hygiene/impl_items.stderr index 85ee9f4cbf3e6..8ac59263cf21a 100644 --- a/src/test/ui/hygiene/impl_items.stderr +++ b/src/test/ui/hygiene/impl_items.stderr @@ -2,7 +2,7 @@ error: type `for<'r> fn(&'r foo::S) {foo::S::f}` is private --> $DIR/impl_items.rs:12:23 | LL | let _: () = S.f(); - | ^ + | ^ private type ... LL | foo::m!(); | ---------- in this macro invocation diff --git a/src/test/ui/hygiene/intercrate.stderr b/src/test/ui/hygiene/intercrate.stderr index 3912ca337fbec..c27ba74a263e0 100644 --- a/src/test/ui/hygiene/intercrate.stderr +++ b/src/test/ui/hygiene/intercrate.stderr @@ -2,7 +2,7 @@ error: type `fn() -> u32 {intercrate::foo::bar::f}` is private --> $DIR/intercrate.rs:10:16 | LL | assert_eq!(intercrate::foo::m!(), 1); - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/hygiene/nested_macro_privacy.stderr b/src/test/ui/hygiene/nested_macro_privacy.stderr index 6e78cb86d80f4..482957a326437 100644 --- a/src/test/ui/hygiene/nested_macro_privacy.stderr +++ b/src/test/ui/hygiene/nested_macro_privacy.stderr @@ -1,8 +1,8 @@ error[E0616]: field `i` of struct `foo::S` is private - --> $DIR/nested_macro_privacy.rs:15:5 + --> $DIR/nested_macro_privacy.rs:15:18 | LL | S::default().i; - | ^^^^^^^^^^^^^^ + | ^ private field error: aborting due to previous error diff --git a/src/test/ui/hygiene/privacy.stderr b/src/test/ui/hygiene/privacy.stderr index 0649dc0ec5836..70a24304dda33 100644 --- a/src/test/ui/hygiene/privacy.stderr +++ b/src/test/ui/hygiene/privacy.stderr @@ -2,7 +2,7 @@ error[E0603]: function `f` is private --> $DIR/privacy.rs:16:14 | LL | foo::f() - | ^ this function is private + | ^ private function | note: the function `f` is defined here --> $DIR/privacy.rs:4:5 diff --git a/src/test/ui/hygiene/rustc-macro-transparency.stderr b/src/test/ui/hygiene/rustc-macro-transparency.stderr index 45a2efebbb8da..024ce8207601e 100644 --- a/src/test/ui/hygiene/rustc-macro-transparency.stderr +++ b/src/test/ui/hygiene/rustc-macro-transparency.stderr @@ -8,13 +8,23 @@ error[E0423]: expected value, found macro `semitransparent` --> $DIR/rustc-macro-transparency.rs:29:5 | LL | semitransparent; - | ^^^^^^^^^^^^^^^ help: use `!` to invoke the macro: `semitransparent!` + | ^^^^^^^^^^^^^^^ + | +help: use `!` to invoke the macro + | +LL | semitransparent!; + | ^ error[E0423]: expected value, found macro `opaque` --> $DIR/rustc-macro-transparency.rs:30:5 | LL | opaque; - | ^^^^^^ help: use `!` to invoke the macro: `opaque!` + | ^^^^^^ + | +help: use `!` to invoke the macro + | +LL | opaque!; + | ^ error: aborting due to 3 previous errors diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr index c0ca341385df5..b5135b53e1890 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -83,6 +83,16 @@ error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::b | LL | std::rc::Rc::new(&mut Box::new(&1i32)).method(); | ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>` + | + ::: $DIR/auxiliary/no_method_suggested_traits.rs:8:12 + | +LL | fn method(&self) {} + | ------ + | | + | the method is available for `std::boxed::Box>>` here + | the method is available for `std::pin::Pin>>` here + | the method is available for `std::sync::Arc>>` here + | the method is available for `std::rc::Rc>>` here | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: diff --git a/src/test/ui/implicit-method-bind.stderr b/src/test/ui/implicit-method-bind.stderr index 968272d4d2c19..c6af47805ea5b 100644 --- a/src/test/ui/implicit-method-bind.stderr +++ b/src/test/ui/implicit-method-bind.stderr @@ -2,7 +2,12 @@ error[E0615]: attempted to take value of method `abs` on type `i32` --> $DIR/implicit-method-bind.rs:2:20 | LL | let _f = 10i32.abs; - | ^^^ help: use parentheses to call the method: `abs()` + | ^^^ method, not a field + | +help: use parentheses to call the method + | +LL | let _f = 10i32.abs(); + | ^^ error: aborting due to previous error diff --git a/src/test/ui/import.stderr b/src/test/ui/import.stderr index 5219ffacd15c0..797712e2db99e 100644 --- a/src/test/ui/import.stderr +++ b/src/test/ui/import.stderr @@ -17,7 +17,7 @@ error[E0603]: unresolved item import `foo` is private --> $DIR/import.rs:15:10 | LL | zed::foo(); - | ^^^ this unresolved item import is private + | ^^^ private unresolved item import | note: the unresolved item import `foo` is defined here --> $DIR/import.rs:10:9 diff --git a/src/test/ui/imports/issue-55884-2.stderr b/src/test/ui/imports/issue-55884-2.stderr index 490c08446b5a8..5adbc4b66d133 100644 --- a/src/test/ui/imports/issue-55884-2.stderr +++ b/src/test/ui/imports/issue-55884-2.stderr @@ -2,7 +2,7 @@ error[E0603]: struct import `ParseOptions` is private --> $DIR/issue-55884-2.rs:12:17 | LL | pub use parser::ParseOptions; - | ^^^^^^^^^^^^ this struct import is private + | ^^^^^^^^^^^^ private struct import | note: the struct import `ParseOptions` is defined here... --> $DIR/issue-55884-2.rs:9:9 diff --git a/src/test/ui/imports/reexports.stderr b/src/test/ui/imports/reexports.stderr index d63fbc7ec6781..79c8e1130c87a 100644 --- a/src/test/ui/imports/reexports.stderr +++ b/src/test/ui/imports/reexports.stderr @@ -14,7 +14,7 @@ error[E0603]: module import `foo` is private --> $DIR/reexports.rs:33:15 | LL | use b::a::foo::S; - | ^^^ this module import is private + | ^^^ private module import | note: the module import `foo` is defined here... --> $DIR/reexports.rs:21:17 @@ -31,7 +31,7 @@ error[E0603]: module import `foo` is private --> $DIR/reexports.rs:34:15 | LL | use b::b::foo::S as T; - | ^^^ this module import is private + | ^^^ private module import | note: the module import `foo` is defined here... --> $DIR/reexports.rs:26:17 diff --git a/src/test/ui/imports/unresolved-imports-used.stderr b/src/test/ui/imports/unresolved-imports-used.stderr index 69765b9227d6e..ddf3608933909 100644 --- a/src/test/ui/imports/unresolved-imports-used.stderr +++ b/src/test/ui/imports/unresolved-imports-used.stderr @@ -38,7 +38,7 @@ error[E0603]: function `quz` is private --> $DIR/unresolved-imports-used.rs:9:10 | LL | use qux::quz; - | ^^^ this function is private + | ^^^ private function | note: the function `quz` is defined here --> $DIR/unresolved-imports-used.rs:5:4 diff --git a/src/test/ui/issues/issue-10545.stderr b/src/test/ui/issues/issue-10545.stderr index 4ed7028c0a06b..f1da33eaba1c3 100644 --- a/src/test/ui/issues/issue-10545.stderr +++ b/src/test/ui/issues/issue-10545.stderr @@ -2,7 +2,7 @@ error[E0603]: struct `S` is private --> $DIR/issue-10545.rs:6:14 | LL | fn foo(_: a::S) { - | ^ this struct is private + | ^ private struct | note: the struct `S` is defined here --> $DIR/issue-10545.rs:2:5 diff --git a/src/test/ui/issues/issue-11593.stderr b/src/test/ui/issues/issue-11593.stderr index bfb4d31323b13..aa9768b1885a2 100644 --- a/src/test/ui/issues/issue-11593.stderr +++ b/src/test/ui/issues/issue-11593.stderr @@ -2,7 +2,7 @@ error[E0603]: trait `Foo` is private --> $DIR/issue-11593.rs:7:24 | LL | impl private_trait_xc::Foo for Bar {} - | ^^^ this trait is private + | ^^^ private trait | note: the trait `Foo` is defined here --> $DIR/auxiliary/private-trait-xc.rs:1:1 diff --git a/src/test/ui/issues/issue-11680.stderr b/src/test/ui/issues/issue-11680.stderr index 898ac10f7d9a9..ea224af8ed7e2 100644 --- a/src/test/ui/issues/issue-11680.stderr +++ b/src/test/ui/issues/issue-11680.stderr @@ -2,7 +2,7 @@ error[E0603]: enum `Foo` is private --> $DIR/issue-11680.rs:6:21 | LL | let _b = other::Foo::Bar(1); - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Foo` is defined here --> $DIR/auxiliary/issue-11680.rs:1:1 @@ -14,7 +14,7 @@ error[E0603]: enum `Foo` is private --> $DIR/issue-11680.rs:9:27 | LL | let _b = other::test::Foo::Bar(1); - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Foo` is defined here --> $DIR/auxiliary/issue-11680.rs:6:5 diff --git a/src/test/ui/issues/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr index f211d623ab12b..f30b6cdeaf073 100644 --- a/src/test/ui/issues/issue-13407.stderr +++ b/src/test/ui/issues/issue-13407.stderr @@ -2,7 +2,7 @@ error[E0603]: unit struct `C` is private --> $DIR/issue-13407.rs:6:8 | LL | A::C = 1; - | ^ this unit struct is private + | ^ private unit struct | note: the unit struct `C` is defined here --> $DIR/issue-13407.rs:2:5 diff --git a/src/test/ui/issues/issue-13641.stderr b/src/test/ui/issues/issue-13641.stderr index f90cb18b6fc9d..cdd0772d39fb0 100644 --- a/src/test/ui/issues/issue-13641.stderr +++ b/src/test/ui/issues/issue-13641.stderr @@ -2,7 +2,7 @@ error[E0603]: struct `Foo` is private --> $DIR/issue-13641.rs:9:8 | LL | a::Foo::new(); - | ^^^ this struct is private + | ^^^ private struct | note: the struct `Foo` is defined here --> $DIR/issue-13641.rs:2:5 @@ -14,7 +14,7 @@ error[E0603]: enum `Bar` is private --> $DIR/issue-13641.rs:11:8 | LL | a::Bar::new(); - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Bar` is defined here --> $DIR/issue-13641.rs:4:5 diff --git a/src/test/ui/issues/issue-13853-2.stderr b/src/test/ui/issues/issue-13853-2.stderr index ea3b38940cf01..49b946b354e53 100644 --- a/src/test/ui/issues/issue-13853-2.stderr +++ b/src/test/ui/issues/issue-13853-2.stderr @@ -2,7 +2,12 @@ error[E0615]: attempted to take value of method `get` on type `std::boxed::Box<( --> $DIR/issue-13853-2.rs:5:43 | LL | fn foo(res : Box) { res.get } - | ^^^ help: use parentheses to call the method: `get()` + | ^^^ method, not a field + | +help: use parentheses to call the method + | +LL | fn foo(res : Box) { res.get() } + | ^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16725.stderr b/src/test/ui/issues/issue-16725.stderr index e0a1ca8a5ac31..84359803bbae7 100644 --- a/src/test/ui/issues/issue-16725.stderr +++ b/src/test/ui/issues/issue-16725.stderr @@ -2,7 +2,7 @@ error[E0603]: function `bar` is private --> $DIR/issue-16725.rs:6:19 | LL | unsafe { foo::bar(); } - | ^^^ this function is private + | ^^^ private function | note: the function `bar` is defined here --> $DIR/auxiliary/issue-16725.rs:2:5 diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/issues/issue-17718-const-privacy.stderr index 07d825ba9cb3b..d4595be749034 100644 --- a/src/test/ui/issues/issue-17718-const-privacy.stderr +++ b/src/test/ui/issues/issue-17718-const-privacy.stderr @@ -2,7 +2,7 @@ error[E0603]: constant `B` is private --> $DIR/issue-17718-const-privacy.rs:5:8 | LL | use a::B; - | ^ this constant is private + | ^ private constant | note: the constant `B` is defined here --> $DIR/issue-17718-const-privacy.rs:13:5 @@ -14,7 +14,7 @@ error[E0603]: constant `BAR` is private --> $DIR/issue-17718-const-privacy.rs:8:5 | LL | BAR, - | ^^^ this constant is private + | ^^^ private constant | note: the constant `BAR` is defined here --> $DIR/auxiliary/issue-17718-const-privacy.rs:4:1 diff --git a/src/test/ui/issues/issue-21202.stderr b/src/test/ui/issues/issue-21202.stderr index 18669add20551..9b3b7a72e049e 100644 --- a/src/test/ui/issues/issue-21202.stderr +++ b/src/test/ui/issues/issue-21202.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `foo` is private - --> $DIR/issue-21202.rs:10:9 + --> $DIR/issue-21202.rs:10:14 | LL | Foo::foo(&f); - | ^^^^^^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/issues/issue-25386.rs b/src/test/ui/issues/issue-25386.rs index 607c9fceab84f..45775e0e4ae36 100644 --- a/src/test/ui/issues/issue-25386.rs +++ b/src/test/ui/issues/issue-25386.rs @@ -17,12 +17,12 @@ mod stuff { macro_rules! check_ptr_exist { ($var:expr, $member:ident) => ( (*$var.c_object).$member.is_some() - //~^ ERROR field `name` of struct `stuff::CObj` is private - //~^^ ERROR field `c_object` of struct `stuff::Item` is private + //~^ ERROR field `c_object` of struct `stuff::Item` is private ); } fn main() { let item = stuff::Item::new(); println!("{}", check_ptr_exist!(item, name)); + //~^ ERROR field `name` of struct `stuff::CObj` is private } diff --git a/src/test/ui/issues/issue-25386.stderr b/src/test/ui/issues/issue-25386.stderr index 76a4a5a493f59..6419e7a557194 100644 --- a/src/test/ui/issues/issue-25386.stderr +++ b/src/test/ui/issues/issue-25386.stderr @@ -1,8 +1,8 @@ error[E0616]: field `c_object` of struct `stuff::Item` is private - --> $DIR/issue-25386.rs:19:11 + --> $DIR/issue-25386.rs:19:16 | LL | (*$var.c_object).$member.is_some() - | ^^^^^^^^^^^^^ + | ^^^^^^^^ private field ... LL | println!("{}", check_ptr_exist!(item, name)); | ---------------------------- in this macro invocation @@ -10,15 +10,10 @@ LL | println!("{}", check_ptr_exist!(item, name)); = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) error[E0616]: field `name` of struct `stuff::CObj` is private - --> $DIR/issue-25386.rs:19:9 + --> $DIR/issue-25386.rs:26:43 | -LL | (*$var.c_object).$member.is_some() - | ^^^^^^^^^^^^^^^^^^^^^^^^ -... LL | println!("{}", check_ptr_exist!(item, name)); - | ---------------------------- in this macro invocation - | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + | ^^^^ private field error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-26472.stderr b/src/test/ui/issues/issue-26472.stderr index 245ebeaf972ed..f7df5b6232bda 100644 --- a/src/test/ui/issues/issue-26472.stderr +++ b/src/test/ui/issues/issue-26472.stderr @@ -1,16 +1,19 @@ error[E0616]: field `len` of struct `sub::S` is private - --> $DIR/issue-26472.rs:11:13 + --> $DIR/issue-26472.rs:11:15 | LL | let v = s.len; - | ^^--- - | | - | help: a method `len` also exists, call it with parentheses: `len()` + | ^^^ private field + | +help: a method `len` also exists, call it with parentheses + | +LL | let v = s.len(); + | ^^ error[E0616]: field `len` of struct `sub::S` is private - --> $DIR/issue-26472.rs:12:5 + --> $DIR/issue-26472.rs:12:7 | LL | s.len = v; - | ^^^^^ + | ^^^ private field error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-2823.stderr b/src/test/ui/issues/issue-2823.stderr index aa720fd45895a..0cdc501d56811 100644 --- a/src/test/ui/issues/issue-2823.stderr +++ b/src/test/ui/issues/issue-2823.stderr @@ -6,6 +6,14 @@ LL | struct C { ... LL | let _d = c.clone(); | ^^^^^ method not found in `C` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc` here + | the method is available for `std::rc::Rc` here | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: diff --git a/src/test/ui/issues/issue-28388-2.stderr b/src/test/ui/issues/issue-28388-2.stderr index 58bd775f295fc..1afaf622be7da 100644 --- a/src/test/ui/issues/issue-28388-2.stderr +++ b/src/test/ui/issues/issue-28388-2.stderr @@ -2,7 +2,7 @@ error[E0603]: module `n` is private --> $DIR/issue-28388-2.rs:7:8 | LL | use m::n::{}; - | ^ this module is private + | ^ private module | note: the module `n` is defined here --> $DIR/issue-28388-2.rs:4:5 diff --git a/src/test/ui/issues/issue-29161.stderr b/src/test/ui/issues/issue-29161.stderr index 1bfa211ef7962..7ce95e4b0df8b 100644 --- a/src/test/ui/issues/issue-29161.stderr +++ b/src/test/ui/issues/issue-29161.stderr @@ -8,7 +8,7 @@ error[E0603]: struct `A` is private --> $DIR/issue-29161.rs:13:8 | LL | a::A::default(); - | ^ this struct is private + | ^ private struct | note: the struct `A` is defined here --> $DIR/issue-29161.rs:2:5 diff --git a/src/test/ui/issues/issue-31845.stderr b/src/test/ui/issues/issue-31845.stderr index 75d8859961a04..fe51fa0699fb4 100644 --- a/src/test/ui/issues/issue-31845.stderr +++ b/src/test/ui/issues/issue-31845.stderr @@ -1,11 +1,10 @@ error[E0425]: cannot find function `g` in this scope --> $DIR/issue-31845.rs:7:12 | -LL | / fn h() { -LL | | g(); - | | ^ help: a function with a similar name exists: `h` -LL | | } - | |_________- similarly named function `h` defined here +LL | fn h() { + | ------ similarly named function `h` defined here +LL | g(); + | ^ help: a function with a similar name exists: `h` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-35241.stderr b/src/test/ui/issues/issue-35241.stderr index 4a52a292ef30a..b6045c993a958 100644 --- a/src/test/ui/issues/issue-35241.stderr +++ b/src/test/ui/issues/issue-35241.stderr @@ -5,14 +5,16 @@ LL | struct Foo(u32); | ---------------- fn(u32) -> Foo {Foo} defined here LL | LL | fn test() -> Foo { Foo } - | --- ^^^ - | | | - | | expected struct `Foo`, found fn item - | | help: use parentheses to instantiate this tuple struct: `Foo(_)` + | --- ^^^ expected struct `Foo`, found fn item + | | | expected `Foo` because of return type | = note: expected struct `Foo` found fn item `fn(u32) -> Foo {Foo}` +help: use parentheses to instantiate this tuple struct + | +LL | fn test() -> Foo { Foo(_) } + | ^^^ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-3763.stderr b/src/test/ui/issues/issue-3763.stderr index d548477a88ff8..b63967bb9dce3 100644 --- a/src/test/ui/issues/issue-3763.stderr +++ b/src/test/ui/issues/issue-3763.stderr @@ -1,32 +1,32 @@ error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private - --> $DIR/issue-3763.rs:18:19 + --> $DIR/issue-3763.rs:18:32 | LL | let _woohoo = (&my_struct).priv_field; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ private field error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private - --> $DIR/issue-3763.rs:21:19 + --> $DIR/issue-3763.rs:21:41 | LL | let _woohoo = (Box::new(my_struct)).priv_field; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ private field error[E0624]: associated function `happyfun` is private --> $DIR/issue-3763.rs:24:18 | LL | (&my_struct).happyfun(); - | ^^^^^^^^ + | ^^^^^^^^ private associated function error[E0624]: associated function `happyfun` is private --> $DIR/issue-3763.rs:26:27 | LL | (Box::new(my_struct)).happyfun(); - | ^^^^^^^^ + | ^^^^^^^^ private associated function error[E0616]: field `priv_field` of struct `my_mod::MyStruct` is private - --> $DIR/issue-3763.rs:27:16 + --> $DIR/issue-3763.rs:27:26 | LL | let nope = my_struct.priv_field; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^ private field error: aborting due to 5 previous errors diff --git a/src/test/ui/issues/issue-38857.stderr b/src/test/ui/issues/issue-38857.stderr index ba0f1336ff09d..1a287e94bafd3 100644 --- a/src/test/ui/issues/issue-38857.stderr +++ b/src/test/ui/issues/issue-38857.stderr @@ -8,7 +8,7 @@ error[E0603]: module `sys` is private --> $DIR/issue-38857.rs:7:18 | LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; - | ^^^ this module is private + | ^^^ private module | note: the module `sys` is defined here --> $SRC_DIR/libstd/lib.rs:LL:COL diff --git a/src/test/ui/issues/issue-3993.stderr b/src/test/ui/issues/issue-3993.stderr index 3fa8ed4af28fa..deecf7a9d752c 100644 --- a/src/test/ui/issues/issue-3993.stderr +++ b/src/test/ui/issues/issue-3993.stderr @@ -2,7 +2,7 @@ error[E0603]: function `fly` is private --> $DIR/issue-3993.rs:1:10 | LL | use zoo::fly; - | ^^^ this function is private + | ^^^ private function | note: the function `fly` is defined here --> $DIR/issue-3993.rs:4:5 diff --git a/src/test/ui/issues/issue-46332.stderr b/src/test/ui/issues/issue-46332.stderr index 5d8a859a7379c..890ef8014b489 100644 --- a/src/test/ui/issues/issue-46332.stderr +++ b/src/test/ui/issues/issue-46332.stderr @@ -2,7 +2,7 @@ error[E0422]: cannot find struct, variant or union type `TyUInt` in this scope --> $DIR/issue-46332.rs:9:5 | LL | struct TyUint {} - | ---------------- similarly named struct `TyUint` defined here + | ------------- similarly named struct `TyUint` defined here ... LL | TyUInt {}; | ^^^^^^ help: a struct with a similar name exists (notice the capitalization): `TyUint` diff --git a/src/test/ui/issues/issue-53498.stderr b/src/test/ui/issues/issue-53498.stderr index 042848c27bbdc..3c0f7f2b55026 100644 --- a/src/test/ui/issues/issue-53498.stderr +++ b/src/test/ui/issues/issue-53498.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `foo` is private - --> $DIR/issue-53498.rs:16:5 + --> $DIR/issue-53498.rs:16:27 | LL | test::Foo::::foo(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/issues/issue-54062.stderr b/src/test/ui/issues/issue-54062.stderr index 5222e3ee95d59..f9aef08c353bb 100644 --- a/src/test/ui/issues/issue-54062.stderr +++ b/src/test/ui/issues/issue-54062.stderr @@ -1,8 +1,8 @@ error[E0616]: field `inner` of struct `std::sync::Mutex` is private - --> $DIR/issue-54062.rs:10:13 + --> $DIR/issue-54062.rs:10:24 | LL | let _ = test.comps.inner.lock().unwrap(); - | ^^^^^^^^^^^^^^^^ + | ^^^^^ private field error[E0599]: no method named `unwrap` found for struct `std::sys_common::mutex::MutexGuard<'_>` in the current scope --> $DIR/issue-54062.rs:10:37 diff --git a/src/test/ui/issues/issue-69725.stderr b/src/test/ui/issues/issue-69725.stderr index 667383e072a54..d9d61fe66f78e 100644 --- a/src/test/ui/issues/issue-69725.stderr +++ b/src/test/ui/issues/issue-69725.stderr @@ -8,6 +8,14 @@ LL | let _ = Struct::::new().clone(); | LL | pub struct Struct(A); | ------------------------ doesn't satisfy `issue_69725::Struct: std::clone::Clone` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc>` here + | the method is available for `std::rc::Rc>` here | = note: the method `clone` exists but the following trait bounds were not satisfied: `A: std::clone::Clone` diff --git a/src/test/ui/macros/macro-local-data-key-priv.stderr b/src/test/ui/macros/macro-local-data-key-priv.stderr index c53a09aad5783..3092d76c268ad 100644 --- a/src/test/ui/macros/macro-local-data-key-priv.stderr +++ b/src/test/ui/macros/macro-local-data-key-priv.stderr @@ -2,7 +2,7 @@ error[E0603]: constant `baz` is private --> $DIR/macro-local-data-key-priv.rs:8:10 | LL | bar::baz.with(|_| ()); - | ^^^ this constant is private + | ^^^ private constant | note: the constant `baz` is defined here --> $DIR/macro-local-data-key-priv.rs:4:5 diff --git a/src/test/ui/macros/macro_undefined.stderr b/src/test/ui/macros/macro_undefined.stderr index b2caba893e072..4ab16bd10173d 100644 --- a/src/test/ui/macros/macro_undefined.stderr +++ b/src/test/ui/macros/macro_undefined.stderr @@ -1,13 +1,11 @@ error: cannot find macro `k` in this scope --> $DIR/macro_undefined.rs:11:5 | -LL | / macro_rules! kl { -LL | | () => () -LL | | } - | |_____- similarly named macro `kl` defined here +LL | macro_rules! kl { + | --------------- similarly named macro `kl` defined here ... -LL | k!(); - | ^ help: a macro with a similar name exists: `kl` +LL | k!(); + | ^ help: a macro with a similar name exists: `kl` error: aborting due to previous error diff --git a/src/test/ui/methods/assign-to-method.stderr b/src/test/ui/methods/assign-to-method.stderr index c0dd529b6818f..cafe9abae045d 100644 --- a/src/test/ui/methods/assign-to-method.stderr +++ b/src/test/ui/methods/assign-to-method.stderr @@ -2,7 +2,7 @@ error[E0615]: attempted to take value of method `speak` on type `Cat` --> $DIR/assign-to-method.rs:22:10 | LL | nyan.speak = || println!("meow"); - | ^^^^^ + | ^^^^^ method, not a field | = help: methods are immutable and cannot be assigned to @@ -10,7 +10,7 @@ error[E0615]: attempted to take value of method `speak` on type `Cat` --> $DIR/assign-to-method.rs:23:10 | LL | nyan.speak += || println!("meow"); - | ^^^^^ + | ^^^^^ method, not a field | = help: methods are immutable and cannot be assigned to diff --git a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr index 44f85071505d2..249464108875c 100644 --- a/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr +++ b/src/test/ui/methods/method-ambig-two-traits-from-impls2.stderr @@ -1,8 +1,8 @@ error[E0034]: multiple applicable items in scope - --> $DIR/method-ambig-two-traits-from-impls2.rs:15:5 + --> $DIR/method-ambig-two-traits-from-impls2.rs:15:9 | LL | AB::foo(); - | ^^^^^^^ multiple `foo` found + | ^^^ multiple `foo` found | note: candidate #1 is defined in an impl of the trait `A` for the type `AB` --> $DIR/method-ambig-two-traits-from-impls2.rs:7:5 diff --git a/src/test/ui/methods/method-missing-call.stderr b/src/test/ui/methods/method-missing-call.stderr index 3ab5f66a0c3f6..bc8a1c85e561a 100644 --- a/src/test/ui/methods/method-missing-call.stderr +++ b/src/test/ui/methods/method-missing-call.stderr @@ -2,13 +2,23 @@ error[E0615]: attempted to take value of method `get_x` on type `Point` --> $DIR/method-missing-call.rs:22:26 | LL | .get_x; - | ^^^^^ help: use parentheses to call the method: `get_x()` + | ^^^^^ method, not a field + | +help: use parentheses to call the method + | +LL | .get_x(); + | ^^ error[E0615]: attempted to take value of method `filter_map` on type `std::iter::Filter, [closure@$DIR/method-missing-call.rs:27:20: 27:25]>, [closure@$DIR/method-missing-call.rs:28:23: 28:35]>` --> $DIR/method-missing-call.rs:29:16 | LL | .filter_map; - | ^^^^^^^^^^ help: use parentheses to call the method: `filter_map(...)` + | ^^^^^^^^^^ method, not a field + | +help: use parentheses to call the method + | +LL | .filter_map(_); + | ^^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/non-copyable-void.stderr b/src/test/ui/non-copyable-void.stderr index 074ed66a26183..78d212f7a7ba7 100644 --- a/src/test/ui/non-copyable-void.stderr +++ b/src/test/ui/non-copyable-void.stderr @@ -3,6 +3,14 @@ error[E0599]: no method named `clone` found for enum `libc::c_void` in the curre | LL | let _z = (*y).clone(); | ^^^^^ method not found in `libc::c_void` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc` here + | the method is available for `std::rc::Rc` here error: aborting due to previous error diff --git a/src/test/ui/noncopyable-class.stderr b/src/test/ui/noncopyable-class.stderr index 6c3c4a6ac9888..994eb65ae15bf 100644 --- a/src/test/ui/noncopyable-class.stderr +++ b/src/test/ui/noncopyable-class.stderr @@ -6,6 +6,14 @@ LL | struct Foo { ... LL | let _y = x.clone(); | ^^^^^ method not found in `Foo` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc` here + | the method is available for `std::rc::Rc` here | = help: items from traits can only be used if the trait is implemented and in scope = note: the following trait defines an item `clone`, perhaps you need to implement it: diff --git a/src/test/ui/paren-span.stderr b/src/test/ui/paren-span.stderr index 141378752d6f4..ca22401f45bb4 100644 --- a/src/test/ui/paren-span.stderr +++ b/src/test/ui/paren-span.stderr @@ -1,8 +1,8 @@ error[E0616]: field `x` of struct `m::S` is private - --> $DIR/paren-span.rs:19:12 + --> $DIR/paren-span.rs:19:14 | LL | paren!(s.x); - | ^^^ + | ^ private field error: aborting due to previous error diff --git a/src/test/ui/parser/macro/pub-item-macro.stderr b/src/test/ui/parser/macro/pub-item-macro.stderr index 4ff96532e03a8..1c5613ac986c4 100644 --- a/src/test/ui/parser/macro/pub-item-macro.stderr +++ b/src/test/ui/parser/macro/pub-item-macro.stderr @@ -14,7 +14,7 @@ error[E0603]: static `x` is private --> $DIR/pub-item-macro.rs:20:23 | LL | let y: u32 = foo::x; - | ^ this static is private + | ^ private static | note: the static `x` is defined here --> $DIR/pub-item-macro.rs:5:9 diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index 8521e37d3fddc..5bf491144ae45 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -11,6 +11,14 @@ error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered | LL | match Some(Some(North)) { | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ---- + | | + | not covered + | not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index f79d180a1b8b5..ce2ab34f87d69 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -3,6 +3,11 @@ error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not co | LL | match private::DATA { | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ---- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index a06ad5788515c..f7c2772584052 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -25,6 +25,11 @@ error[E0004]: non-exhaustive patterns: `Some(_)` not covered | LL | match Some(10) { | ^^^^^^^^ pattern `Some(_)` not covered + | + ::: $SRC_DIR/libcore/option.rs:LL:COL + | +LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), + | ---- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/privacy/associated-item-privacy-inherent.stderr b/src/test/ui/privacy/associated-item-privacy-inherent.stderr index 88561568ea5a4..1e94e7c620d03 100644 --- a/src/test/ui/privacy/associated-item-privacy-inherent.stderr +++ b/src/test/ui/privacy/associated-item-privacy-inherent.stderr @@ -2,7 +2,7 @@ error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is p --> $DIR/associated-item-privacy-inherent.rs:13:21 | LL | let value = Pub::method; - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation @@ -13,7 +13,7 @@ error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is p --> $DIR/associated-item-privacy-inherent.rs:15:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation @@ -24,7 +24,7 @@ error: type `for<'r> fn(&'r priv_nominal::Pub) {priv_nominal::Pub::method}` is p --> $DIR/associated-item-privacy-inherent.rs:17:13 | LL | Pub.method(); - | ^^^^^^ + | ^^^^^^ private type ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation @@ -35,7 +35,7 @@ error: associated constant `CONST` is private --> $DIR/associated-item-privacy-inherent.rs:19:9 | LL | Pub::CONST; - | ^^^^^^^^^^ + | ^^^^^^^^^^ private associated constant ... LL | priv_nominal::mac!(); | --------------------- in this macro invocation @@ -46,7 +46,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:37:21 | LL | let value = Pub::method; - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -57,7 +57,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:39:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -68,7 +68,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:41:13 | LL | Pub.method(loop {}); - | ^^^^^^ + | ^^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -79,7 +79,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:57:21 | LL | let value = Pub::method::; - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -90,7 +90,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:59:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -101,7 +101,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:61:9 | LL | Pub.method::(); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -112,7 +112,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:80:21 | LL | let value = ::method; - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -123,7 +123,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:82:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -134,7 +134,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:84:21 | LL | let value = Pub::method; - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -145,7 +145,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:86:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -156,7 +156,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:88:21 | LL | let value = ::static_method; - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -167,7 +167,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:90:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -178,7 +178,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:92:21 | LL | let value = Pub::static_method; - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -189,7 +189,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:94:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -200,7 +200,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:96:19 | LL | Pub(Priv).method(); - | ^^^^^^ + | ^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -211,7 +211,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:99:10 | LL | ::CONST; - | ^^^ + | ^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -222,7 +222,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-inherent.rs:101:9 | LL | Pub::CONST; - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation diff --git a/src/test/ui/privacy/associated-item-privacy-trait.stderr b/src/test/ui/privacy/associated-item-privacy-trait.stderr index db24e425a01f6..c30cc947d4508 100644 --- a/src/test/ui/privacy/associated-item-privacy-trait.stderr +++ b/src/test/ui/privacy/associated-item-privacy-trait.stderr @@ -2,7 +2,7 @@ error: type `for<'r> fn(&'r priv_trait::Pub) { $DIR/associated-item-privacy-trait.rs:17:21 | LL | let value = ::method; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -13,7 +13,7 @@ error: type `for<'r> fn(&'r priv_trait::Pub) { $DIR/associated-item-privacy-trait.rs:19:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -24,7 +24,7 @@ error: type `for<'r> fn(&'r Self) {::method}` is pri --> $DIR/associated-item-privacy-trait.rs:21:13 | LL | Pub.method(); - | ^^^^^^ + | ^^^^^^ private type ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -35,7 +35,7 @@ error: associated constant `PrivTr::CONST` is private --> $DIR/associated-item-privacy-trait.rs:23:9 | LL | ::CONST; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ private associated constant ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -46,7 +46,7 @@ error: associated type `PrivTr::AssocTy` is private --> $DIR/associated-item-privacy-trait.rs:25:16 | LL | let _: ::AssocTy; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ private associated type ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -57,7 +57,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:27:34 | LL | pub type InSignatureTy = ::AssocTy; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -68,7 +68,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:29:34 | LL | pub trait InSignatureTr: PrivTr {} - | ^^^^^^ + | ^^^^^^ private trait ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -79,7 +79,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-trait.rs:31:14 | LL | impl PrivTr for u8 {} - | ^^^^^^ + | ^^^^^^ private trait ... LL | priv_trait::mac!(); | ------------------- in this macro invocation @@ -90,7 +90,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:48:21 | LL | let value = ::method; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -101,7 +101,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:50:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -112,7 +112,7 @@ error: type `priv_signature::Priv` is private --> $DIR/associated-item-privacy-trait.rs:52:13 | LL | Pub.method(loop {}); - | ^^^^^^ + | ^^^^^^ private type ... LL | priv_signature::mac!(); | ----------------------- in this macro invocation @@ -123,7 +123,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:69:21 | LL | let value = ::method::; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -134,7 +134,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:71:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -145,7 +145,7 @@ error: type `priv_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:73:9 | LL | Pub.method::(); - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_substs::mac!(); | -------------------- in this macro invocation @@ -156,7 +156,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:93:21 | LL | let value = ::method; - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -167,7 +167,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:95:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -178,7 +178,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:97:21 | LL | let value = >::method; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -189,7 +189,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:99:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -200,7 +200,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:101:9 | LL | Pub.method(); - | ^^^^^^^^^^^^ + | ^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -211,7 +211,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:104:21 | LL | let value = >::method; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -222,7 +222,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:106:9 | LL | value; - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -233,7 +233,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:108:9 | LL | Priv.method(); - | ^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -244,7 +244,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:111:9 | LL | ::CONST; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -255,7 +255,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:113:9 | LL | >::CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -266,7 +266,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:115:9 | LL | >::CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -277,7 +277,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:119:30 | LL | let _: >::AssocTy; - | ^ + | ^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -288,7 +288,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:121:17 | LL | let _: >::AssocTy; - | ^^^^ + | ^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -299,7 +299,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:124:35 | LL | pub type InSignatureTy1 = ::AssocTy; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -310,7 +310,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:126:35 | LL | pub type InSignatureTy2 = >::AssocTy; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -321,7 +321,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-trait.rs:128:14 | LL | impl PubTr for u8 {} - | ^^^^^ + | ^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation diff --git a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr index fd8b8cf0db652..d8515ccb66920 100644 --- a/src/test/ui/privacy/associated-item-privacy-type-binding.stderr +++ b/src/test/ui/privacy/associated-item-privacy-type-binding.stderr @@ -2,7 +2,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:11:13 | LL | let _: Box>; - | ^ + | ^ private trait ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation @@ -13,7 +13,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:11:16 | LL | let _: Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation @@ -24,7 +24,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:14:31 | LL | type InSignatureTy2 = Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation @@ -35,7 +35,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:16:31 | LL | trait InSignatureTr2: PubTr {} - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac1!(); | -------------------- in this macro invocation @@ -46,7 +46,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:20:13 | LL | let _: Box>; - | ^ + | ^ private trait ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation @@ -57,7 +57,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:20:16 | LL | let _: Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation @@ -68,7 +68,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:23:31 | LL | type InSignatureTy1 = Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation @@ -79,7 +79,7 @@ error: trait `priv_trait::PrivTr` is private --> $DIR/associated-item-privacy-type-binding.rs:25:31 | LL | trait InSignatureTr1: PrivTr {} - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ private trait ... LL | priv_trait::mac2!(); | -------------------- in this macro invocation @@ -90,7 +90,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:44:13 | LL | let _: Box>; - | ^ + | ^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -101,7 +101,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:44:16 | LL | let _: Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -112,7 +112,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:47:13 | LL | let _: Box>; - | ^ + | ^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -123,7 +123,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:47:16 | LL | let _: Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -134,7 +134,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:50:35 | LL | pub type InSignatureTy1 = Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -145,7 +145,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:52:35 | LL | pub type InSignatureTy2 = Box>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -156,7 +156,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:54:31 | LL | trait InSignatureTr1: PubTrWithParam {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation @@ -167,7 +167,7 @@ error: type `priv_parent_substs::Priv` is private --> $DIR/associated-item-privacy-type-binding.rs:56:31 | LL | trait InSignatureTr2: PubTr {} - | ^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^ private type ... LL | priv_parent_substs::mac!(); | --------------------------- in this macro invocation diff --git a/src/test/ui/privacy/decl-macro.stderr b/src/test/ui/privacy/decl-macro.stderr index ae2e1b4b644a3..5bc6f07fffac3 100644 --- a/src/test/ui/privacy/decl-macro.stderr +++ b/src/test/ui/privacy/decl-macro.stderr @@ -2,7 +2,7 @@ error[E0603]: macro `mac` is private --> $DIR/decl-macro.rs:8:8 | LL | m::mac!(); - | ^^^ this macro is private + | ^^^ private macro | note: the macro `mac` is defined here --> $DIR/decl-macro.rs:4:5 diff --git a/src/test/ui/privacy/legacy-ctor-visibility.stderr b/src/test/ui/privacy/legacy-ctor-visibility.stderr index 74a1f1ceeffb4..4f0d72de6f1a4 100644 --- a/src/test/ui/privacy/legacy-ctor-visibility.stderr +++ b/src/test/ui/privacy/legacy-ctor-visibility.stderr @@ -1,12 +1,10 @@ error[E0423]: expected function, tuple struct or tuple variant, found struct `S` --> $DIR/legacy-ctor-visibility.rs:9:13 | -LL | / fn f() { -LL | | S(10); - | | ^ help: a function with a similar name exists: `f` -LL | | -LL | | } - | |_________- similarly named function `f` defined here +LL | fn f() { + | ------ similarly named function `f` defined here +LL | S(10); + | ^ help: a function with a similar name exists: `f` error: aborting due to previous error diff --git a/src/test/ui/privacy/privacy-in-paths.stderr b/src/test/ui/privacy/privacy-in-paths.stderr index 8860d8f15f748..2eb3ebb51c20a 100644 --- a/src/test/ui/privacy/privacy-in-paths.stderr +++ b/src/test/ui/privacy/privacy-in-paths.stderr @@ -2,7 +2,7 @@ error[E0603]: module `bar` is private --> $DIR/privacy-in-paths.rs:24:16 | LL | ::foo::bar::baz::f(); - | ^^^ this module is private + | ^^^ private module | note: the module `bar` is defined here --> $DIR/privacy-in-paths.rs:3:5 @@ -14,7 +14,7 @@ error[E0603]: module `bar` is private --> $DIR/privacy-in-paths.rs:25:16 | LL | ::foo::bar::S::f(); - | ^^^ this module is private + | ^^^ private module | note: the module `bar` is defined here --> $DIR/privacy-in-paths.rs:3:5 @@ -26,7 +26,7 @@ error[E0603]: trait `T` is private --> $DIR/privacy-in-paths.rs:26:23 | LL | <() as ::foo::T>::Assoc::f(); - | ^ this trait is private + | ^ private trait | note: the trait `T` is defined here --> $DIR/privacy-in-paths.rs:8:5 diff --git a/src/test/ui/privacy/privacy-ns2.stderr b/src/test/ui/privacy/privacy-ns2.stderr index 8b12109b37307..0c826147a1ca7 100644 --- a/src/test/ui/privacy/privacy-ns2.stderr +++ b/src/test/ui/privacy/privacy-ns2.stderr @@ -58,7 +58,7 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:63:15 | LL | use foo3::Bar; - | ^^^ this trait is private + | ^^^ private trait | note: the trait `Bar` is defined here --> $DIR/privacy-ns2.rs:55:5 @@ -70,7 +70,7 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:67:15 | LL | use foo3::Bar; - | ^^^ this trait is private + | ^^^ private trait | note: the trait `Bar` is defined here --> $DIR/privacy-ns2.rs:55:5 @@ -82,7 +82,7 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ns2.rs:74:16 | LL | use foo3::{Bar,Baz}; - | ^^^ this trait is private + | ^^^ private trait | note: the trait `Bar` is defined here --> $DIR/privacy-ns2.rs:55:5 diff --git a/src/test/ui/privacy/privacy-ufcs.stderr b/src/test/ui/privacy/privacy-ufcs.stderr index 08640b802a244..e93a458ce6cb6 100644 --- a/src/test/ui/privacy/privacy-ufcs.stderr +++ b/src/test/ui/privacy/privacy-ufcs.stderr @@ -2,7 +2,7 @@ error[E0603]: trait `Bar` is private --> $DIR/privacy-ufcs.rs:12:20 | LL | ::baz(); - | ^^^ this trait is private + | ^^^ private trait | note: the trait `Bar` is defined here --> $DIR/privacy-ufcs.rs:4:5 diff --git a/src/test/ui/privacy/privacy1.stderr b/src/test/ui/privacy/privacy1.stderr index ec2bc0d84ac0e..65c10a7bca75d 100644 --- a/src/test/ui/privacy/privacy1.stderr +++ b/src/test/ui/privacy/privacy1.stderr @@ -2,7 +2,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:132:18 | LL | use bar::baz::{foo, bar}; - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -14,7 +14,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:132:18 | LL | use bar::baz::{foo, bar}; - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -26,7 +26,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:141:18 | LL | use bar::baz; - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -38,7 +38,7 @@ error[E0603]: module `i` is private --> $DIR/privacy1.rs:165:20 | LL | use self::foo::i::A; - | ^ this module is private + | ^ private module | note: the module `i` is defined here --> $DIR/privacy1.rs:170:9 @@ -50,7 +50,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:104:16 | LL | ::bar::baz::A::foo(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -62,7 +62,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:105:16 | LL | ::bar::baz::A::bar(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -74,7 +74,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:107:16 | LL | ::bar::baz::A.foo2(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -86,7 +86,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:108:16 | LL | ::bar::baz::A.bar2(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -98,7 +98,7 @@ error[E0603]: trait `B` is private --> $DIR/privacy1.rs:112:16 | LL | ::bar::B::foo(); - | ^ this trait is private + | ^ private trait | note: the trait `B` is defined here --> $DIR/privacy1.rs:40:5 @@ -110,7 +110,7 @@ error[E0603]: function `epriv` is private --> $DIR/privacy1.rs:118:20 | LL | ::bar::epriv(); - | ^^^^^ this function is private + | ^^^^^ private function | note: the function `epriv` is defined here --> $DIR/privacy1.rs:65:9 @@ -122,7 +122,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:127:16 | LL | ::bar::baz::foo(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -134,7 +134,7 @@ error[E0603]: module `baz` is private --> $DIR/privacy1.rs:128:16 | LL | ::bar::baz::bar(); - | ^^^ this module is private + | ^^^ private module | note: the module `baz` is defined here --> $DIR/privacy1.rs:50:5 @@ -146,7 +146,7 @@ error[E0603]: trait `B` is private --> $DIR/privacy1.rs:157:17 | LL | impl ::bar::B for f32 { fn foo() -> f32 { 1.0 } } - | ^ this trait is private + | ^ private trait | note: the trait `B` is defined here --> $DIR/privacy1.rs:40:5 @@ -155,34 +155,34 @@ LL | trait B { | ^^^^^^^ error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:77:9 + --> $DIR/privacy1.rs:77:23 | LL | self::baz::A::bar(); - | ^^^^^^^^^^^^^^^^^ + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:95:5 + --> $DIR/privacy1.rs:95:13 | LL | bar::A::bar(); - | ^^^^^^^^^^^ + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:102:9 + --> $DIR/privacy1.rs:102:19 | LL | ::bar::A::bar(); - | ^^^^^^^^^^^^^ + | ^^^ private associated function error[E0624]: associated function `bar` is private - --> $DIR/privacy1.rs:105:9 + --> $DIR/privacy1.rs:105:24 | LL | ::bar::baz::A::bar(); - | ^^^^^^^^^^^^^^^^^^ + | ^^^ private associated function error[E0624]: associated function `bar2` is private --> $DIR/privacy1.rs:108:23 | LL | ::bar::baz::A.bar2(); - | ^^^^ + | ^^^^ private associated function error: aborting due to 18 previous errors diff --git a/src/test/ui/privacy/privacy2.stderr b/src/test/ui/privacy/privacy2.stderr index b10c3a5265971..c2a33ce1f59b3 100644 --- a/src/test/ui/privacy/privacy2.stderr +++ b/src/test/ui/privacy/privacy2.stderr @@ -8,7 +8,7 @@ error[E0603]: function import `foo` is private --> $DIR/privacy2.rs:23:20 | LL | use bar::glob::foo; - | ^^^ this function import is private + | ^^^ private function import | note: the function import `foo` is defined here... --> $DIR/privacy2.rs:10:13 diff --git a/src/test/ui/privacy/privacy4.stderr b/src/test/ui/privacy/privacy4.stderr index e34b2d5049b9e..7552fa71a3a3a 100644 --- a/src/test/ui/privacy/privacy4.stderr +++ b/src/test/ui/privacy/privacy4.stderr @@ -2,7 +2,7 @@ error[E0603]: module `glob` is private --> $DIR/privacy4.rs:21:14 | LL | use bar::glob::gpriv; - | ^^^^ this module is private + | ^^^^ private module | note: the module `glob` is defined here --> $DIR/privacy4.rs:13:5 diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr index 197a857cc3dc4..216abfc68b812 100644 --- a/src/test/ui/privacy/privacy5.stderr +++ b/src/test/ui/privacy/privacy5.stderr @@ -5,7 +5,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a = a::A(()); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -20,7 +20,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let b = a::B(2); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -35,7 +35,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let c = a::C(2, 3); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -50,7 +50,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a::A(()) = a; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -65,7 +65,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a::A(_) = a; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -80,7 +80,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | match a { a::A(()) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -95,7 +95,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | match a { a::A(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -110,7 +110,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let a::B(_) = b; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -125,7 +125,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let a::B(_b) = b; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -140,7 +140,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -155,7 +155,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(_b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -170,7 +170,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(1) => {} a::B(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -185,7 +185,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | match b { a::B(1) => {} a::B(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -200,7 +200,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_, _) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -215,7 +215,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_a, _) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -230,7 +230,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_, _b) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -245,7 +245,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let a::C(_a, _b) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -260,7 +260,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_, _) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -275,7 +275,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_a, _) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -290,7 +290,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_, _b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -305,7 +305,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | match c { a::C(_a, _b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -320,7 +320,7 @@ LL | pub struct A(()); | -- a constructor is private if any of the fields is private ... LL | let a2 = a::A; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `A` is defined here --> $DIR/privacy5.rs:6:5 @@ -335,7 +335,7 @@ LL | pub struct B(isize); | ----- a constructor is private if any of the fields is private ... LL | let b2 = a::B; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `B` is defined here --> $DIR/privacy5.rs:7:5 @@ -350,7 +350,7 @@ LL | pub struct C(pub isize, isize); | ---------------- a constructor is private if any of the fields is private ... LL | let c2 = a::C; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `C` is defined here --> $DIR/privacy5.rs:8:5 @@ -362,7 +362,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:90:20 | LL | let a = other::A(()); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -379,7 +379,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:91:20 | LL | let b = other::B(2); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -396,7 +396,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:92:20 | LL | let c = other::C(2, 3); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -413,7 +413,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:95:16 | LL | let other::A(()) = a; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -430,7 +430,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:96:16 | LL | let other::A(_) = a; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -447,7 +447,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:97:22 | LL | match a { other::A(()) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -464,7 +464,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:98:22 | LL | match a { other::A(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -481,7 +481,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:100:16 | LL | let other::B(_) = b; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -498,7 +498,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:101:16 | LL | let other::B(_b) = b; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -515,7 +515,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:102:22 | LL | match b { other::B(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -532,7 +532,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:103:22 | LL | match b { other::B(_b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -549,7 +549,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:104:22 | LL | match b { other::B(1) => {} - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -566,7 +566,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:105:16 | LL | other::B(_) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -583,7 +583,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:107:16 | LL | let other::C(_, _) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -600,7 +600,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:108:16 | LL | let other::C(_a, _) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -617,7 +617,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:109:16 | LL | let other::C(_, _b) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -634,7 +634,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:110:16 | LL | let other::C(_a, _b) = c; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -651,7 +651,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:111:22 | LL | match c { other::C(_, _) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -668,7 +668,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:112:22 | LL | match c { other::C(_a, _) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -685,7 +685,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:113:22 | LL | match c { other::C(_, _b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -702,7 +702,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:114:22 | LL | match c { other::C(_a, _b) => {} } - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | @@ -719,7 +719,7 @@ error[E0603]: tuple struct constructor `A` is private --> $DIR/privacy5.rs:122:21 | LL | let a2 = other::A; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | @@ -736,7 +736,7 @@ error[E0603]: tuple struct constructor `B` is private --> $DIR/privacy5.rs:123:21 | LL | let b2 = other::B; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | @@ -753,7 +753,7 @@ error[E0603]: tuple struct constructor `C` is private --> $DIR/privacy5.rs:124:21 | LL | let c2 = other::C; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | diff --git a/src/test/ui/privacy/private-impl-method.stderr b/src/test/ui/privacy/private-impl-method.stderr index 6833cdb4df9db..444b9180b3f59 100644 --- a/src/test/ui/privacy/private-impl-method.stderr +++ b/src/test/ui/privacy/private-impl-method.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `foo` is private --> $DIR/private-impl-method.rs:20:7 | LL | s.foo(); - | ^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/privacy/private-in-public-non-principal-2.stderr b/src/test/ui/privacy/private-in-public-non-principal-2.stderr index 2db4925722642..1b6d143b93217 100644 --- a/src/test/ui/privacy/private-in-public-non-principal-2.stderr +++ b/src/test/ui/privacy/private-in-public-non-principal-2.stderr @@ -2,7 +2,7 @@ error: trait `m::PrivNonPrincipal` is private --> $DIR/private-in-public-non-principal-2.rs:11:5 | LL | m::leak_dyn_nonprincipal(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ private trait error: aborting due to previous error diff --git a/src/test/ui/privacy/private-inferred-type-1.stderr b/src/test/ui/privacy/private-inferred-type-1.stderr index 097b8b9a61eff..576498b2cf8ef 100644 --- a/src/test/ui/privacy/private-inferred-type-1.stderr +++ b/src/test/ui/privacy/private-inferred-type-1.stderr @@ -2,13 +2,13 @@ error: type `m::Priv` is private --> $DIR/private-inferred-type-1.rs:16:5 | LL | [].arr0_secret(); - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type-1.rs:17:5 | LL | None.ty_param_secret(); - | ^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^ private type error: aborting due to 2 previous errors diff --git a/src/test/ui/privacy/private-inferred-type-2.stderr b/src/test/ui/privacy/private-inferred-type-2.stderr index da95cc49241ae..f19e367ef110e 100644 --- a/src/test/ui/privacy/private-inferred-type-2.stderr +++ b/src/test/ui/privacy/private-inferred-type-2.stderr @@ -2,19 +2,19 @@ error: type `m::Priv` is private --> $DIR/private-inferred-type-2.rs:16:5 | LL | m::Pub::get_priv; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type-2.rs:17:5 | LL | m::Pub::static_method; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ private type error: type `ext::Priv` is private --> $DIR/private-inferred-type-2.rs:18:5 | LL | ext::Pub::static_method; - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ private type error: aborting due to 3 previous errors diff --git a/src/test/ui/privacy/private-inferred-type-3.stderr b/src/test/ui/privacy/private-inferred-type-3.stderr index 376f1334ff806..39ef6472526c3 100644 --- a/src/test/ui/privacy/private-inferred-type-3.stderr +++ b/src/test/ui/privacy/private-inferred-type-3.stderr @@ -2,7 +2,7 @@ error: type `fn() {ext::priv_fn}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -10,7 +10,7 @@ error: static `PRIV_STATIC` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private static | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -18,7 +18,7 @@ error: type `ext::PrivEnum` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -26,7 +26,7 @@ error: type `fn() {::method}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -34,7 +34,7 @@ error: type `fn(u8) -> ext::PrivTupleStruct {ext::PrivTupleStruct}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -42,7 +42,7 @@ error: type `fn(u8) -> ext::PubTupleStruct {ext::PubTupleStruct}` is private --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -50,7 +50,7 @@ error: type `for<'r> fn(&'r ext::Pub) {ext::Pub::::priv_method}` is priv --> $DIR/private-inferred-type-3.rs:16:5 | LL | ext::m!(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type | = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/privacy/private-inferred-type.stderr b/src/test/ui/privacy/private-inferred-type.stderr index 48c83c2186591..7d1f794bfe459 100644 --- a/src/test/ui/privacy/private-inferred-type.stderr +++ b/src/test/ui/privacy/private-inferred-type.stderr @@ -20,97 +20,97 @@ error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:97:9 | LL | let _: m::Alias; - | ^ + | ^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:97:12 | LL | let _: m::Alias; - | ^^^^^^^^ + | ^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:99:13 | LL | let _: ::AssocTy; - | ^^^^^^^^ + | ^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:100:5 | LL | m::Alias {}; - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:101:5 | LL | m::Pub { 0: m::Alias {} }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:103:5 | LL | m::Pub::static_method; - | ^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:104:5 | LL | m::Pub::INHERENT_ASSOC_CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:105:5 | LL | m::Pub(0u8).method_with_substs::(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:106:17 | LL | m::Pub(0u8).method_with_priv_params(loop{}); - | ^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:107:5 | LL | ::TRAIT_ASSOC_CONST; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:108:6 | LL | >::INHERENT_ASSOC_CONST; - | ^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:109:5 | LL | >::INHERENT_ASSOC_CONST_GENERIC_SELF; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:110:5 | LL | >::static_method_generic_self; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:112:5 | LL | u8::pub_method; - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ private type error: type `adjust::S2` is private --> $DIR/private-inferred-type.rs:114:5 | LL | adjust::S1.method_s3(); - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type error: type `fn() {m::priv_fn}` is private --> $DIR/private-inferred-type.rs:39:9 | LL | priv_fn; - | ^^^^^^^ + | ^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -121,7 +121,7 @@ error: type `m::PrivEnum` is private --> $DIR/private-inferred-type.rs:41:9 | LL | PrivEnum::Variant; - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -132,7 +132,7 @@ error: type `fn() {::method}` is private --> $DIR/private-inferred-type.rs:43:9 | LL | ::method; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -143,7 +143,7 @@ error: type `fn(u8) -> m::PrivTupleStruct {m::PrivTupleStruct}` is private --> $DIR/private-inferred-type.rs:45:9 | LL | PrivTupleStruct; - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -154,7 +154,7 @@ error: type `fn(u8) -> m::PubTupleStruct {m::PubTupleStruct}` is private --> $DIR/private-inferred-type.rs:47:9 | LL | PubTupleStruct; - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -165,7 +165,7 @@ error: type `for<'r> fn(&'r m::Pub) {m::Pub::::priv_method}` is private --> $DIR/private-inferred-type.rs:49:18 | LL | Pub(0u8).priv_method(); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type ... LL | m::m!(); | -------- in this macro invocation @@ -176,61 +176,61 @@ error: trait `m::Trait` is private --> $DIR/private-inferred-type.rs:118:5 | LL | m::leak_anon1(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ private trait error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:119:5 | LL | m::leak_anon2(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:120:5 | LL | m::leak_anon3(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^ private type error: trait `m::Trait` is private --> $DIR/private-inferred-type.rs:122:5 | LL | m::leak_dyn1(); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ private trait error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:123:5 | LL | m::leak_dyn2(); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:124:5 | LL | m::leak_dyn3(); - | ^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:127:13 | LL | let a = m::Alias {}; - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:128:17 | LL | let mut b = a; - | ^ + | ^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:129:9 | LL | b = a; - | ^ + | ^ private type error: type `m::Priv` is private --> $DIR/private-inferred-type.rs:130:11 | LL | match a { - | ^ + | ^ private type error: aborting due to 33 previous errors diff --git a/src/test/ui/privacy/private-item-simple.stderr b/src/test/ui/privacy/private-item-simple.stderr index f51b74f6cb53b..e3d90150e2e3e 100644 --- a/src/test/ui/privacy/private-item-simple.stderr +++ b/src/test/ui/privacy/private-item-simple.stderr @@ -2,7 +2,7 @@ error[E0603]: function `f` is private --> $DIR/private-item-simple.rs:6:8 | LL | a::f(); - | ^ this function is private + | ^ private function | note: the function `f` is defined here --> $DIR/private-item-simple.rs:2:5 diff --git a/src/test/ui/privacy/private-method-cross-crate.stderr b/src/test/ui/privacy/private-method-cross-crate.stderr index 6b49063815a66..8a47846d667e3 100644 --- a/src/test/ui/privacy/private-method-cross-crate.stderr +++ b/src/test/ui/privacy/private-method-cross-crate.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `nap` is private --> $DIR/private-method-cross-crate.rs:7:8 | LL | nyan.nap(); - | ^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/privacy/private-method-inherited.stderr b/src/test/ui/privacy/private-method-inherited.stderr index 5551e1bd75907..8083b197a5d78 100644 --- a/src/test/ui/privacy/private-method-inherited.stderr +++ b/src/test/ui/privacy/private-method-inherited.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `f` is private --> $DIR/private-method-inherited.rs:13:7 | LL | x.f(); - | ^ + | ^ private associated function error: aborting due to previous error diff --git a/src/test/ui/privacy/private-method.stderr b/src/test/ui/privacy/private-method.stderr index 583dc123e246b..a15fce46877ce 100644 --- a/src/test/ui/privacy/private-method.stderr +++ b/src/test/ui/privacy/private-method.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `nap` is private --> $DIR/private-method.rs:22:8 | LL | nyan.nap(); - | ^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/privacy/private-struct-field-cross-crate.stderr b/src/test/ui/privacy/private-struct-field-cross-crate.stderr index 857f2436aa829..ac00d82adab42 100644 --- a/src/test/ui/privacy/private-struct-field-cross-crate.stderr +++ b/src/test/ui/privacy/private-struct-field-cross-crate.stderr @@ -1,8 +1,8 @@ error[E0616]: field `meows` of struct `cci_class::kitties::cat` is private - --> $DIR/private-struct-field-cross-crate.rs:7:14 + --> $DIR/private-struct-field-cross-crate.rs:7:19 | LL | assert_eq!(nyan.meows, 52); - | ^^^^^^^^^^ + | ^^^^^ private field error: aborting due to previous error diff --git a/src/test/ui/privacy/private-struct-field-ctor.stderr b/src/test/ui/privacy/private-struct-field-ctor.stderr index 97585c1d8805b..7c32ebc2cf7b9 100644 --- a/src/test/ui/privacy/private-struct-field-ctor.stderr +++ b/src/test/ui/privacy/private-struct-field-ctor.stderr @@ -2,7 +2,7 @@ error[E0451]: field `x` of struct `a::Foo` is private --> $DIR/private-struct-field-ctor.rs:8:22 | LL | let s = a::Foo { x: 1 }; - | ^^^^ field `x` is private + | ^^^^ private field error: aborting due to previous error diff --git a/src/test/ui/privacy/private-struct-field-pattern.stderr b/src/test/ui/privacy/private-struct-field-pattern.stderr index 69bd58aacfc54..9190317403ec1 100644 --- a/src/test/ui/privacy/private-struct-field-pattern.stderr +++ b/src/test/ui/privacy/private-struct-field-pattern.stderr @@ -2,7 +2,7 @@ error[E0451]: field `x` of struct `a::Foo` is private --> $DIR/private-struct-field-pattern.rs:15:15 | LL | Foo { x: _ } => {} - | ^^^^ field `x` is private + | ^^^^ private field error: aborting due to previous error diff --git a/src/test/ui/privacy/private-struct-field.stderr b/src/test/ui/privacy/private-struct-field.stderr index da53c73b4311c..c89ae507ab5fd 100644 --- a/src/test/ui/privacy/private-struct-field.stderr +++ b/src/test/ui/privacy/private-struct-field.stderr @@ -1,8 +1,8 @@ error[E0616]: field `meows` of struct `cat::Cat` is private - --> $DIR/private-struct-field.rs:13:16 + --> $DIR/private-struct-field.rs:13:21 | LL | assert_eq!(nyan.meows, 52); - | ^^^^^^^^^^ + | ^^^^^ private field error: aborting due to previous error diff --git a/src/test/ui/privacy/private-type-in-interface.stderr b/src/test/ui/privacy/private-type-in-interface.stderr index aa4bfb7fc9a19..ea89035c3d006 100644 --- a/src/test/ui/privacy/private-type-in-interface.stderr +++ b/src/test/ui/privacy/private-type-in-interface.stderr @@ -2,55 +2,55 @@ error: type `m::Priv` is private --> $DIR/private-type-in-interface.rs:15:9 | LL | fn f(_: m::Alias) {} - | ^^^^^^^^ + | ^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-type-in-interface.rs:15:6 | LL | fn f(_: m::Alias) {} - | ^ + | ^ private type error: type `ext::Priv` is private --> $DIR/private-type-in-interface.rs:17:13 | LL | fn f_ext(_: ext::Alias) {} - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type error: type `ext::Priv` is private --> $DIR/private-type-in-interface.rs:17:10 | LL | fn f_ext(_: ext::Alias) {} - | ^ + | ^ private type error: type `m::Priv` is private --> $DIR/private-type-in-interface.rs:21:6 | LL | impl m::Alias {} - | ^^^^^^^^ + | ^^^^^^^^ private type error: type `ext::Priv` is private --> $DIR/private-type-in-interface.rs:22:14 | LL | impl Tr1 for ext::Alias {} - | ^^^^^^^^^^ + | ^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-type-in-interface.rs:23:10 | LL | type A = ::X; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^ private type error: type `m::Priv` is private --> $DIR/private-type-in-interface.rs:27:11 | LL | fn g() -> impl Tr2 { 0 } - | ^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ private type error: type `ext::Priv` is private --> $DIR/private-type-in-interface.rs:28:15 | LL | fn g_ext() -> impl Tr2 { 0 } - | ^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^ private type error: aborting due to 9 previous errors diff --git a/src/test/ui/privacy/restricted/struct-literal-field.stderr b/src/test/ui/privacy/restricted/struct-literal-field.stderr index dd609944a4b3f..591980dc3450d 100644 --- a/src/test/ui/privacy/restricted/struct-literal-field.stderr +++ b/src/test/ui/privacy/restricted/struct-literal-field.stderr @@ -2,7 +2,7 @@ error[E0451]: field `x` of struct `foo::bar::S` is private --> $DIR/struct-literal-field.rs:18:9 | LL | S { x: 0 }; - | ^^^^ field `x` is private + | ^^^^ private field error: aborting due to previous error diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index e73f723ed0ab6..40512a34bd959 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -26,7 +26,7 @@ error[E0603]: struct `Crate` is private --> $DIR/test.rs:38:25 | LL | use pub_restricted::Crate; - | ^^^^^ this struct is private + | ^^^^^ private struct | note: the struct `Crate` is defined here --> $DIR/auxiliary/pub_restricted.rs:3:1 @@ -38,7 +38,7 @@ error[E0603]: function `f` is private --> $DIR/test.rs:30:19 | LL | use foo::bar::f; - | ^ this function is private + | ^ private function | note: the function `f` is defined here --> $DIR/test.rs:8:9 @@ -47,46 +47,46 @@ LL | pub(super) fn f() {} | ^^^^^^^^^^^^^^^^^ error[E0616]: field `x` of struct `foo::bar::S` is private - --> $DIR/test.rs:31:5 + --> $DIR/test.rs:31:18 | LL | S::default().x; - | ^^^^^^^^^^^^^^ + | ^ private field error[E0624]: associated function `f` is private --> $DIR/test.rs:32:18 | LL | S::default().f(); - | ^ + | ^ private associated function error[E0624]: associated function `g` is private - --> $DIR/test.rs:33:5 + --> $DIR/test.rs:33:8 | LL | S::g(); - | ^^^^ + | ^ private associated function error[E0616]: field `y` of struct `pub_restricted::Universe` is private - --> $DIR/test.rs:42:13 + --> $DIR/test.rs:42:15 | LL | let _ = u.y; - | ^^^ + | ^ private field error[E0616]: field `z` of struct `pub_restricted::Universe` is private - --> $DIR/test.rs:43:13 + --> $DIR/test.rs:43:15 | LL | let _ = u.z; - | ^^^ + | ^ private field error[E0624]: associated function `g` is private --> $DIR/test.rs:45:7 | LL | u.g(); - | ^ + | ^ private associated function error[E0624]: associated function `h` is private --> $DIR/test.rs:46:7 | LL | u.h(); - | ^ + | ^ private associated function error: aborting due to 12 previous errors diff --git a/src/test/ui/privacy/union-field-privacy-1.stderr b/src/test/ui/privacy/union-field-privacy-1.stderr index 96a1d7ed5090a..15096eb113966 100644 --- a/src/test/ui/privacy/union-field-privacy-1.stderr +++ b/src/test/ui/privacy/union-field-privacy-1.stderr @@ -2,13 +2,13 @@ error[E0451]: field `c` of union `m::U` is private --> $DIR/union-field-privacy-1.rs:12:20 | LL | let u = m::U { c: 0 }; - | ^^^^ field `c` is private + | ^^^^ private field error[E0451]: field `c` of union `m::U` is private --> $DIR/union-field-privacy-1.rs:16:16 | LL | let m::U { c } = u; - | ^ field `c` is private + | ^ private field error: aborting due to 2 previous errors diff --git a/src/test/ui/privacy/union-field-privacy-2.stderr b/src/test/ui/privacy/union-field-privacy-2.stderr index 8789178caac26..a23cf90332b02 100644 --- a/src/test/ui/privacy/union-field-privacy-2.stderr +++ b/src/test/ui/privacy/union-field-privacy-2.stderr @@ -1,8 +1,8 @@ error[E0616]: field `c` of union `m::U` is private - --> $DIR/union-field-privacy-2.rs:14:13 + --> $DIR/union-field-privacy-2.rs:14:15 | LL | let c = u.c; - | ^^^ + | ^ private field error: aborting due to previous error diff --git a/src/test/ui/proc-macro/disappearing-resolution.stderr b/src/test/ui/proc-macro/disappearing-resolution.stderr index 3beaedf61d73a..ff7ddcde6e0c4 100644 --- a/src/test/ui/proc-macro/disappearing-resolution.stderr +++ b/src/test/ui/proc-macro/disappearing-resolution.stderr @@ -8,7 +8,7 @@ error[E0603]: derive macro import `Empty` is private --> $DIR/disappearing-resolution.rs:11:8 | LL | use m::Empty; - | ^^^^^ this derive macro import is private + | ^^^^^ private derive macro import | note: the derive macro import `Empty` is defined here --> $DIR/disappearing-resolution.rs:9:9 diff --git a/src/test/ui/proc-macro/issue-50493.stderr b/src/test/ui/proc-macro/issue-50493.stderr index 7997786b50bc9..e378a56713400 100644 --- a/src/test/ui/proc-macro/issue-50493.stderr +++ b/src/test/ui/proc-macro/issue-50493.stderr @@ -8,7 +8,7 @@ error[E0616]: field `field` of struct `Restricted` is private --> $DIR/issue-50493.rs:6:10 | LL | #[derive(Derive)] - | ^^^^^^ + | ^^^^^^ private field | = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) @@ -16,7 +16,7 @@ error[E0616]: field `field` of struct `Restricted` is private --> $DIR/issue-50493.rs:6:10 | LL | #[derive(Derive)] - | ^^^^^^ + | ^^^^^^ private field | = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index 73a6ab1cfb910..15a1d6d9479fe 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -18,24 +18,20 @@ LL | Dlona!(); error: cannot find macro `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:58:5 | -LL | / macro_rules! attr_proc_mac { -LL | | () => {} -LL | | } - | |_- similarly named macro `attr_proc_mac` defined here +LL | macro_rules! attr_proc_mac { + | -------------------------- similarly named macro `attr_proc_mac` defined here ... -LL | attr_proc_macra!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac` +LL | attr_proc_macra!(); + | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac` error: cannot find macro `FooWithLongNama` in this scope --> $DIR/resolve-error.rs:55:5 | -LL | / macro_rules! FooWithLongNam { -LL | | () => {} -LL | | } - | |_- similarly named macro `FooWithLongNam` defined here +LL | macro_rules! FooWithLongNam { + | --------------------------- similarly named macro `FooWithLongNam` defined here ... -LL | FooWithLongNama!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam` +LL | FooWithLongNama!(); + | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam` error: cannot find derive macro `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:49:10 diff --git a/src/test/ui/question-mark-type-infer.stderr b/src/test/ui/question-mark-type-infer.stderr index 7911701946cd3..262344fba5999 100644 --- a/src/test/ui/question-mark-type-infer.stderr +++ b/src/test/ui/question-mark-type-infer.stderr @@ -2,12 +2,13 @@ error[E0284]: type annotations needed --> $DIR/question-mark-type-infer.rs:12:21 | LL | l.iter().map(f).collect()? - | ^^^^^^^ - | | - | cannot infer type - | help: consider specifying the type argument in the method call: `collect::` + | ^^^^^^^ cannot infer type | = note: cannot resolve `<_ as std::ops::Try>::Ok == _` +help: consider specifying the type argument in the method call + | +LL | l.iter().map(f).collect::()? + | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/reachable/unreachable-variant.stderr b/src/test/ui/reachable/unreachable-variant.stderr index c2e1d774e28ac..6c27a2756f7fb 100644 --- a/src/test/ui/reachable/unreachable-variant.stderr +++ b/src/test/ui/reachable/unreachable-variant.stderr @@ -2,7 +2,7 @@ error[E0603]: module `super_sekrit` is private --> $DIR/unreachable-variant.rs:6:21 | LL | let _x = other::super_sekrit::sooper_sekrit::baz; - | ^^^^^^^^^^^^ this module is private + | ^^^^^^^^^^^^ private module | note: the module `super_sekrit` is defined here --> $DIR/auxiliary/unreachable_variant.rs:1:1 diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index aa23aed4b425a..a91c4dd35e467 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -3,6 +3,11 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(x) = res; | ^^^^^ pattern `Err(_)` not covered + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | --- not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html diff --git a/src/test/ui/reify-intrinsic.stderr b/src/test/ui/reify-intrinsic.stderr index 4defe12b1b37b..c4eee0f466119 100644 --- a/src/test/ui/reify-intrinsic.stderr +++ b/src/test/ui/reify-intrinsic.stderr @@ -2,14 +2,16 @@ error[E0308]: cannot coerce intrinsics to function pointers --> $DIR/reify-intrinsic.rs:6:64 | LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute; - | ------------------------------------------------- ^^^^^^^^^^^^^^^^^^^ - | | | - | | cannot coerce intrinsics to function pointers - | | help: use parentheses to call this function: `std::mem::transmute(...)` + | ------------------------------------------------- ^^^^^^^^^^^^^^^^^^^ cannot coerce intrinsics to function pointers + | | | expected due to this | = note: expected fn pointer `unsafe extern "rust-intrinsic" fn(isize) -> usize` found fn item `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` +help: use parentheses to call this function + | +LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute(...); + | ^^^^^ error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {std::intrinsics::transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid --> $DIR/reify-intrinsic.rs:11:13 diff --git a/src/test/ui/resolve/issue-3907-2.stderr b/src/test/ui/resolve/issue-3907-2.stderr index d0c278d12d70a..bd6e9d5950272 100644 --- a/src/test/ui/resolve/issue-3907-2.stderr +++ b/src/test/ui/resolve/issue-3907-2.stderr @@ -3,8 +3,11 @@ error[E0038]: the trait `issue_3907::Foo` cannot be made into an object | LL | fn bar(_x: Foo) {} | ^^^ the trait `issue_3907::Foo` cannot be made into an object + | + ::: $DIR/auxiliary/issue-3907.rs:2:8 | - = note: the trait cannot be made into an object because associated function `bar` has no `self` parameter +LL | fn bar(); + | --- the trait cannot be made into an object because associated function `bar` has no `self` parameter error: aborting due to previous error diff --git a/src/test/ui/resolve/issue-5035.stderr b/src/test/ui/resolve/issue-5035.stderr index 1674c166ddacb..622f0dfcda4cb 100644 --- a/src/test/ui/resolve/issue-5035.stderr +++ b/src/test/ui/resolve/issue-5035.stderr @@ -8,7 +8,7 @@ error[E0404]: expected trait, found type alias `K` --> $DIR/issue-5035.rs:3:6 | LL | trait I {} - | ---------- similarly named trait `I` defined here + | ------- similarly named trait `I` defined here LL | type K = dyn I; LL | impl K for isize {} | ^ diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index a622d6cb34948..ecdec3c24a1d8 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -8,7 +8,7 @@ error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:14:10 | LL | enum Bar { } - | ------------ similarly named enum `Bar` defined here + | -------- similarly named enum `Bar` defined here LL | LL | type A = Baz; // Misspelled type name. | ^^^ help: an enum with a similar name exists: `Bar` @@ -43,7 +43,7 @@ error[E0425]: cannot find function `foobar` in this scope --> $DIR/levenshtein.rs:30:5 | LL | fn foo_bar() {} - | --------------- similarly named function `foo_bar` defined here + | ------------ similarly named function `foo_bar` defined here ... LL | foobar(); // Misspelled function name. | ^^^^^^ help: a function with a similar name exists: `foo_bar` diff --git a/src/test/ui/resolve/privacy-enum-ctor.stderr b/src/test/ui/resolve/privacy-enum-ctor.stderr index 08a1d790197a6..30ac783ea2f7e 100644 --- a/src/test/ui/resolve/privacy-enum-ctor.stderr +++ b/src/test/ui/resolve/privacy-enum-ctor.stderr @@ -16,15 +16,11 @@ LL | m::Z::Unit; error[E0423]: expected value, found enum `Z` --> $DIR/privacy-enum-ctor.rs:25:9 | -LL | / fn f() { -LL | | n::Z; -LL | | -LL | | Z; - | | ^ -... | -LL | | // This is ok, it is equivalent to not having braces -LL | | } - | |_____- similarly named function `f` defined here +LL | fn f() { + | ------ similarly named function `f` defined here +... +LL | Z; + | ^ | help: a function with a similar name exists | @@ -53,17 +49,11 @@ LL | let _: Z = Z::Struct; error[E0423]: expected value, found enum `m::E` --> $DIR/privacy-enum-ctor.rs:41:16 | -LL | / fn f() { -LL | | n::Z; -LL | | -LL | | Z; -... | -LL | | // This is ok, it is equivalent to not having braces -LL | | } - | |_____- similarly named function `f` defined here +LL | fn f() { + | ------ similarly named function `f` defined here ... -LL | let _: E = m::E; - | ^^^^ +LL | let _: E = m::E; + | ^^^^ | help: a function with a similar name exists | @@ -130,17 +120,11 @@ LL | let _: E = E::Struct; error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:57:12 | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____- similarly named enum `E` defined here +LL | pub enum E { + | ---------- similarly named enum `E` defined here ... -LL | let _: Z = m::n::Z; - | ^ +LL | let _: Z = m::n::Z; + | ^ | help: an enum with a similar name exists | @@ -169,17 +153,11 @@ LL | let _: Z = m::Z::Unit; error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:61:12 | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____- similarly named enum `E` defined here +LL | pub enum E { + | ---------- similarly named enum `E` defined here ... -LL | let _: Z = m::n::Z::Fn; - | ^ +LL | let _: Z = m::n::Z::Fn; + | ^ | help: an enum with a similar name exists | @@ -193,17 +171,11 @@ LL | use m::n::Z; error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:64:12 | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____- similarly named enum `E` defined here +LL | pub enum E { + | ---------- similarly named enum `E` defined here ... -LL | let _: Z = m::n::Z::Struct; - | ^ +LL | let _: Z = m::n::Z::Struct; + | ^ | help: an enum with a similar name exists | @@ -228,17 +200,11 @@ LL | let _: Z = m::n::Z::Struct; error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:68:12 | -LL | / pub enum E { -LL | | Fn(u8), -LL | | Struct { -LL | | s: u8, -LL | | }, -LL | | Unit, -LL | | } - | |_____- similarly named enum `E` defined here +LL | pub enum E { + | ---------- similarly named enum `E` defined here ... -LL | let _: Z = m::n::Z::Unit {}; - | ^ +LL | let _: Z = m::n::Z::Unit {}; + | ^ | help: an enum with a similar name exists | @@ -253,7 +219,7 @@ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:57:22 | LL | let _: Z = m::n::Z; - | ^ this enum is private + | ^ private enum | note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 @@ -265,7 +231,7 @@ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:61:22 | LL | let _: Z = m::n::Z::Fn; - | ^ this enum is private + | ^ private enum | note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 @@ -277,7 +243,7 @@ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:64:22 | LL | let _: Z = m::n::Z::Struct; - | ^ this enum is private + | ^ private enum | note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 @@ -289,7 +255,7 @@ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:68:22 | LL | let _: Z = m::n::Z::Unit {}; - | ^ this enum is private + | ^ private enum | note: the enum `Z` is defined here --> $DIR/privacy-enum-ctor.rs:11:9 @@ -304,14 +270,16 @@ LL | Fn(u8), | ------ fn(u8) -> m::n::Z {m::n::Z::Fn} defined here ... LL | let _: Z = Z::Fn; - | - ^^^^^ - | | | - | | expected enum `m::n::Z`, found fn item - | | help: use parentheses to instantiate this tuple variant: `Z::Fn(_)` + | - ^^^^^ expected enum `m::n::Z`, found fn item + | | | expected due to this | = note: expected enum `m::n::Z` found fn item `fn(u8) -> m::n::Z {m::n::Z::Fn}` +help: use parentheses to instantiate this tuple variant + | +LL | let _: Z = Z::Fn(_); + | ^^^ error[E0618]: expected function, found enum variant `Z::Unit` --> $DIR/privacy-enum-ctor.rs:31:17 @@ -336,14 +304,16 @@ LL | Fn(u8), | ------ fn(u8) -> m::E {m::E::Fn} defined here ... LL | let _: E = m::E::Fn; - | - ^^^^^^^^ - | | | - | | expected enum `m::E`, found fn item - | | help: use parentheses to instantiate this tuple variant: `m::E::Fn(_)` + | - ^^^^^^^^ expected enum `m::E`, found fn item + | | | expected due to this | = note: expected enum `m::E` found fn item `fn(u8) -> m::E {m::E::Fn}` +help: use parentheses to instantiate this tuple variant + | +LL | let _: E = m::E::Fn(_); + | ^^^ error[E0618]: expected function, found enum variant `m::E::Unit` --> $DIR/privacy-enum-ctor.rs:47:16 @@ -368,14 +338,16 @@ LL | Fn(u8), | ------ fn(u8) -> m::E {m::E::Fn} defined here ... LL | let _: E = E::Fn; - | - ^^^^^ - | | | - | | expected enum `m::E`, found fn item - | | help: use parentheses to instantiate this tuple variant: `E::Fn(_)` + | - ^^^^^ expected enum `m::E`, found fn item + | | | expected due to this | = note: expected enum `m::E` found fn item `fn(u8) -> m::E {m::E::Fn}` +help: use parentheses to instantiate this tuple variant + | +LL | let _: E = E::Fn(_); + | ^^^ error[E0618]: expected function, found enum variant `E::Unit` --> $DIR/privacy-enum-ctor.rs:55:16 diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index 1673ec46ba488..baf7dd84eb09d 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -45,7 +45,7 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | --------------- a constructor is private if any of the fields is private ... LL | n::Z; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `Z` is defined here --> $DIR/privacy-struct-ctor.rs:12:9 @@ -60,7 +60,7 @@ LL | pub struct S(u8); | -- a constructor is private if any of the fields is private ... LL | m::S; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `S` is defined here --> $DIR/privacy-struct-ctor.rs:6:5 @@ -75,7 +75,7 @@ LL | pub struct S(u8); | -- a constructor is private if any of the fields is private ... LL | let _: S = m::S(2); - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `S` is defined here --> $DIR/privacy-struct-ctor.rs:6:5 @@ -90,7 +90,7 @@ LL | pub(in m) struct Z(pub(in m::n) u8); | --------------- a constructor is private if any of the fields is private ... LL | m::n::Z; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | note: the tuple struct constructor `Z` is defined here --> $DIR/privacy-struct-ctor.rs:12:9 @@ -102,7 +102,7 @@ error[E0603]: tuple struct constructor `S` is private --> $DIR/privacy-struct-ctor.rs:41:16 | LL | xcrate::m::S; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 | @@ -119,7 +119,7 @@ error[E0603]: tuple struct constructor `Z` is private --> $DIR/privacy-struct-ctor.rs:45:19 | LL | xcrate::m::n::Z; - | ^ this tuple struct constructor is private + | ^ private tuple struct constructor | ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 | diff --git a/src/test/ui/resolve/resolve-hint-macro.stderr b/src/test/ui/resolve/resolve-hint-macro.stderr index ebe3c36f21eb1..361da4cc78e00 100644 --- a/src/test/ui/resolve/resolve-hint-macro.stderr +++ b/src/test/ui/resolve/resolve-hint-macro.stderr @@ -2,7 +2,12 @@ error[E0423]: expected function, found macro `assert` --> $DIR/resolve-hint-macro.rs:2:5 | LL | assert(true); - | ^^^^^^ help: use `!` to invoke the macro: `assert!` + | ^^^^^^ + | +help: use `!` to invoke the macro + | +LL | assert!(true); + | ^ error: aborting due to previous error diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr index f992988c93fcc..4e91e7bff34b2 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr @@ -14,7 +14,7 @@ error[E0603]: tuple struct constructor `TupleStruct` is private --> $DIR/struct.rs:23:32 | LL | let ts_explicit = structs::TupleStruct(640, 480); - | ^^^^^^^^^^^ this tuple struct constructor is private + | ^^^^^^^^^^^ private tuple struct constructor | ::: $DIR/auxiliary/structs.rs:11:24 | @@ -31,7 +31,7 @@ error[E0603]: unit struct `UnitStruct` is private --> $DIR/struct.rs:32:32 | LL | let us_explicit = structs::UnitStruct; - | ^^^^^^^^^^ this unit struct is private + | ^^^^^^^^^^ private unit struct | note: the unit struct `UnitStruct` is defined here --> $DIR/auxiliary/structs.rs:8:1 diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr index ccc25a184e946..a214a652a387f 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr @@ -27,6 +27,13 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere | LL | match x {} | ^ patterns `Tuple(_)` and `Struct { .. }` not covered + | + ::: $DIR/auxiliary/uninhabited.rs:17:23 + | +LL | #[non_exhaustive] Tuple(!), + | ----- not covered +LL | #[non_exhaustive] Struct { x: ! } + | ------ not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr index a54885c96e5ee..63564e9c3cc8c 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr @@ -27,6 +27,13 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere | LL | match x {} | ^ patterns `Tuple(_)` and `Struct { .. }` not covered + | + ::: $DIR/auxiliary/uninhabited.rs:17:23 + | +LL | #[non_exhaustive] Tuple(!), + | ----- not covered +LL | #[non_exhaustive] Struct { x: ! } + | ------ not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms diff --git a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr index 2a438753a2c70..ae4f6aff11a02 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/variant.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/variant.stderr @@ -2,7 +2,7 @@ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:11:48 | LL | let variant_tuple = NonExhaustiveVariants::Tuple(640); - | ^^^^^ this tuple variant is private + | ^^^^^ private tuple variant | note: the tuple variant `Tuple` is defined here --> $DIR/auxiliary/variants.rs:5:23 @@ -14,7 +14,7 @@ error[E0603]: unit variant `Unit` is private --> $DIR/variant.rs:14:47 | LL | let variant_unit = NonExhaustiveVariants::Unit; - | ^^^^ this unit variant is private + | ^^^^ private unit variant | note: the unit variant `Unit` is defined here --> $DIR/auxiliary/variants.rs:4:23 @@ -26,7 +26,7 @@ error[E0603]: unit variant `Unit` is private --> $DIR/variant.rs:18:32 | LL | NonExhaustiveVariants::Unit => "", - | ^^^^ this unit variant is private + | ^^^^ private unit variant | note: the unit variant `Unit` is defined here --> $DIR/auxiliary/variants.rs:4:23 @@ -38,7 +38,7 @@ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:20:32 | LL | NonExhaustiveVariants::Tuple(fe_tpl) => "", - | ^^^^^ this tuple variant is private + | ^^^^^ private tuple variant | note: the tuple variant `Tuple` is defined here --> $DIR/auxiliary/variants.rs:5:23 @@ -50,7 +50,7 @@ error[E0603]: tuple variant `Tuple` is private --> $DIR/variant.rs:26:35 | LL | if let NonExhaustiveVariants::Tuple(fe_tpl) = variant_struct { - | ^^^^^ this tuple variant is private + | ^^^^^ private tuple variant | note: the tuple variant `Tuple` is defined here --> $DIR/auxiliary/variants.rs:5:23 diff --git a/src/test/ui/shadowed/shadowed-use-visibility.stderr b/src/test/ui/shadowed/shadowed-use-visibility.stderr index 2244f3a46b266..1a642ae6e8ed8 100644 --- a/src/test/ui/shadowed/shadowed-use-visibility.stderr +++ b/src/test/ui/shadowed/shadowed-use-visibility.stderr @@ -2,7 +2,7 @@ error[E0603]: module import `bar` is private --> $DIR/shadowed-use-visibility.rs:9:14 | LL | use foo::bar::f as g; - | ^^^ this module import is private + | ^^^ private module import | note: the module import `bar` is defined here... --> $DIR/shadowed-use-visibility.rs:4:9 @@ -19,7 +19,7 @@ error[E0603]: module import `f` is private --> $DIR/shadowed-use-visibility.rs:15:10 | LL | use bar::f::f; - | ^ this module import is private + | ^ private module import | note: the module import `f` is defined here... --> $DIR/shadowed-use-visibility.rs:11:9 diff --git a/src/test/ui/span/type-annotations-needed-expr.stderr b/src/test/ui/span/type-annotations-needed-expr.stderr index 35d994e194f3f..3e6d350b36c33 100644 --- a/src/test/ui/span/type-annotations-needed-expr.stderr +++ b/src/test/ui/span/type-annotations-needed-expr.stderr @@ -2,12 +2,13 @@ error[E0282]: type annotations needed --> $DIR/type-annotations-needed-expr.rs:2:39 | LL | let _ = (vec![1,2,3]).into_iter().sum() as f64; - | ^^^ - | | - | cannot infer type for type parameter `S` declared on the associated function `sum` - | help: consider specifying the type argument in the method call: `sum::` + | ^^^ cannot infer type for type parameter `S` declared on the associated function `sum` | = note: type must be known at this point +help: consider specifying the type argument in the method call + | +LL | let _ = (vec![1,2,3]).into_iter().sum::() as f64; + | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/stability-in-private-module.stderr b/src/test/ui/stability-in-private-module.stderr index 3a974164f9473..35a09b2199591 100644 --- a/src/test/ui/stability-in-private-module.stderr +++ b/src/test/ui/stability-in-private-module.stderr @@ -2,7 +2,7 @@ error[E0603]: module `thread_info` is private --> $DIR/stability-in-private-module.rs:7:26 | LL | let _ = std::thread::thread_info::current_thread(); - | ^^^^^^^^^^^ this module is private + | ^^^^^^^^^^^ private module | note: the module `thread_info` is defined here --> $SRC_DIR/libstd/thread/mod.rs:LL:COL diff --git a/src/test/ui/static/static-method-privacy.stderr b/src/test/ui/static/static-method-privacy.stderr index 78d211438cc92..569608780def9 100644 --- a/src/test/ui/static/static-method-privacy.stderr +++ b/src/test/ui/static/static-method-privacy.stderr @@ -1,8 +1,8 @@ error[E0624]: associated function `new` is private - --> $DIR/static-method-privacy.rs:9:13 + --> $DIR/static-method-privacy.rs:9:19 | LL | let _ = a::S::new(); - | ^^^^^^^^^ + | ^^^ private associated function error: aborting due to previous error diff --git a/src/test/ui/static/static-priv-by-default2.stderr b/src/test/ui/static/static-priv-by-default2.stderr index f6cd40412dd84..d731da79246ee 100644 --- a/src/test/ui/static/static-priv-by-default2.stderr +++ b/src/test/ui/static/static-priv-by-default2.stderr @@ -2,7 +2,7 @@ error[E0603]: static `private` is private --> $DIR/static-priv-by-default2.rs:15:30 | LL | use child::childs_child::private; - | ^^^^^^^ this static is private + | ^^^^^^^ private static | note: the static `private` is defined here --> $DIR/static-priv-by-default2.rs:7:9 @@ -14,7 +14,7 @@ error[E0603]: static `private` is private --> $DIR/static-priv-by-default2.rs:23:33 | LL | use static_priv_by_default::private; - | ^^^^^^^ this static is private + | ^^^^^^^ private static | note: the static `private` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:3:1 diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index a9ec6b9c02fe8..d0afb2ae7af74 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -2,15 +2,17 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t --> $DIR/str-mut-idx.rs:4:15 | LL | fn bot() -> T { loop {} } - | --- -- help: consider relaxing the implicit `Sized` restriction: `: ?Sized` - | | - | required by this bound in `bot` + | --- - required by this bound in `bot` ... LL | s[1..2] = bot(); | ^^^ doesn't have a size known at compile-time | = help: the trait `std::marker::Sized` is not implemented for `str` = note: to learn more, visit +help: consider relaxing the implicit `Sized` restriction + | +LL | fn bot() -> T { loop {} } + | ^^^^^^^^ error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-mut-idx.rs:4:5 diff --git a/src/test/ui/structs/struct-field-privacy.stderr b/src/test/ui/structs/struct-field-privacy.stderr index 91d000b8672e0..f8b16ec0d01b3 100644 --- a/src/test/ui/structs/struct-field-privacy.stderr +++ b/src/test/ui/structs/struct-field-privacy.stderr @@ -1,32 +1,32 @@ error[E0616]: field `a` of struct `inner::A` is private - --> $DIR/struct-field-privacy.rs:23:5 + --> $DIR/struct-field-privacy.rs:23:7 | LL | b.a; - | ^^^ + | ^ private field error[E0616]: field `b` of struct `inner::B` is private - --> $DIR/struct-field-privacy.rs:26:5 + --> $DIR/struct-field-privacy.rs:26:7 | LL | c.b; - | ^^^ + | ^ private field error[E0616]: field `a` of struct `xc::A` is private - --> $DIR/struct-field-privacy.rs:28:5 + --> $DIR/struct-field-privacy.rs:28:7 | LL | d.a; - | ^^^ + | ^ private field error[E0616]: field `b` of struct `xc::B` is private - --> $DIR/struct-field-privacy.rs:32:5 + --> $DIR/struct-field-privacy.rs:32:7 | LL | e.b; - | ^^^ + | ^ private field error[E0616]: field `1` of struct `inner::Z` is private - --> $DIR/struct-field-privacy.rs:35:5 + --> $DIR/struct-field-privacy.rs:35:7 | LL | z.1; - | ^^^ + | ^ private field error: aborting due to 5 previous errors diff --git a/src/test/ui/structs/struct-variant-privacy-xc.stderr b/src/test/ui/structs/struct-variant-privacy-xc.stderr index 0203b7b5242e5..4e022cef1b2d3 100644 --- a/src/test/ui/structs/struct-variant-privacy-xc.stderr +++ b/src/test/ui/structs/struct-variant-privacy-xc.stderr @@ -2,7 +2,7 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy-xc.rs:4:33 | LL | fn f(b: struct_variant_privacy::Bar) { - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Bar` is defined here --> $DIR/auxiliary/struct_variant_privacy.rs:1:1 @@ -14,7 +14,7 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy-xc.rs:6:33 | LL | struct_variant_privacy::Bar::Baz { a: _a } => {} - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Bar` is defined here --> $DIR/auxiliary/struct_variant_privacy.rs:1:1 diff --git a/src/test/ui/structs/struct-variant-privacy.stderr b/src/test/ui/structs/struct-variant-privacy.stderr index d1b603f9d46fc..a6bc381ff6b38 100644 --- a/src/test/ui/structs/struct-variant-privacy.stderr +++ b/src/test/ui/structs/struct-variant-privacy.stderr @@ -2,7 +2,7 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy.rs:7:14 | LL | fn f(b: foo::Bar) { - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Bar` is defined here --> $DIR/struct-variant-privacy.rs:2:5 @@ -14,7 +14,7 @@ error[E0603]: enum `Bar` is private --> $DIR/struct-variant-privacy.rs:9:14 | LL | foo::Bar::Baz { a: _a } => {} - | ^^^ this enum is private + | ^^^ private enum | note: the enum `Bar` is defined here --> $DIR/struct-variant-privacy.rs:2:5 diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 4423f3c130e2a..3ad2a1414f969 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -5,14 +5,16 @@ LL | fn bar<'a, T>() where T: 'a {} | --------------------------- fn() {>::bar::<'static, char>} defined here ... LL | let x: () = >::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::bar::<'static, char>()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::bar::<'static, char>}` +help: use parentheses to call this function + | +LL | let x: () = >::bar::<'static, char>(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -21,14 +23,16 @@ LL | fn bar<'a, T>() where T: 'a {} | --------------------------- fn() {>::bar::<'static, char>} defined here ... LL | let x: () = >::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::bar::<'static, char>()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::bar::<'static, char>}` +help: use parentheses to call this function + | +LL | let x: () = >::bar::<'static, char>(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -37,14 +41,16 @@ LL | fn baz() {} | -------- fn() {>::baz} defined here ... LL | let x: () = >::baz; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::baz()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::baz}` +help: use parentheses to call this function + | +LL | let x: () = >::baz(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -53,14 +59,16 @@ LL | fn foo<'z>() where &'z (): Sized { | -------------------------------- fn() {foo::<'static>} defined here ... LL | let x: () = foo::<'static>; - | -- ^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `foo::<'static>()` + | -- ^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {foo::<'static>}` +help: use parentheses to call this function + | +LL | let x: () = foo::<'static>(); + | ^^ error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index 2aebdebee72c1..e23f06a3ef590 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -5,14 +5,16 @@ LL | fn bar<'a, T>() where T: 'a {} | --------------------------- fn() {>::bar::} defined here ... LL | let x: () = >::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::bar::<'static, char>()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::bar::}` +help: use parentheses to call this function + | +LL | let x: () = >::bar::<'static, char>(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:25:17 @@ -21,14 +23,16 @@ LL | fn bar<'a, T>() where T: 'a {} | --------------------------- fn() {>::bar::} defined here ... LL | let x: () = >::bar::<'static, char>; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::bar::<'static, char>()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::bar::}` +help: use parentheses to call this function + | +LL | let x: () = >::bar::<'static, char>(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:33:17 @@ -37,14 +41,16 @@ LL | fn baz() {} | -------- fn() {>::baz} defined here ... LL | let x: () = >::baz; - | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `>::baz()` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {>::baz}` +help: use parentheses to call this function + | +LL | let x: () = >::baz(); + | ^^ error[E0308]: mismatched types --> $DIR/substs-ppaux.rs:41:17 @@ -53,14 +59,16 @@ LL | fn foo<'z>() where &'z (): Sized { | -------------------------------- fn() {foo::} defined here ... LL | let x: () = foo::<'static>; - | -- ^^^^^^^^^^^^^^ - | | | - | | expected `()`, found fn item - | | help: use parentheses to call this function: `foo::<'static>()` + | -- ^^^^^^^^^^^^^^ expected `()`, found fn item + | | | expected due to this | = note: expected unit type `()` found fn item `fn() {foo::}` +help: use parentheses to call this function + | +LL | let x: () = foo::<'static>(); + | ^^ error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/substs-ppaux.rs:49:5 diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 05583876a066c..638d504d7feab 100644 --- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -8,10 +8,12 @@ LL | fn bar(f: impl Future) {} | --- ----------------- required by this bound in `bar` ... LL | bar(foo); - | ^^^ - | | - | the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}` - | help: use parentheses to call the function: `foo()` + | ^^^ the trait `std::future::Future` is not implemented for `fn() -> impl std::future::Future {foo}` + | +help: use parentheses to call the function + | +LL | bar(foo()); + | ^^ error[E0277]: the trait bound `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]: std::future::Future` is not satisfied --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9 @@ -22,10 +24,12 @@ LL | fn bar(f: impl Future) {} LL | let async_closure = async || (); | -------- consider calling this closure LL | bar(async_closure); - | ^^^^^^^^^^^^^ - | | - | the trait `std::future::Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` - | help: use parentheses to call the closure: `async_closure()` + | ^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` + | +help: use parentheses to call the closure + | +LL | bar(async_closure()); + | ^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/const-in-struct-pat.stderr b/src/test/ui/suggestions/const-in-struct-pat.stderr index 0a010dcab4c26..ab336b14d2948 100644 --- a/src/test/ui/suggestions/const-in-struct-pat.stderr +++ b/src/test/ui/suggestions/const-in-struct-pat.stderr @@ -9,7 +9,11 @@ LL | let Thing { foo } = t; | | | expected struct `std::string::String`, found struct `foo` | `foo` is interpreted as a unit struct, not a new binding - | help: bind the struct field to a different name instead: `foo: other_foo` + | +help: bind the struct field to a different name instead + | +LL | let Thing { foo: other_foo } = t; + | ^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 91f60e8f426c4..ed4a0b8487dff 100644 --- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -8,10 +8,12 @@ LL | fn bar(f: impl T) {} | --- ------- required by this bound in `bar` ... LL | bar(foo); - | ^^^ - | | - | the trait `T` is not implemented for `fn() -> impl T {foo}` - | help: use parentheses to call the function: `foo()` + | ^^^ the trait `T` is not implemented for `fn() -> impl T {foo}` + | +help: use parentheses to call the function + | +LL | bar(foo()); + | ^^ error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]: T` is not satisfied --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9 @@ -22,10 +24,12 @@ LL | fn bar(f: impl T) {} LL | let closure = || S; | -- consider calling this closure LL | bar(closure); - | ^^^^^^^ - | | - | the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]` - | help: use parentheses to call the closure: `closure()` + | ^^^^^^^ the trait `T` is not implemented for `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]` + | +help: use parentheses to call the closure + | +LL | bar(closure()); + | ^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr index 232e54b5d37b2..b03bea1eddbf0 100644 --- a/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr +++ b/src/test/ui/suggestions/fn-or-tuple-struct-without-args.stderr @@ -19,14 +19,16 @@ LL | fn foo(a: usize, b: usize) -> usize { a } | ----------------------------------- fn(usize, usize) -> usize {foo} defined here ... LL | let _: usize = foo; - | ----- ^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `foo(a, b)` + | ----- ^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize, usize) -> usize {foo}` +help: use parentheses to call this function + | +LL | let _: usize = foo(a, b); + | ^^^^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:30:16 @@ -35,14 +37,16 @@ LL | struct S(usize, usize); | ----------------------- fn(usize, usize) -> S {S} defined here ... LL | let _: S = S; - | - ^ - | | | - | | expected struct `S`, found fn item - | | help: use parentheses to instantiate this tuple struct: `S(_, _)` + | - ^ expected struct `S`, found fn item + | | | expected due to this | = note: expected struct `S` found fn item `fn(usize, usize) -> S {S}` +help: use parentheses to instantiate this tuple struct + | +LL | let _: S = S(_, _); + | ^^^^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:31:20 @@ -51,14 +55,16 @@ LL | fn bar() -> usize { 42 } | ----------------- fn() -> usize {bar} defined here ... LL | let _: usize = bar; - | ----- ^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `bar()` + | ----- ^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn() -> usize {bar}` +help: use parentheses to call this function + | +LL | let _: usize = bar(); + | ^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:32:16 @@ -67,14 +73,16 @@ LL | struct V(); | ----------- fn() -> V {V} defined here ... LL | let _: V = V; - | - ^ - | | | - | | expected struct `V`, found fn item - | | help: use parentheses to instantiate this tuple struct: `V()` + | - ^ expected struct `V`, found fn item + | | | expected due to this | = note: expected struct `V` found fn item `fn() -> V {V}` +help: use parentheses to instantiate this tuple struct + | +LL | let _: V = V(); + | ^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:33:20 @@ -83,14 +91,16 @@ LL | fn baz(x: usize, y: usize) -> usize { x } | ----------------------------------- fn(usize, usize) -> usize {<_ as T>::baz} defined here ... LL | let _: usize = T::baz; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `T::baz(x, y)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize, usize) -> usize {<_ as T>::baz}` +help: use parentheses to call this function + | +LL | let _: usize = T::baz(x, y); + | ^^^^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:34:20 @@ -99,14 +109,16 @@ LL | fn bat(x: usize) -> usize { 42 } | ------------------------- fn(usize) -> usize {<_ as T>::bat} defined here ... LL | let _: usize = T::bat; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `T::bat(x)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize) -> usize {<_ as T>::bat}` +help: use parentheses to call this function + | +LL | let _: usize = T::bat(x); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:35:16 @@ -115,14 +127,16 @@ LL | A(usize), | -------- fn(usize) -> E {E::A} defined here ... LL | let _: E = E::A; - | - ^^^^ - | | | - | | expected enum `E`, found fn item - | | help: use parentheses to instantiate this tuple variant: `E::A(_)` + | - ^^^^ expected enum `E`, found fn item + | | | expected due to this | = note: expected enum `E` found fn item `fn(usize) -> E {E::A}` +help: use parentheses to instantiate this tuple variant + | +LL | let _: E = E::A(_); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:37:20 @@ -131,14 +145,16 @@ LL | fn baz(x: usize, y: usize) -> usize { x } | ----------------------------------- fn(usize, usize) -> usize {::baz} defined here ... LL | let _: usize = X::baz; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::baz(x, y)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize, usize) -> usize {::baz}` +help: use parentheses to call this function + | +LL | let _: usize = X::baz(x, y); + | ^^^^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:38:20 @@ -147,14 +163,16 @@ LL | fn bat(x: usize) -> usize { 42 } | ------------------------- fn(usize) -> usize {::bat} defined here ... LL | let _: usize = X::bat; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::bat(x)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize) -> usize {::bat}` +help: use parentheses to call this function + | +LL | let _: usize = X::bat(x); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:39:20 @@ -163,14 +181,16 @@ LL | fn bax(x: usize) -> usize { 42 } | ------------------------- fn(usize) -> usize {::bax} defined here ... LL | let _: usize = X::bax; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::bax(x)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize) -> usize {::bax}` +help: use parentheses to call this function + | +LL | let _: usize = X::bax(x); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:40:20 @@ -179,14 +199,16 @@ LL | fn bach(x: usize) -> usize; | --------------------------- fn(usize) -> usize {::bach} defined here ... LL | let _: usize = X::bach; - | ----- ^^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::bach(x)` + | ----- ^^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `fn(usize) -> usize {::bach}` +help: use parentheses to call this function + | +LL | let _: usize = X::bach(x); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:41:20 @@ -195,14 +217,16 @@ LL | fn ban(&self) -> usize { 42 } | ---------------------- for<'r> fn(&'r X) -> usize {::ban} defined here ... LL | let _: usize = X::ban; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::ban(_)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `for<'r> fn(&'r X) -> usize {::ban}` +help: use parentheses to call this function + | +LL | let _: usize = X::ban(_); + | ^^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:42:20 @@ -211,26 +235,38 @@ LL | fn bal(&self) -> usize; | ----------------------- for<'r> fn(&'r X) -> usize {::bal} defined here ... LL | let _: usize = X::bal; - | ----- ^^^^^^ - | | | - | | expected `usize`, found fn item - | | help: use parentheses to call this function: `X::bal(_)` + | ----- ^^^^^^ expected `usize`, found fn item + | | | expected due to this | = note: expected type `usize` found fn item `for<'r> fn(&'r X) -> usize {::bal}` +help: use parentheses to call this function + | +LL | let _: usize = X::bal(_); + | ^^^ error[E0615]: attempted to take value of method `ban` on type `X` --> $DIR/fn-or-tuple-struct-without-args.rs:43:22 | LL | let _: usize = X.ban; - | ^^^ help: use parentheses to call the method: `ban()` + | ^^^ method, not a field + | +help: use parentheses to call the method + | +LL | let _: usize = X.ban(); + | ^^ error[E0615]: attempted to take value of method `bal` on type `X` --> $DIR/fn-or-tuple-struct-without-args.rs:44:22 | LL | let _: usize = X.bal; - | ^^^ help: use parentheses to call the method: `bal()` + | ^^^ method, not a field + | +help: use parentheses to call the method + | +LL | let _: usize = X.bal(); + | ^^ error[E0308]: mismatched types --> $DIR/fn-or-tuple-struct-without-args.rs:46:20 @@ -238,14 +274,16 @@ error[E0308]: mismatched types LL | let closure = || 42; | ----- the found closure LL | let _: usize = closure; - | ----- ^^^^^^^ - | | | - | | expected `usize`, found closure - | | help: use parentheses to call this closure: `closure()` + | ----- ^^^^^^^ expected `usize`, found closure + | | | expected due to this | = note: expected type `usize` found closure `[closure@$DIR/fn-or-tuple-struct-without-args.rs:45:19: 45:24]` +help: use parentheses to call this closure + | +LL | let _: usize = closure(); + | ^^ error: aborting due to 17 previous errors diff --git a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr index ccaceefacd739..84ba935191b48 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr +++ b/src/test/ui/suggestions/imm-ref-trait-object-literal.stderr @@ -5,13 +5,14 @@ LL | fn foo(_: X) {} | --- ----- required by this bound in `foo` ... LL | foo(&s); - | -^ - | | - | the trait `Trait` is not implemented for `&S` - | help: consider changing this borrow's mutability: `&mut` + | ^^ the trait `Trait` is not implemented for `&S` | = help: the following implementations were found: <&'a mut S as Trait> +help: consider changing this borrow's mutability + | +LL | foo(&mut s); + | ^^^^ error[E0277]: the trait bound `S: Trait` is not satisfied --> $DIR/imm-ref-trait-object-literal.rs:13:7 diff --git a/src/test/ui/suggestions/method-missing-parentheses.stderr b/src/test/ui/suggestions/method-missing-parentheses.stderr index 6e4f7a84724bf..04c67ec6a06b6 100644 --- a/src/test/ui/suggestions/method-missing-parentheses.stderr +++ b/src/test/ui/suggestions/method-missing-parentheses.stderr @@ -8,9 +8,12 @@ error[E0615]: attempted to take value of method `collect` on type `std::vec::Int --> $DIR/method-missing-parentheses.rs:2:32 | LL | let _ = vec![].into_iter().collect::; - | ^^^^^^^--------- - | | - | help: use parentheses to call the method: `collect::()` + | ^^^^^^^ method, not a field + | +help: use parentheses to call the method + | +LL | let _ = vec![].into_iter().collect::(); + | ^^ error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/trait-impl-for-module.stderr b/src/test/ui/traits/trait-impl-for-module.stderr index 4b3c930dccd45..cd2713a5bd50c 100644 --- a/src/test/ui/traits/trait-impl-for-module.stderr +++ b/src/test/ui/traits/trait-impl-for-module.stderr @@ -1,12 +1,11 @@ error[E0573]: expected type, found module `a` --> $DIR/trait-impl-for-module.rs:7:12 | -LL | / trait A { -LL | | } - | |_- similarly named trait `A` defined here -LL | -LL | impl A for a { - | ^ help: a trait with a similar name exists: `A` +LL | trait A { + | ------- similarly named trait `A` defined here +... +LL | impl A for a { + | ^ help: a trait with a similar name exists: `A` error: aborting due to previous error diff --git a/src/test/ui/traits/trait-item-privacy.stderr b/src/test/ui/traits/trait-item-privacy.stderr index 4b40c6405c47b..7fd5c11fcf090 100644 --- a/src/test/ui/traits/trait-item-privacy.stderr +++ b/src/test/ui/traits/trait-item-privacy.stderr @@ -40,7 +40,7 @@ error[E0624]: associated function `a` is private --> $DIR/trait-item-privacy.rs:72:7 | LL | c.a(); - | ^ + | ^ private associated function error[E0599]: no function or associated item named `a` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:78:8 @@ -74,10 +74,10 @@ LL | use method::B; | error[E0624]: associated function `a` is private - --> $DIR/trait-item-privacy.rs:84:5 + --> $DIR/trait-item-privacy.rs:84:8 | LL | C::a(&S); - | ^^^^ + | ^ private associated function error[E0599]: no associated item named `A` found for struct `S` in the current scope --> $DIR/trait-item-privacy.rs:97:8 @@ -111,10 +111,10 @@ LL | use assoc_const::B; | error[E0624]: associated constant `A` is private - --> $DIR/trait-item-privacy.rs:101:5 + --> $DIR/trait-item-privacy.rs:101:8 | LL | C::A; - | ^^^^ + | ^ private associated constant error[E0038]: the trait `assoc_const::C` cannot be made into an object --> $DIR/trait-item-privacy.rs:101:5 @@ -159,13 +159,13 @@ error: associated type `A` is private --> $DIR/trait-item-privacy.rs:119:12 | LL | let _: T::A; - | ^^^^ + | ^^^^ private associated type error: associated type `A` is private --> $DIR/trait-item-privacy.rs:128:9 | LL | A = u8, - | ^^^^^^ + | ^^^^^^ private associated type error: aborting due to 15 previous errors diff --git a/src/test/ui/traits/trait-method-private.stderr b/src/test/ui/traits/trait-method-private.stderr index 035c1ea092b29..c33673aea4d79 100644 --- a/src/test/ui/traits/trait-method-private.stderr +++ b/src/test/ui/traits/trait-method-private.stderr @@ -2,7 +2,7 @@ error[E0624]: associated function `method` is private --> $DIR/trait-method-private.rs:19:9 | LL | foo.method(); - | ^^^^^^ + | ^^^^^^ private associated function | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: diff --git a/src/test/ui/try-block/try-block-in-edition2015.stderr b/src/test/ui/try-block/try-block-in-edition2015.stderr index 9b4fe2c1205db..fe870ab737cc8 100644 --- a/src/test/ui/try-block/try-block-in-edition2015.stderr +++ b/src/test/ui/try-block/try-block-in-edition2015.stderr @@ -11,9 +11,13 @@ error[E0574]: expected struct, variant or union type, found macro `try` --> $DIR/try-block-in-edition2015.rs:4:33 | LL | let try_result: Option<_> = try { - | ^^^ help: use `!` to invoke the macro: `try!` + | ^^^ | = note: if you want the `try` keyword, you need to be in the 2018 edition +help: use `!` to invoke the macro + | +LL | let try_result: Option<_> = try! { + | ^ error: aborting due to 2 previous errors diff --git a/src/test/ui/type-inference/or_else-multiple-type-params.stderr b/src/test/ui/type-inference/or_else-multiple-type-params.stderr index 24122e658679a..047728dc1ea4e 100644 --- a/src/test/ui/type-inference/or_else-multiple-type-params.stderr +++ b/src/test/ui/type-inference/or_else-multiple-type-params.stderr @@ -2,10 +2,12 @@ error[E0282]: type annotations needed --> $DIR/or_else-multiple-type-params.rs:7:10 | LL | .or_else(|err| { - | ^^^^^^^ - | | - | cannot infer type for type parameter `F` declared on the associated function `or_else` - | help: consider specifying the type arguments in the method call: `or_else::` + | ^^^^^^^ cannot infer type for type parameter `F` declared on the associated function `or_else` + | +help: consider specifying the type arguments in the method call + | +LL | .or_else::(|err| { + | ^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/type-inference/sort_by_key.stderr b/src/test/ui/type-inference/sort_by_key.stderr index bb108adcd64af..0b6630ec89423 100644 --- a/src/test/ui/type-inference/sort_by_key.stderr +++ b/src/test/ui/type-inference/sort_by_key.stderr @@ -2,9 +2,12 @@ error[E0282]: type annotations needed --> $DIR/sort_by_key.rs:3:9 | LL | lst.sort_by_key(|&(v, _)| v.iter().sum()); - | ^^^^^^^^^^^ --- help: consider specifying the type argument in the method call: `sum::` - | | - | cannot infer type for type parameter `K` declared on the associated function `sort_by_key` + | ^^^^^^^^^^^ cannot infer type for type parameter `K` declared on the associated function `sort_by_key` + | +help: consider specifying the type argument in the method call + | +LL | lst.sort_by_key(|&(v, _)| v.iter().sum::()); + | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/type/type-annotation-needed.stderr b/src/test/ui/type/type-annotation-needed.stderr index c6a811e836342..df7d73d7a7c1d 100644 --- a/src/test/ui/type/type-annotation-needed.stderr +++ b/src/test/ui/type/type-annotation-needed.stderr @@ -5,12 +5,13 @@ LL | fn foo>(x: i32) {} | --- ------------ required by this bound in `foo` ... LL | foo(42); - | ^^^ - | | - | cannot infer type for type parameter `T` declared on the function `foo` - | help: consider specifying the type argument in the function call: `foo::` + | ^^^ cannot infer type for type parameter `T` declared on the function `foo` | = note: cannot resolve `_: std::convert::Into` +help: consider specifying the type argument in the function call + | +LL | foo::(42); + | ^^^^^ error: aborting due to previous error diff --git a/src/test/ui/ufcs/ufcs-partially-resolved.stderr b/src/test/ui/ufcs/ufcs-partially-resolved.stderr index 7177ca4908545..3950dc9877cd8 100644 --- a/src/test/ui/ufcs/ufcs-partially-resolved.stderr +++ b/src/test/ui/ufcs/ufcs-partially-resolved.stderr @@ -35,7 +35,7 @@ error[E0576]: cannot find method or associated constant `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:22:17 | LL | fn Y() {} - | --------- similarly named associated function `Y` defined here + | ------ similarly named associated function `Y` defined here ... LL | ::N; | ^ help: an associated function with a similar name exists: `Y` @@ -181,7 +181,7 @@ error[E0575]: expected method or associated constant, found associated type `Dr: --> $DIR/ufcs-partially-resolved.rs:53:5 | LL | fn Z() {} - | --------- similarly named associated function `Z` defined here + | ------ similarly named associated function `Z` defined here ... LL | ::X; | ^^^^^^^^^^^^- diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index a667e1fe2da3a..e4396afb2dbf5 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -3,6 +3,11 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered | LL | let _ = match x { | ^ pattern `Err(_)` not covered + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | --- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms @@ -46,6 +51,11 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered | LL | let _ = match x { | ^ pattern `Err(_)` not covered + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | --- not covered | = help: ensure that all possible cases are being handled, possibly by adding wildcards or more match arms @@ -54,6 +64,11 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(x) = x; | ^^^^^ pattern `Err(_)` not covered + | + ::: $SRC_DIR/libcore/result.rs:LL:COL + | +LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), + | --- not covered | = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html diff --git a/src/test/ui/union/union-derive-clone.stderr b/src/test/ui/union/union-derive-clone.stderr index 01c8e8471aac2..66437611872df 100644 --- a/src/test/ui/union/union-derive-clone.stderr +++ b/src/test/ui/union/union-derive-clone.stderr @@ -21,6 +21,14 @@ LL | struct CloneNoCopy; ... LL | let w = u.clone(); | ^^^^^ method not found in `U5` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc>` here + | the method is available for `std::rc::Rc>` here | = note: the method `clone` exists but the following trait bounds were not satisfied: `CloneNoCopy: std::marker::Copy` diff --git a/src/test/ui/union/union-suggest-field.rs b/src/test/ui/union/union-suggest-field.rs index d84a22cee5ab2..71b93e873c220 100644 --- a/src/test/ui/union/union-suggest-field.rs +++ b/src/test/ui/union/union-suggest-field.rs @@ -17,5 +17,5 @@ fn main() { let y = u.calculate; //~ ERROR attempted to take value of method `calculate` on type `U` //~| HELP use parentheses to call the method - //~| SUGGESTION calculate() + //~| SUGGESTION () } diff --git a/src/test/ui/union/union-suggest-field.stderr b/src/test/ui/union/union-suggest-field.stderr index 5050e4a986499..461db1712064f 100644 --- a/src/test/ui/union/union-suggest-field.stderr +++ b/src/test/ui/union/union-suggest-field.stderr @@ -14,7 +14,12 @@ error[E0615]: attempted to take value of method `calculate` on type `U` --> $DIR/union-suggest-field.rs:18:15 | LL | let y = u.calculate; - | ^^^^^^^^^ help: use parentheses to call the method: `calculate()` + | ^^^^^^^^^ method, not a field + | +help: use parentheses to call the method + | +LL | let y = u.calculate(); + | ^^ error: aborting due to 3 previous errors diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index fb78095224b90..2e81e7cf83200 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -14,6 +14,14 @@ LL | let _z = y.clone(); | LL | pub struct Box(Unique); | ------------------------------------- doesn't satisfy `std::boxed::Box: std::clone::Clone` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc>` here + | the method is available for `std::rc::Rc>` here | = note: the method `clone` exists but the following trait bounds were not satisfied: `dyn Foo: std::marker::Sized` diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index ea6575d1d85dc..06c4b95baef56 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -11,6 +11,14 @@ LL | let _j = i.clone(); | LL | pub struct Box(Unique); | ------------------------------------- doesn't satisfy `std::boxed::Box: std::clone::Clone` + | + ::: $SRC_DIR/libcore/clone.rs:LL:COL + | +LL | fn clone(&self) -> Self; + | ----- + | | + | the method is available for `std::sync::Arc>` here + | the method is available for `std::rc::Rc>` here | = note: the method `clone` exists but the following trait bounds were not satisfied: `R: std::clone::Clone` diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized3.stderr index e97d00fc4741d..083c74ba1e05d 100644 --- a/src/test/ui/unsized3.stderr +++ b/src/test/ui/unsized3.stderr @@ -7,12 +7,14 @@ LL | f2::(x); | ^ doesn't have a size known at compile-time ... LL | fn f2(x: &X) { - | -- -- help: consider relaxing the implicit `Sized` restriction: `: ?Sized` - | | - | required by this bound in `f2` + | -- - required by this bound in `f2` | = help: the trait `std::marker::Sized` is not implemented for `X` = note: to learn more, visit +help: consider relaxing the implicit `Sized` restriction + | +LL | fn f2(x: &X) { + | ^^^^^^^^ error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized3.rs:18:13 @@ -23,12 +25,14 @@ LL | f4::(x); | ^ doesn't have a size known at compile-time ... LL | fn f4(x: &X) { - | -- - - help: consider relaxing the implicit `Sized` restriction: `+ ?Sized` - | | - | required by this bound in `f4` + | -- - required by this bound in `f4` | = help: the trait `std::marker::Sized` is not implemented for `X` = note: to learn more, visit +help: consider relaxing the implicit `Sized` restriction + | +LL | fn f4(x: &X) { + | ^^^^^^^^^ error[E0277]: the size for values of type `X` cannot be known at compilation time --> $DIR/unsized3.rs:33:8 diff --git a/src/test/ui/use/use-from-trait-xc.stderr b/src/test/ui/use/use-from-trait-xc.stderr index 3f38a6cae7b81..37b4e61c8085e 100644 --- a/src/test/ui/use/use-from-trait-xc.stderr +++ b/src/test/ui/use/use-from-trait-xc.stderr @@ -44,7 +44,7 @@ error[E0603]: struct `Foo` is private --> $DIR/use-from-trait-xc.rs:14:24 | LL | use use_from_trait_xc::Foo::new; - | ^^^ this struct is private + | ^^^ private struct | note: the struct `Foo` is defined here --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 @@ -56,7 +56,7 @@ error[E0603]: struct `Foo` is private --> $DIR/use-from-trait-xc.rs:17:24 | LL | use use_from_trait_xc::Foo::C; - | ^^^ this struct is private + | ^^^ private struct | note: the struct `Foo` is defined here --> $DIR/auxiliary/use-from-trait-xc.rs:9:1 diff --git a/src/test/ui/use/use-mod/use-mod-3.stderr b/src/test/ui/use/use-mod/use-mod-3.stderr index 4852759286ae6..1b12b3c6fa09a 100644 --- a/src/test/ui/use/use-mod/use-mod-3.stderr +++ b/src/test/ui/use/use-mod/use-mod-3.stderr @@ -2,7 +2,7 @@ error[E0603]: module `bar` is private --> $DIR/use-mod-3.rs:1:10 | LL | use foo::bar::{ - | ^^^ this module is private + | ^^^ private module | note: the module `bar` is defined here --> $DIR/use-mod-3.rs:9:5 @@ -14,7 +14,7 @@ error[E0603]: module `bar` is private --> $DIR/use-mod-3.rs:4:10 | LL | use foo::bar::{ - | ^^^ this module is private + | ^^^ private module | note: the module `bar` is defined here --> $DIR/use-mod-3.rs:9:5 diff --git a/src/test/ui/xc-private-method.stderr b/src/test/ui/xc-private-method.stderr index 6a68bef90efd7..8b7e43ccc04e9 100644 --- a/src/test/ui/xc-private-method.stderr +++ b/src/test/ui/xc-private-method.stderr @@ -1,14 +1,14 @@ error[E0624]: associated function `static_meth_struct` is private - --> $DIR/xc-private-method.rs:6:13 + --> $DIR/xc-private-method.rs:6:44 | LL | let _ = xc_private_method_lib::Struct::static_meth_struct(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^ private associated function error[E0624]: associated function `static_meth_enum` is private - --> $DIR/xc-private-method.rs:9:13 + --> $DIR/xc-private-method.rs:9:42 | LL | let _ = xc_private_method_lib::Enum::static_meth_enum(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^ private associated function error: aborting due to 2 previous errors diff --git a/src/test/ui/xc-private-method2.stderr b/src/test/ui/xc-private-method2.stderr index 84a8b9817c0d0..0ebdb0a06d82b 100644 --- a/src/test/ui/xc-private-method2.stderr +++ b/src/test/ui/xc-private-method2.stderr @@ -2,13 +2,13 @@ error[E0624]: associated function `meth_struct` is private --> $DIR/xc-private-method2.rs:6:52 | LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ private associated function error[E0624]: associated function `meth_enum` is private --> $DIR/xc-private-method2.rs:9:55 | LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum(); - | ^^^^^^^^^ + | ^^^^^^^^^ private associated function error: aborting due to 2 previous errors diff --git a/src/test/ui/xcrate/xcrate-private-by-default.stderr b/src/test/ui/xcrate/xcrate-private-by-default.stderr index 842069d6135cb..a97f55de5f833 100644 --- a/src/test/ui/xcrate/xcrate-private-by-default.stderr +++ b/src/test/ui/xcrate/xcrate-private-by-default.stderr @@ -2,7 +2,7 @@ error[E0603]: static `j` is private --> $DIR/xcrate-private-by-default.rs:23:29 | LL | static_priv_by_default::j; - | ^ this static is private + | ^ private static | note: the static `j` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:47:1 @@ -14,7 +14,7 @@ error[E0603]: function `k` is private --> $DIR/xcrate-private-by-default.rs:25:29 | LL | static_priv_by_default::k; - | ^ this function is private + | ^ private function | note: the function `k` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:48:1 @@ -26,7 +26,7 @@ error[E0603]: unit struct `l` is private --> $DIR/xcrate-private-by-default.rs:27:29 | LL | static_priv_by_default::l; - | ^ this unit struct is private + | ^ private unit struct | note: the unit struct `l` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:49:1 @@ -38,7 +38,7 @@ error[E0603]: enum `m` is private --> $DIR/xcrate-private-by-default.rs:29:35 | LL | foo::(); - | ^ this enum is private + | ^ private enum | note: the enum `m` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:50:1 @@ -50,7 +50,7 @@ error[E0603]: type alias `n` is private --> $DIR/xcrate-private-by-default.rs:31:35 | LL | foo::(); - | ^ this type alias is private + | ^ private type alias | note: the type alias `n` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:51:1 @@ -62,7 +62,7 @@ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:35:29 | LL | static_priv_by_default::foo::a; - | ^^^ this module is private + | ^^^ private module | note: the module `foo` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:12:1 @@ -74,7 +74,7 @@ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:37:29 | LL | static_priv_by_default::foo::b; - | ^^^ this module is private + | ^^^ private module | note: the module `foo` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:12:1 @@ -86,7 +86,7 @@ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:39:29 | LL | static_priv_by_default::foo::c; - | ^^^ this module is private + | ^^^ private module | note: the module `foo` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:12:1 @@ -98,7 +98,7 @@ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:41:35 | LL | foo::(); - | ^^^ this module is private + | ^^^ private module | note: the module `foo` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:12:1 @@ -110,7 +110,7 @@ error[E0603]: module `foo` is private --> $DIR/xcrate-private-by-default.rs:43:35 | LL | foo::(); - | ^^^ this module is private + | ^^^ private module | note: the module `foo` is defined here --> $DIR/auxiliary/static_priv_by_default.rs:12:1