Rollup merge of #69942 - estebank:sized-verbose-sugg, r=matthewjasper

Increase verbosity when suggesting subtle code changes

Do not suggest changes that are actually quite small inline, to minimize the likelihood of confusion.

Fix #69243.
This commit is contained in:
Mazdak Farrokhzad 2020-03-23 10:29:09 +01:00 committed by GitHub
commit 906b399583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
137 changed files with 818 additions and 663 deletions

View File

@ -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()

View File

@ -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;
}
}

View File

@ -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");
}

View File

@ -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() {

View File

@ -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::<Vec<String>>()
.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),

View File

@ -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::<Vec<_>>().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::<Vec<_>>()
.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(),

View File

@ -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);
@ -2315,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);

View File

@ -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,

View File

@ -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<T>`;
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::<Vec<_>>().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

View File

@ -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();
}

View File

@ -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
}

View File

@ -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();

View File

@ -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 = <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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<T>() { }
| ------------ -- 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::<A>();
| ^ 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 <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() { }
| ^^^^^^^^
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:25:5

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<dyn ResponseHook>) { 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<dyn ResponseHook>) { res.get() }
| ^^
error: aborting due to previous error

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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::<test::B>::foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^ private associated function
error: aborting due to previous error

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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<std::iter::Map<std::slice::Iter<'_, {integer}>, [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

View File

@ -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

View File

@ -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

View File

@ -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::<Priv>;
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^ 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::<Priv>();
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ 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 = <Pub>::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 = <Pub>::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 | <Pub>::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

View File

@ -2,7 +2,7 @@ error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as priv_trait::Pr
--> $DIR/associated-item-privacy-trait.rs:17:21
|
LL | let value = <Pub as PrivTr>::method;
| ^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^ private type
...
LL | priv_trait::mac!();
| ------------------- in this macro invocation
@ -13,7 +13,7 @@ error: type `for<'r> fn(&'r priv_trait::Pub) {<priv_trait::Pub as priv_trait::Pr
--> $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) {<Self as priv_trait::PrivTr>::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 | <Pub as PrivTr>::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 _: <Pub as PrivTr>::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 = <Pub as PrivTr>::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 = <Pub as PubTr>::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 = <Pub as PubTr>::method::<Priv>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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::<Priv>();
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ 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 = <Pub as PubTr>::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 = <Pub as PubTr<_>>::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 = <Priv as PubTr<_>>::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 | <Pub as PubTr>::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 | <Pub as PubTr<_>>::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 | <Priv as PubTr<_>>::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 _: <Pub as PubTr<_>>::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 _: <Priv as PubTr<_>>::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 = <Pub as PubTr>::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 = <Priv as PubTr<Pub>>::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

View File

@ -2,7 +2,7 @@ error: trait `priv_trait::PrivTr` is private
--> $DIR/associated-item-privacy-type-binding.rs:11:13
|
LL | let _: Box<dyn PubTr<AssocTy = u8>>;
| ^
| ^ 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<dyn PubTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<dyn PubTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<AssocTy = u8> {}
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^ 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<dyn PrivTr<AssocTy = u8>>;
| ^
| ^ 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<dyn PrivTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<dyn PrivTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<AssocTy = u8> {}
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ 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<dyn PubTrWithParam<AssocTy = u8>>;
| ^
| ^ 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<dyn PubTrWithParam<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<dyn PubTr<AssocTy = u8>>;
| ^
| ^ 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<dyn PubTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<dyn PubTrWithParam<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<dyn PubTr<AssocTy = u8>>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<AssocTy = u8> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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<AssocTy = u8> {}
| ^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^ private type
...
LL | priv_parent_substs::mac!();
| --------------------------- in this macro invocation

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -2,7 +2,7 @@ error[E0603]: trait `Bar` is private
--> $DIR/privacy-ufcs.rs:12:20
|
LL | <i32 as ::foo::Bar>::baz();
| ^^^ this trait is private
| ^^^ private trait
|
note: the trait `Bar` is defined here
--> $DIR/privacy-ufcs.rs:4:5

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
|

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {<u8 as ext::PrivTrait>::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<u8>) {ext::Pub::<u8>::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)

View File

@ -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 _: <m::Alias as m::TraitWithAssocTy>::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::<m::Alias>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 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 | <m::Alias as m::TraitWithAssocConst>::TRAIT_ASSOC_CONST;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type
error: type `m::Priv` is private
--> $DIR/private-inferred-type.rs:108:6
|
LL | <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST;
| ^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^ private type
error: type `m::Priv` is private
--> $DIR/private-inferred-type.rs:109:5
|
LL | <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST_GENERIC_SELF;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ private type
error: type `m::Priv` is private
--> $DIR/private-inferred-type.rs:110:5
|
LL | <m::Pub<m::Alias>>::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() {<u8 as m::PrivTrait>::method}` is private
--> $DIR/private-inferred-type.rs:43:9
|
LL | <u8 as PrivTrait>::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<u8>) {m::Pub::<u8>::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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 = <m::Alias as m::Trait>::X;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^ private type
error: type `m::Priv` is private
--> $DIR/private-type-in-interface.rs:27:11
|
LL | fn g() -> impl Tr2<m::Alias> { 0 }
| ^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^ private type
error: type `ext::Priv` is private
--> $DIR/private-type-in-interface.rs:28:15
|
LL | fn g_ext() -> impl Tr2<ext::Alias> { 0 }
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ private type
error: aborting due to 9 previous errors

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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::<B>`
| ^^^^^^^ 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::<B>()?
| ^^^^^
error: aborting due to previous error

View File

@ -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

Some files were not shown because too many files have changed in this diff Show More