Rollup merge of #145399 - estebank:resolve-error-wording-2, r=petrochenkov
Unify wording of resolve error
Remove "failed to resolve" from the main error message and use the same format we use in other resolution errors "cannot find `name`":
```
error[E0433]: cannot find `nonexistent` in `existent`
--> $DIR/custom_attr_multisegment_error.rs:5:13
|
LL | #[existent::nonexistent]
| ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```
The intent behind this is to end up with all resolve errors eventually be on the form of
```
error[ECODE]: cannot find `{NAME}` in {SCOPE}
--> $DIR/file.rs:5:13
|
LL | #[existent::nonexistent]
| ^^^^^^^^^^^ {SPECIFIC LABEL}
```
A category of errors that is interest are those that involve keywords. For example:
```
error[E0433]: cannot find `Self` in this scope
--> $DIR/issue-97194.rs:2:35
|
LL | fn bget(&self, index: [usize; Self::DIM]) -> bool {
| ^^^^ `Self` is only available in impls, traits, and type definitions
```
and
```
error[E0433]: cannot find `super` in this scope
--> $DIR/keyword-super.rs:2:9
|
LL | let super: isize;
| ^^^^^ there are too many leading `super` keywords
```
For these the label provides the actual help, while the message is less informative beyond telling you "couldn't find `name`".
This is an off-shoot of https://github.com/rust-lang/rust/pull/126810 and https://github.com/rust-lang/rust/pull/128086, a subset of the intended changes there with review comments applied.
r? @petrochenkov
This commit is contained in:
commit
efbc8957a6
249 changed files with 820 additions and 698 deletions
|
|
@ -469,9 +469,15 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
|
|||
PathResult::NonModule(partial_res) => {
|
||||
expected_found_error(partial_res.expect_full_res())
|
||||
}
|
||||
PathResult::Failed { span, label, suggestion, .. } => {
|
||||
Err(VisResolutionError::FailedToResolve(span, label, suggestion))
|
||||
}
|
||||
PathResult::Failed {
|
||||
span, label, suggestion, message, segment_name, ..
|
||||
} => Err(VisResolutionError::FailedToResolve(
|
||||
span,
|
||||
segment_name,
|
||||
label,
|
||||
suggestion,
|
||||
message,
|
||||
)),
|
||||
PathResult::Indeterminate => Err(VisResolutionError::Indeterminate(path.span)),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ use rustc_span::edit_distance::find_best_match_for_name;
|
|||
use rustc_span::edition::Edition;
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
use rustc_span::source_map::{SourceMap, Spanned};
|
||||
use rustc_span::{BytePos, Ident, Span, Symbol, SyntaxContext, kw, sym};
|
||||
use rustc_span::{BytePos, Ident, RemapPathScopeComponents, Span, Symbol, SyntaxContext, kw, sym};
|
||||
use thin_vec::{ThinVec, thin_vec};
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
|
|
@ -899,9 +899,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => {
|
||||
self.dcx().create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span })
|
||||
}
|
||||
ResolutionError::FailedToResolve { segment, label, suggestion, module } => {
|
||||
let mut err =
|
||||
struct_span_code_err!(self.dcx(), span, E0433, "failed to resolve: {label}");
|
||||
ResolutionError::FailedToResolve { segment, label, suggestion, module, message } => {
|
||||
let mut err = struct_span_code_err!(self.dcx(), span, E0433, "{message}");
|
||||
err.span_label(span, label);
|
||||
|
||||
if let Some((suggestions, msg, applicability)) = suggestion {
|
||||
|
|
@ -909,16 +908,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
err.help(msg);
|
||||
return err;
|
||||
}
|
||||
err.multipart_suggestion(msg, suggestions, applicability);
|
||||
err.multipart_suggestion_verbose(msg, suggestions, applicability);
|
||||
}
|
||||
|
||||
if let Some(segment) = segment {
|
||||
let module = match module {
|
||||
Some(ModuleOrUniformRoot::Module(m)) if let Some(id) = m.opt_def_id() => id,
|
||||
_ => CRATE_DEF_ID.to_def_id(),
|
||||
};
|
||||
self.find_cfg_stripped(&mut err, &segment, module);
|
||||
}
|
||||
|
||||
err
|
||||
}
|
||||
|
|
@ -1108,9 +1105,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
VisResolutionError::AncestorOnly(span) => {
|
||||
self.dcx().create_err(errs::AncestorOnly(span))
|
||||
}
|
||||
VisResolutionError::FailedToResolve(span, label, suggestion) => self.into_struct_error(
|
||||
VisResolutionError::FailedToResolve(span, segment, label, suggestion, message) => self
|
||||
.into_struct_error(
|
||||
span,
|
||||
ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None },
|
||||
ResolutionError::FailedToResolve {
|
||||
segment,
|
||||
label,
|
||||
suggestion,
|
||||
module: None,
|
||||
message,
|
||||
},
|
||||
),
|
||||
VisResolutionError::ExpectedFound(span, path_str, res) => {
|
||||
self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str })
|
||||
|
|
@ -2438,13 +2442,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
failed_segment_idx: usize,
|
||||
ident: Ident,
|
||||
diag_metadata: Option<&DiagMetadata<'_>>,
|
||||
) -> (String, Option<Suggestion>) {
|
||||
) -> (String, String, Option<Suggestion>) {
|
||||
let is_last = failed_segment_idx == path.len() - 1;
|
||||
let ns = if is_last { opt_ns.unwrap_or(TypeNS) } else { TypeNS };
|
||||
let module_res = match module {
|
||||
Some(ModuleOrUniformRoot::Module(module)) => module.res(),
|
||||
_ => None,
|
||||
};
|
||||
let scope = match &path[..failed_segment_idx] {
|
||||
[.., prev] => {
|
||||
if prev.ident.name == kw::PathRoot {
|
||||
format!("the crate root")
|
||||
} else {
|
||||
format!("`{}`", prev.ident)
|
||||
}
|
||||
}
|
||||
_ => format!("this scope"),
|
||||
};
|
||||
let message = format!("cannot find `{ident}` in {scope}");
|
||||
|
||||
if module_res == self.graph_root.res() {
|
||||
let is_mod = |res| matches!(res, Res::Def(DefKind::Mod, _));
|
||||
let mut candidates = self.lookup_import_candidates(ident, TypeNS, parent_scope, is_mod);
|
||||
|
|
@ -2462,6 +2478,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
Path { segments, span: Span::default(), tokens: None }
|
||||
};
|
||||
(
|
||||
message,
|
||||
String::from("unresolved import"),
|
||||
Some((
|
||||
vec![(ident.span, pprust::path_to_string(&path))],
|
||||
|
|
@ -2471,6 +2488,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
)
|
||||
} else if ident.name == sym::core {
|
||||
(
|
||||
message,
|
||||
format!("you might be missing crate `{ident}`"),
|
||||
Some((
|
||||
vec![(ident.span, "std".to_string())],
|
||||
|
|
@ -2479,9 +2497,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
)),
|
||||
)
|
||||
} else if ident.name == kw::Underscore {
|
||||
(format!("`_` is not a valid crate or module name"), None)
|
||||
(
|
||||
"invalid crate or module name `_`".to_string(),
|
||||
"`_` is not a valid crate or module name".to_string(),
|
||||
None,
|
||||
)
|
||||
} else if self.tcx.sess.is_rust_2015() {
|
||||
(
|
||||
format!("cannot find module or crate `{ident}` in {scope}"),
|
||||
format!("use of unresolved module or unlinked crate `{ident}`"),
|
||||
Some((
|
||||
vec![(
|
||||
|
|
@ -2490,8 +2513,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
)],
|
||||
if was_invoked_from_cargo() {
|
||||
format!(
|
||||
"if you wanted to use a crate named `{ident}`, use `cargo add {ident}` \
|
||||
to add it to your `Cargo.toml` and import it in your code",
|
||||
"if you wanted to use a crate named `{ident}`, use `cargo add \
|
||||
{ident}` to add it to your `Cargo.toml` and import it in your \
|
||||
code",
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
|
|
@ -2503,7 +2527,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
)),
|
||||
)
|
||||
} else {
|
||||
(format!("could not find `{ident}` in the crate root"), None)
|
||||
(message, format!("could not find `{ident}` in the crate root"), None)
|
||||
}
|
||||
} else if failed_segment_idx > 0 {
|
||||
let parent = path[failed_segment_idx - 1].ident.name;
|
||||
|
|
@ -2569,15 +2593,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
);
|
||||
};
|
||||
}
|
||||
(msg, None)
|
||||
(message, msg, None)
|
||||
} else if ident.name == kw::SelfUpper {
|
||||
// As mentioned above, `opt_ns` being `None` indicates a module path in import.
|
||||
// We can use this to improve a confusing error for, e.g. `use Self::Variant` in an
|
||||
// impl
|
||||
if opt_ns.is_none() {
|
||||
("`Self` cannot be used in imports".to_string(), None)
|
||||
(message, "`Self` cannot be used in imports".to_string(), None)
|
||||
} else {
|
||||
(
|
||||
message,
|
||||
"`Self` is only available in impls, traits, and type definitions".to_string(),
|
||||
None,
|
||||
)
|
||||
|
|
@ -2608,12 +2633,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
// }
|
||||
// ```
|
||||
Some(LateDecl::RibDef(Res::Local(id))) => {
|
||||
Some(*self.pat_span_map.get(&id).unwrap())
|
||||
Some((*self.pat_span_map.get(&id).unwrap(), "a", "local binding"))
|
||||
}
|
||||
// Name matches item from a local name binding
|
||||
// created by `use` declaration. For example:
|
||||
// ```
|
||||
// pub Foo: &str = "";
|
||||
// pub const Foo: &str = "";
|
||||
//
|
||||
// mod submod {
|
||||
// use super::Foo;
|
||||
|
|
@ -2621,18 +2646,27 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
// // binding `Foo`.
|
||||
// }
|
||||
// ```
|
||||
Some(LateDecl::Decl(name_binding)) => Some(name_binding.span),
|
||||
Some(LateDecl::Decl(name_binding)) => Some((
|
||||
name_binding.span,
|
||||
name_binding.res().article(),
|
||||
name_binding.res().descr(),
|
||||
)),
|
||||
_ => None,
|
||||
};
|
||||
let suggestion = match_span.map(|span| {
|
||||
(
|
||||
vec![(span, String::from(""))],
|
||||
format!("`{ident}` is defined here, but is not a type"),
|
||||
Applicability::MaybeIncorrect,
|
||||
)
|
||||
});
|
||||
|
||||
(format!("use of undeclared type `{ident}`"), suggestion)
|
||||
let message = format!("cannot find type `{ident}` in {scope}");
|
||||
let label = if let Some((span, article, descr)) = match_span {
|
||||
format!(
|
||||
"`{ident}` is declared as {article} {descr} at `{}`, not a type",
|
||||
self.tcx
|
||||
.sess
|
||||
.source_map()
|
||||
.span_to_short_string(span, RemapPathScopeComponents::DIAGNOSTICS)
|
||||
)
|
||||
} else {
|
||||
format!("use of undeclared type `{ident}`")
|
||||
};
|
||||
(message, label, None)
|
||||
} else {
|
||||
let mut suggestion = None;
|
||||
if ident.name == sym::alloc {
|
||||
|
|
@ -2663,7 +2697,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
ignore_import,
|
||||
) {
|
||||
let descr = binding.res().descr();
|
||||
(format!("{descr} `{ident}` is not a crate or module"), suggestion)
|
||||
let message = format!("cannot find module or crate `{ident}` in {scope}");
|
||||
(message, format!("{descr} `{ident}` is not a crate or module"), suggestion)
|
||||
} else {
|
||||
let suggestion = if suggestion.is_some() {
|
||||
suggestion
|
||||
|
|
@ -2685,7 +2720,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
Applicability::MaybeIncorrect,
|
||||
))
|
||||
};
|
||||
(format!("use of unresolved module or unlinked crate `{ident}`"), suggestion)
|
||||
let message = format!("cannot find module or crate `{ident}` in {scope}");
|
||||
(
|
||||
message,
|
||||
format!("use of unresolved module or unlinked crate `{ident}`"),
|
||||
suggestion,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1775,7 +1775,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
finalize.is_some(),
|
||||
module_had_parse_errors,
|
||||
module,
|
||||
|| ("there are too many leading `super` keywords".to_string(), None),
|
||||
|| {
|
||||
(
|
||||
"too many leading `super` keywords".to_string(),
|
||||
"there are too many leading `super` keywords".to_string(),
|
||||
None,
|
||||
)
|
||||
},
|
||||
);
|
||||
}
|
||||
if segment_idx == 0 {
|
||||
|
|
@ -1823,16 +1829,24 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
module,
|
||||
|| {
|
||||
let name_str = if name == kw::PathRoot {
|
||||
"crate root".to_string()
|
||||
"the crate root".to_string()
|
||||
} else {
|
||||
format!("`{name}`")
|
||||
};
|
||||
let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot {
|
||||
format!("global paths cannot start with {name_str}")
|
||||
let (message, label) = if segment_idx == 1
|
||||
&& path[0].ident.name == kw::PathRoot
|
||||
{
|
||||
(
|
||||
format!("global paths cannot start with {name_str}"),
|
||||
"cannot start with this".to_string(),
|
||||
)
|
||||
} else {
|
||||
format!("{name_str} in paths can only be used in start position")
|
||||
(
|
||||
format!("{name_str} in paths can only be used in start position"),
|
||||
"can only be used in path start position".to_string(),
|
||||
)
|
||||
};
|
||||
(label, None)
|
||||
(message, label, None)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -1948,7 +1962,20 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
res.article(),
|
||||
res.descr()
|
||||
);
|
||||
(label, None)
|
||||
let scope = match &path[..segment_idx] {
|
||||
[.., prev] => {
|
||||
if prev.ident.name == kw::PathRoot {
|
||||
format!("the crate root")
|
||||
} else {
|
||||
format!("`{}`", prev.ident)
|
||||
}
|
||||
}
|
||||
_ => format!("this scope"),
|
||||
};
|
||||
// FIXME: reword, as the reason we expected a module is because of
|
||||
// the following path segment.
|
||||
let message = format!("cannot find module `{ident}` in {scope}");
|
||||
(message, label, None)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1042,16 +1042,18 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
suggestion,
|
||||
module,
|
||||
error_implied_by_parse_error: _,
|
||||
message,
|
||||
} => {
|
||||
if no_ambiguity {
|
||||
assert!(import.imported_module.get().is_none());
|
||||
self.report_error(
|
||||
span,
|
||||
ResolutionError::FailedToResolve {
|
||||
segment: Some(segment_name),
|
||||
segment: segment_name,
|
||||
label,
|
||||
suggestion,
|
||||
module,
|
||||
message,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4890,14 +4890,16 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
|
|||
module,
|
||||
segment_name,
|
||||
error_implied_by_parse_error: _,
|
||||
message,
|
||||
} => {
|
||||
return Err(respan(
|
||||
span,
|
||||
ResolutionError::FailedToResolve {
|
||||
segment: Some(segment_name),
|
||||
segment: segment_name,
|
||||
label,
|
||||
suggestion,
|
||||
module,
|
||||
message,
|
||||
},
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,10 +280,11 @@ enum ResolutionError<'ra> {
|
|||
SelfImportOnlyInImportListWithNonEmptyPrefix,
|
||||
/// Error E0433: failed to resolve.
|
||||
FailedToResolve {
|
||||
segment: Option<Symbol>,
|
||||
segment: Symbol,
|
||||
label: String,
|
||||
suggestion: Option<Suggestion>,
|
||||
module: Option<ModuleOrUniformRoot<'ra>>,
|
||||
message: String,
|
||||
},
|
||||
/// Error E0434: can't capture dynamic environment in a fn item.
|
||||
CannotCaptureDynamicEnvironmentInFnItem,
|
||||
|
|
@ -342,7 +343,7 @@ enum ResolutionError<'ra> {
|
|||
enum VisResolutionError<'a> {
|
||||
Relative2018(Span, &'a ast::Path),
|
||||
AncestorOnly(Span),
|
||||
FailedToResolve(Span, String, Option<Suggestion>),
|
||||
FailedToResolve(Span, Symbol, String, Option<Suggestion>, String),
|
||||
ExpectedFound(Span, String, Res),
|
||||
Indeterminate(Span),
|
||||
ModuleOnly(Span),
|
||||
|
|
@ -486,6 +487,7 @@ enum PathResult<'ra> {
|
|||
/// The segment name of target
|
||||
segment_name: Symbol,
|
||||
error_implied_by_parse_error: bool,
|
||||
message: String,
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -496,10 +498,14 @@ impl<'ra> PathResult<'ra> {
|
|||
finalize: bool,
|
||||
error_implied_by_parse_error: bool,
|
||||
module: Option<ModuleOrUniformRoot<'ra>>,
|
||||
label_and_suggestion: impl FnOnce() -> (String, Option<Suggestion>),
|
||||
label_and_suggestion: impl FnOnce() -> (String, String, Option<Suggestion>),
|
||||
) -> PathResult<'ra> {
|
||||
let (label, suggestion) =
|
||||
if finalize { label_and_suggestion() } else { (String::new(), None) };
|
||||
let (message, label, suggestion) = if finalize {
|
||||
label_and_suggestion()
|
||||
} else {
|
||||
// FIXME: this output isn't actually present in the test suite.
|
||||
(format!("cannot find `{ident}` in this scope"), String::new(), None)
|
||||
};
|
||||
PathResult::Failed {
|
||||
span: ident.span,
|
||||
segment_name: ident.name,
|
||||
|
|
@ -508,6 +514,7 @@ impl<'ra> PathResult<'ra> {
|
|||
is_error_from_last_segment,
|
||||
module,
|
||||
error_implied_by_parse_error,
|
||||
message,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -908,10 +908,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
),
|
||||
path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => {
|
||||
let mut suggestion = None;
|
||||
let (span, label, module, segment) =
|
||||
if let PathResult::Failed { span, label, module, segment_name, .. } =
|
||||
path_res
|
||||
{
|
||||
let (span, message, label, module, segment) = match path_res {
|
||||
PathResult::Failed {
|
||||
span, label, module, segment_name, message, ..
|
||||
} => {
|
||||
// try to suggest if it's not a macro, maybe a function
|
||||
if let PathResult::NonModule(partial_res) = self
|
||||
.cm()
|
||||
|
|
@ -930,26 +930,52 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
|||
Applicability::MaybeIncorrect,
|
||||
));
|
||||
}
|
||||
(span, label, module, segment_name)
|
||||
} else {
|
||||
(span, message, label, module, segment_name)
|
||||
}
|
||||
PathResult::NonModule(partial_res) => {
|
||||
let found_an = partial_res.base_res().article();
|
||||
let found_descr = partial_res.base_res().descr();
|
||||
let scope = match &path[..partial_res.unresolved_segments()] {
|
||||
[.., prev] => {
|
||||
format!("{found_descr} `{}`", prev.ident)
|
||||
}
|
||||
_ => found_descr.to_string(),
|
||||
};
|
||||
let expected_an = kind.article();
|
||||
let expected_descr = kind.descr();
|
||||
let expected_name = path[partial_res.unresolved_segments()].ident;
|
||||
|
||||
(
|
||||
path_span,
|
||||
format!(
|
||||
"partially resolved path in {} {}",
|
||||
kind.article(),
|
||||
kind.descr()
|
||||
"cannot find {expected_descr} `{expected_name}` in {scope}"
|
||||
),
|
||||
match partial_res.base_res() {
|
||||
Res::Def(
|
||||
DefKind::Mod | DefKind::Macro(..) | DefKind::ExternCrate,
|
||||
_,
|
||||
) => format!(
|
||||
"partially resolved path in {expected_an} {expected_descr}",
|
||||
),
|
||||
_ => format!(
|
||||
"{expected_an} {expected_descr} can't exist within \
|
||||
{found_an} {found_descr}"
|
||||
),
|
||||
},
|
||||
None,
|
||||
path.last().map(|segment| segment.ident.name).unwrap(),
|
||||
)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
};
|
||||
self.report_error(
|
||||
span,
|
||||
ResolutionError::FailedToResolve {
|
||||
segment: Some(segment),
|
||||
segment,
|
||||
label,
|
||||
suggestion,
|
||||
module,
|
||||
message,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ struct Foo(isize, isize, isize, isize);
|
|||
|
||||
pub fn main() {
|
||||
let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5);
|
||||
//~^ ERROR: failed to resolve
|
||||
//~^ ERROR: cannot find `Self` in this scope
|
||||
match [5, 5, 5, 5] {
|
||||
[..] => {},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions
|
||||
error[E0433]: cannot find `Self` in this scope
|
||||
--> tests/ui/crashes/unreachable-array-or-slice.rs:4:9
|
||||
|
|
||||
LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ struct Struct<T>(T);
|
|||
impl<T> std::ops::Deref for Struct<T> {
|
||||
type Target = dyn Fn(T);
|
||||
fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
|
||||
//~^ERROR: use of unresolved module or unlinked crate
|
||||
//~^ERROR: cannot find module or crate `assert_mem_uninitialized_valid` in this scope
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `assert_mem_uninitialized_valid`
|
||||
error[E0433]: cannot find module or crate `assert_mem_uninitialized_valid` in this scope
|
||||
--> tests/fail/rustc-error2.rs:LL:CC
|
||||
|
|
||||
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `Complete`
|
||||
error[E0433]: cannot find type `Complete` in this scope
|
||||
--> foo.rs:3:12
|
||||
|
|
||||
3 | x.push(Complete::Item { name: "hello" });
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `Complete`
|
||||
error[E0433]: cannot find type `Complete` in this scope
|
||||
--> foo.rs:3:12
|
||||
|
|
||||
3 | x.push(Complete::Item { name: "hello" });
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Regression test for issue #95879.
|
||||
|
||||
use unresolved_crate::module::Name; //~ ERROR failed to resolve
|
||||
use unresolved_crate::module::Name; //~ ERROR cannot find
|
||||
|
||||
/// [Name]
|
||||
pub struct S;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_crate`
|
||||
error[E0433]: cannot find module or crate `unresolved_crate` in the crate root
|
||||
--> $DIR/unresolved-import-recovery.rs:3:5
|
||||
|
|
||||
LL | use unresolved_crate::module::Name;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// This previously triggered an ICE.
|
||||
|
||||
pub(in crate::r#mod) fn main() {}
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `r#mod`
|
||||
//~^ ERROR cannot find module or crate `r#mod` in `crate`
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod`
|
||||
error[E0433]: cannot find module or crate `r#mod` in `crate`
|
||||
--> $DIR/issue-61732.rs:3:15
|
||||
|
|
||||
LL | pub(in crate::r#mod) fn main() {}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ struct MessageWrongType {
|
|||
struct InvalidPathFieldAttr {
|
||||
#[nonsense]
|
||||
//~^ ERROR `#[nonsense]` is not a valid attribute
|
||||
//~^^ ERROR cannot find attribute `nonsense` in this scope
|
||||
//~| ERROR cannot find attribute `nonsense` in this scope
|
||||
foo: String,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,6 +90,14 @@ struct G {
|
|||
var: String,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label("...")]
|
||||
struct H {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
var: String,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
#[label(slug = 4)]
|
||||
//~^ ERROR no nested attribute expected here
|
||||
|
|
|
|||
|
|
@ -35,109 +35,109 @@ LL | #[label(bug = "...")]
|
|||
| ^
|
||||
|
||||
error: derive(Diagnostic): no nested attribute expected here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:94:9
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:102:9
|
||||
|
|
||||
LL | #[label(slug = 4)]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:94:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:102:1
|
||||
|
|
||||
LL | #[label(slug = 4)]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): no nested attribute expected here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:104:9
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:112:9
|
||||
|
|
||||
LL | #[label(slug("..."))]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:104:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:112:1
|
||||
|
|
||||
LL | #[label(slug("..."))]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:114:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:122:1
|
||||
|
|
||||
LL | #[label()]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): no nested attribute expected here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:123:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:131:28
|
||||
|
|
||||
LL | #[label("example message", code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): no nested attribute expected here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:132:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:140:28
|
||||
|
|
||||
LL | #[label("example message", applicability = "machine-applicable")]
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:141:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:149:1
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:155:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:163:5
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:167:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:175:5
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:179:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:187:5
|
||||
|
|
||||
LL | #[bar = 4]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:191:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:199:5
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): no nested attribute expected here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:203:13
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:211:13
|
||||
|
|
||||
LL | #[label(code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:203:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:211:5
|
||||
|
|
||||
LL | #[label(code = "...")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:232:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:240:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): label without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:229:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:237:1
|
||||
|
|
||||
LL | #[label("example message")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[applicability]` is only valid on suggestions
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:242:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:250:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:252:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:260:5
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^
|
||||
|
|
@ -145,13 +145,13 @@ LL | #[bar]
|
|||
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
|
||||
|
||||
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:263:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:271:5
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:274:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:282:5
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^
|
||||
|
|
@ -159,7 +159,7 @@ LL | #[bar("...")]
|
|||
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
|
||||
|
||||
error: unexpected unsupported untagged union
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:290:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:298:1
|
||||
|
|
||||
LL | / union AC {
|
||||
LL | |
|
||||
|
|
@ -169,97 +169,97 @@ LL | | }
|
|||
| |_^
|
||||
|
||||
error: expected this path to be an identifier
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:305:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:313:28
|
||||
|
|
||||
LL | #[label("example message", no_crate::example)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: derive(Diagnostic): attribute specified multiple times
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:318:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:326:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:315:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:323:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): subdiagnostic kind not specified
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:324:8
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:332:8
|
||||
|
|
||||
LL | struct AG {
|
||||
| ^^
|
||||
|
||||
error: derive(Diagnostic): attribute specified multiple times
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:361:47
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:369:47
|
||||
|
|
||||
LL | #[suggestion("example message", code = "...", code = "...")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:361:33
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:369:33
|
||||
|
|
||||
LL | #[suggestion("example message", code = "...", code = "...")]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): attribute specified multiple times
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:379:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:387:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:376:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:384:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): the `#[applicability]` attribute can only be applied to fields of type `Applicability`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:389:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:397:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): suggestion without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:402:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:410:1
|
||||
|
|
||||
LL | #[suggestion("example message")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): invalid applicability
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:412:63
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:420:63
|
||||
|
|
||||
LL | #[suggestion("example message", code = "...", applicability = "foo")]
|
||||
| ^^^^^
|
||||
|
||||
error: derive(Diagnostic): suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:430:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:438:1
|
||||
|
|
||||
LL | #[suggestion("example message", code = "...")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:444:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:452:1
|
||||
|
|
||||
LL | #[label]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `var` doesn't refer to a field on this type
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:464:40
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:472:40
|
||||
|
|
||||
LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")]
|
||||
| ^^^^^^^
|
||||
|
||||
error: derive(Diagnostic): `var` doesn't refer to a field on this type
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:483:44
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:491:44
|
||||
|
|
||||
LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")]
|
||||
| ^^^^^^^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:506:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:514:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^
|
||||
|
|
@ -267,7 +267,7 @@ LL | #[suggestion_part]
|
|||
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:509:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:517:5
|
||||
|
|
||||
LL | #[suggestion_part(code = "...")]
|
||||
| ^
|
||||
|
|
@ -275,13 +275,13 @@ LL | #[suggestion_part(code = "...")]
|
|||
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions
|
||||
|
||||
error: derive(Diagnostic): suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:503:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:511:1
|
||||
|
|
||||
LL | #[suggestion("example message", code = "...")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): invalid nested attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:518:43
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:526:43
|
||||
|
|
||||
LL | #[multipart_suggestion("example message", code = "...", applicability = "machine-applicable")]
|
||||
| ^^^^
|
||||
|
|
@ -289,25 +289,25 @@ LL | #[multipart_suggestion("example message", code = "...", applicability = "ma
|
|||
= help: only `style` and `applicability` are valid nested attributes
|
||||
|
||||
error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:518:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:526:1
|
||||
|
|
||||
LL | #[multipart_suggestion("example message", code = "...", applicability = "machine-applicable")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:528:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:536:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:536:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:544:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:545:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:553:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^
|
||||
|
|
@ -315,127 +315,127 @@ LL | #[primary_span]
|
|||
= help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`
|
||||
|
||||
error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:542:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:550:1
|
||||
|
|
||||
LL | #[multipart_suggestion("example message")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:553:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:561:5
|
||||
|
|
||||
LL | #[suggestion_part]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:556:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:564:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `code` is the only valid nested attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:559:23
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:567:23
|
||||
|
|
||||
LL | #[suggestion_part(foo = "bar")]
|
||||
| ^^^
|
||||
|
||||
error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:563:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:571:5
|
||||
|
|
||||
LL | #[suggestion_part(code = "...")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:566:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:574:5
|
||||
|
|
||||
LL | #[suggestion_part()]
|
||||
| ^
|
||||
|
||||
error: expected `,`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:559:27
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:567:27
|
||||
|
|
||||
LL | #[suggestion_part(foo = "bar")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): attribute specified multiple times
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:574:37
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:582:37
|
||||
|
|
||||
LL | #[suggestion_part(code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:574:23
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:582:23
|
||||
|
|
||||
LL | #[suggestion_part(code = "...", code = ",,,")]
|
||||
| ^^^^
|
||||
|
||||
error: derive(Diagnostic): `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:603:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:611:5
|
||||
|
|
||||
LL | #[applicability]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:651:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:659:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo"))]
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token, expected `)`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:651:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:659:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo"))]
|
||||
| ^^^^^
|
||||
|
||||
error: derive(Diagnostic): expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:661:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:669:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo", "bar"))]
|
||||
| ^^^^^
|
||||
|
||||
error: unexpected token, expected `)`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:661:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:669:28
|
||||
|
|
||||
LL | #[suggestion_part(code("foo", "bar"))]
|
||||
| ^^^^^
|
||||
|
||||
error: derive(Diagnostic): expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:671:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:679:28
|
||||
|
|
||||
LL | #[suggestion_part(code(3))]
|
||||
| ^
|
||||
|
||||
error: unexpected token, expected `)`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:671:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:679:28
|
||||
|
|
||||
LL | #[suggestion_part(code(3))]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): expected exactly one string literal for `code = ...`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:681:28
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:689:28
|
||||
|
|
||||
LL | #[suggestion_part(code())]
|
||||
| ^
|
||||
|
||||
error: expected string literal
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:690:30
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:698:30
|
||||
|
|
||||
LL | #[suggestion_part(code = 3)]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): attribute specified multiple times
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:732:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:740:1
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")]
|
||||
| ^
|
||||
|
|
||||
note: previously specified here
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:732:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:740:1
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:741:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:749:1
|
||||
|
|
||||
LL | #[suggestion_hidden("example message", code = "")]
|
||||
| ^
|
||||
|
|
@ -443,7 +443,7 @@ LL | #[suggestion_hidden("example message", code = "")]
|
|||
= help: Use `#[suggestion(..., style = "hidden")]` instead
|
||||
|
||||
error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:749:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:757:1
|
||||
|
|
||||
LL | #[suggestion_hidden("example message", code = "", style = "normal")]
|
||||
| ^
|
||||
|
|
@ -451,7 +451,7 @@ LL | #[suggestion_hidden("example message", code = "", style = "normal")]
|
|||
= help: Use `#[suggestion(..., style = "hidden")]` instead
|
||||
|
||||
error: derive(Diagnostic): invalid suggestion style
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:757:52
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:765:52
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style = "foo")]
|
||||
| ^^^^^
|
||||
|
|
@ -459,25 +459,25 @@ LL | #[suggestion("example message", code = "", style = "foo")]
|
|||
= help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
|
||||
|
||||
error: expected string literal
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:765:52
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:773:52
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style = 42)]
|
||||
| ^^
|
||||
|
||||
error: expected `=`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:773:49
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:781:49
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style)]
|
||||
| ^
|
||||
|
||||
error: expected `=`
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:781:49
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:789:49
|
||||
|
|
||||
LL | #[suggestion("example message", code = "", style("foo"))]
|
||||
| ^
|
||||
|
||||
error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:792:5
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:800:5
|
||||
|
|
||||
LL | #[primary_span]
|
||||
| ^
|
||||
|
|
@ -486,7 +486,7 @@ LL | #[primary_span]
|
|||
= help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
|
||||
|
||||
error: derive(Diagnostic): suggestion without `#[primary_span]` field
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:789:1
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:797:1
|
||||
|
|
||||
LL | #[suggestion("example message", code = "")]
|
||||
| ^
|
||||
|
|
@ -498,49 +498,49 @@ LL | #[foo]
|
|||
| ^^^
|
||||
|
||||
error: cannot find attribute `foo` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:141:3
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:149:3
|
||||
|
|
||||
LL | #[foo]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:155:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:163:7
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:167:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:175:7
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:179:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:187:7
|
||||
|
|
||||
LL | #[bar = 4]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:191:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:199:7
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:252:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:260:7
|
||||
|
|
||||
LL | #[bar]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:263:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:271:7
|
||||
|
|
||||
LL | #[bar = "..."]
|
||||
| ^^^
|
||||
|
||||
error: cannot find attribute `bar` in this scope
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:274:7
|
||||
--> $DIR/subdiagnostic-derive-inline.rs:282:7
|
||||
|
|
||||
LL | #[bar("...")]
|
||||
| ^^^
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ fn main() {
|
|||
// Check that the path of an attribute without a name is printed correctly (issue #140082)
|
||||
#[::a]
|
||||
//~^ ERROR attribute incompatible with `#[unsafe(naked)]`
|
||||
//~| ERROR failed to resolve: use of unresolved module or unlinked crate `a`
|
||||
//~| ERROR cannot find module or crate `a` in the crate root
|
||||
#[unsafe(naked)]
|
||||
extern "C" fn issue_140082() {
|
||||
naked_asm!("")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
|
||||
error[E0433]: cannot find module or crate `a` in the crate root
|
||||
--> $DIR/naked-invalid-attr.rs:57:5
|
||||
|
|
||||
LL | #[::a]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
// Regression test for https://github.com/rust-lang/rust/issues/143789
|
||||
#[must_use::skip]
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `must_use`
|
||||
//~^ ERROR: cannot find module or crate `must_use`
|
||||
fn main() { }
|
||||
|
||||
// Regression test for https://github.com/rust-lang/rust/issues/137590
|
||||
struct S(#[stable::skip] u8, u16, u32);
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `stable`
|
||||
//~^ ERROR: cannot find module or crate `stable`
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `stable`
|
||||
error[E0433]: cannot find module or crate `stable` in this scope
|
||||
--> $DIR/builtin-attribute-prefix.rs:7:12
|
||||
|
|
||||
LL | struct S(#[stable::skip] u8, u16, u32);
|
||||
| ^^^^^^ use of unresolved module or unlinked crate `stable`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `must_use`
|
||||
error[E0433]: cannot find module or crate `must_use` in this scope
|
||||
--> $DIR/builtin-attribute-prefix.rs:2:3
|
||||
|
|
||||
LL | #[must_use::skip]
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@
|
|||
|
||||
struct Foo {
|
||||
#[should_panic::skip]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
pub field: u8,
|
||||
|
||||
#[should_panic::a::b::c]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
pub field2: u8,
|
||||
}
|
||||
|
||||
|
|
@ -55,6 +55,6 @@ fn foo() {}
|
|||
|
||||
fn main() {
|
||||
#[deny::skip]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
foo();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
|
||||
error[E0433]: cannot find module or crate `should_panic` in this scope
|
||||
--> $DIR/check-builtin-attr-ice.rs:45:7
|
||||
|
|
||||
LL | #[should_panic::skip]
|
||||
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic`
|
||||
error[E0433]: cannot find module or crate `should_panic` in this scope
|
||||
--> $DIR/check-builtin-attr-ice.rs:49:7
|
||||
|
|
||||
LL | #[should_panic::a::b::c]
|
||||
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `deny`
|
||||
error[E0433]: cannot find module or crate `deny` in this scope
|
||||
--> $DIR/check-builtin-attr-ice.rs:57:7
|
||||
|
|
||||
LL | #[deny::skip]
|
||||
|
|
|
|||
|
|
@ -10,27 +10,27 @@
|
|||
#![crate_type = "lib"]
|
||||
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
mod we_are_no_strangers_to_love {}
|
||||
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
struct YouKnowTheRules {
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
and_so_do_i: u8,
|
||||
}
|
||||
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
fn a_full_commitment() {
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
let is_what_i_am_thinking_of = ();
|
||||
}
|
||||
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
union AnyOtherGuy {
|
||||
owo: ()
|
||||
}
|
||||
|
|
@ -39,30 +39,30 @@ struct This;
|
|||
#[cfg_attr(FALSE, doc = "you wouldn't get this")]
|
||||
impl From<AnyOtherGuy> for This {
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR attributes on expressions are experimental
|
||||
//~| ERROR failed to resolve
|
||||
//~| ERROR cannot find
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
enum NeverGonna {
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
GiveYouUp(#[cfg_attr::no_such_thing] u8),
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
LetYouDown {
|
||||
#![cfg_attr::no_such_thing]
|
||||
//~^ ERROR an inner attribute is not permitted in this context
|
||||
never_gonna: (),
|
||||
round_around: (),
|
||||
#[cfg_attr::no_such_thing]
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
and_desert_you: (),
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,79 +17,79 @@ LL | #[cfg_attr::no_such_thing]
|
|||
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable
|
||||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:52:3
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:55:7
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:57:17
|
||||
|
|
||||
LL | GiveYouUp(#[cfg_attr::no_such_thing] u8),
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:64:11
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:41:7
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:43:15
|
||||
|
|
||||
LL | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:45:11
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:32:3
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:24:3
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:27:7
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:16:3
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:19:7
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr`
|
||||
error[E0433]: cannot find module or crate `cfg_attr` in this scope
|
||||
--> $DIR/check-cfg_attr-ice.rs:12:3
|
||||
|
|
||||
LL | #[cfg_attr::no_such_thing]
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
mod existent {}
|
||||
|
||||
#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
|
||||
#[existent::nonexistent] //~ ERROR cannot find `nonexistent` in `existent`
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: could not find `nonexistent` in `existent`
|
||||
error[E0433]: cannot find `nonexistent` in `existent`
|
||||
--> $DIR/custom_attr_multisegment_error.rs:5:13
|
||||
|
|
||||
LL | #[existent::nonexistent]
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ mod internal {
|
|||
|
||||
struct S {
|
||||
#[rustfmt::skip]
|
||||
pub(in nonexistent) field: u8 //~ ERROR failed to resolve
|
||||
pub(in nonexistent) field: u8 //~ ERROR cannot find
|
||||
}
|
||||
|
||||
struct Z(
|
||||
#[rustfmt::skip]
|
||||
pub(in nonexistent) u8 //~ ERROR failed to resolve
|
||||
pub(in nonexistent) u8 //~ ERROR cannot find
|
||||
);
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
|
||||
error[E0433]: cannot find module or crate `nonexistent` in the crate root
|
||||
--> $DIR/field-attributes-vis-unresolved.rs:18:12
|
||||
|
|
||||
LL | pub(in nonexistent) field: u8
|
||||
|
|
@ -9,7 +9,7 @@ help: you might be missing a crate named `nonexistent`, add it to your project a
|
|||
LL + extern crate nonexistent;
|
||||
|
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent`
|
||||
error[E0433]: cannot find module or crate `nonexistent` in the crate root
|
||||
--> $DIR/field-attributes-vis-unresolved.rs:23:12
|
||||
|
|
||||
LL | pub(in nonexistent) u8
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
// issue#140255
|
||||
|
||||
#[macro_use::a] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_use`
|
||||
#[macro_use::a] //~ ERROR cannot find
|
||||
fn f0() {}
|
||||
|
||||
#[macro_use::a::b] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_use`
|
||||
#[macro_use::a::b] //~ ERROR cannot find
|
||||
fn f1() {}
|
||||
|
||||
#[macro_escape::a] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_escape`
|
||||
#[macro_escape::a] //~ ERROR cannot find
|
||||
fn f2() {}
|
||||
|
||||
#[macro_escape::a::b] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_escape`
|
||||
#[macro_escape::a::b] //~ ERROR cannot find
|
||||
fn f3() {}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_escape`
|
||||
error[E0433]: cannot find module or crate `macro_escape` in this scope
|
||||
--> $DIR/illegal-macro-use.rs:12:3
|
||||
|
|
||||
LL | #[macro_escape::a::b]
|
||||
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_escape`
|
||||
error[E0433]: cannot find module or crate `macro_escape` in this scope
|
||||
--> $DIR/illegal-macro-use.rs:9:3
|
||||
|
|
||||
LL | #[macro_escape::a]
|
||||
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_use`
|
||||
error[E0433]: cannot find module or crate `macro_use` in this scope
|
||||
--> $DIR/illegal-macro-use.rs:6:3
|
||||
|
|
||||
LL | #[macro_use::a::b]
|
||||
| ^^^^^^^^^ use of unresolved module or unlinked crate `macro_use`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_use`
|
||||
error[E0433]: cannot find module or crate `macro_use` in this scope
|
||||
--> $DIR/illegal-macro-use.rs:3:3
|
||||
|
|
||||
LL | #[macro_use::a]
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ fn main() {
|
|||
//~| HELP: `S5` has a name defined in the doc alias attribute as `DocAliasS5`
|
||||
|
||||
not_exist_module::DocAliasS1;
|
||||
//~^ ERROR: use of unresolved module or unlinked crate `not_exist_module`
|
||||
//~^ ERROR: cannot find module or crate `not_exist_module`
|
||||
//~| HELP: you might be missing a crate named `not_exist_module`
|
||||
|
||||
use_doc_alias_name_extern::DocAliasS1;
|
||||
|
|
@ -50,7 +50,7 @@ fn main() {
|
|||
//~| HELP: `S1` has a name defined in the doc alias attribute as `DocAliasS1`
|
||||
|
||||
m::n::DocAliasX::y::S6;
|
||||
//~^ ERROR: could not find `DocAliasX` in `n`
|
||||
//~^ ERROR: cannot find `DocAliasX` in `n`
|
||||
//~| HELP: `x` has a name defined in the doc alias attribute as `DocAliasX`
|
||||
|
||||
m::n::x::y::DocAliasS6;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: could not find `DocAliasX` in `n`
|
||||
error[E0433]: cannot find `DocAliasX` in `n`
|
||||
--> $DIR/use-doc-alias-name.rs:52:11
|
||||
|
|
||||
LL | m::n::DocAliasX::y::S6;
|
||||
|
|
@ -136,7 +136,7 @@ LL - doc_alias_f2();
|
|||
LL + f();
|
||||
|
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `not_exist_module`
|
||||
error[E0433]: cannot find module or crate `not_exist_module` in this scope
|
||||
--> $DIR/use-doc-alias-name.rs:44:5
|
||||
|
|
||||
LL | not_exist_module::DocAliasS1;
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
fn main() {
|
||||
let mut a = E::StructVar { boxed: Box::new(5_i32) };
|
||||
//~^ ERROR failed to resolve: use of undeclared type `E`
|
||||
//~^ ERROR cannot find type `E`
|
||||
match a {
|
||||
E::StructVar { box boxed } => { }
|
||||
//~^ ERROR failed to resolve: use of undeclared type `E`
|
||||
//~^ ERROR cannot find type `E`
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `E`
|
||||
error[E0433]: cannot find type `E` in this scope
|
||||
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
|
||||
|
|
||||
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) };
|
||||
|
|
@ -9,7 +9,7 @@ help: a trait with a similar name exists
|
|||
LL | let mut a = Eq::StructVar { boxed: Box::new(5_i32) };
|
||||
| +
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared type `E`
|
||||
error[E0433]: cannot find type `E` in this scope
|
||||
--> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
|
||||
|
|
||||
LL | E::StructVar { box boxed } => { }
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ fn main() {
|
|||
|
||||
// The module isn't found - we would like to get a diagnostic, but currently don't due to
|
||||
// the awkward way the resolver diagnostics are currently implemented.
|
||||
cfged_out::inner::doesnt_exist::hello(); //~ ERROR failed to resolve
|
||||
cfged_out::inner::doesnt_exist::hello(); //~ ERROR cannot find
|
||||
//~^ NOTE could not find `doesnt_exist` in `inner`
|
||||
//~| NOTE found an item that was configured out
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
|
||||
error[E0433]: cannot find `doesnt_exist` in `inner`
|
||||
--> $DIR/diagnostics-cross-crate.rs:17:23
|
||||
|
|
||||
LL | cfged_out::inner::doesnt_exist::hello();
|
||||
|
|
|
|||
|
|
@ -40,22 +40,22 @@ mod reexport32 {
|
|||
|
||||
fn main() {
|
||||
reexport::gated::foo();
|
||||
//~^ ERROR failed to resolve: could not find `gated` in `reexport`
|
||||
//~^ ERROR cannot find
|
||||
//~| NOTE could not find `gated` in `reexport`
|
||||
|
||||
reexport2::gated::foo();
|
||||
//~^ ERROR failed to resolve: could not find `gated` in `reexport2`
|
||||
//~^ ERROR cannot find
|
||||
//~| NOTE could not find `gated` in `reexport2`
|
||||
|
||||
reexport30::gated::foo();
|
||||
//~^ ERROR failed to resolve: could not find `gated` in `reexport30`
|
||||
//~^ ERROR cannot find
|
||||
//~| NOTE could not find `gated` in `reexport30`
|
||||
|
||||
reexport31::gated::foo();
|
||||
//~^ ERROR failed to resolve: could not find `gated` in `reexport31`
|
||||
//~^ ERROR cannot find
|
||||
//~| NOTE could not find `gated` in `reexport31`
|
||||
|
||||
reexport32::gated::foo();
|
||||
//~^ ERROR failed to resolve: could not find `gated` in `reexport32`
|
||||
//~^ ERROR cannot find
|
||||
//~| NOTE could not find `gated` in `reexport32`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: could not find `gated` in `reexport`
|
||||
error[E0433]: cannot find `gated` in `reexport`
|
||||
--> $DIR/diagnostics-reexport-2.rs:42:15
|
||||
|
|
||||
LL | reexport::gated::foo();
|
||||
|
|
@ -13,7 +13,7 @@ LL | #[cfg(false)]
|
|||
LL | pub mod gated {
|
||||
| ^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: could not find `gated` in `reexport2`
|
||||
error[E0433]: cannot find `gated` in `reexport2`
|
||||
--> $DIR/diagnostics-reexport-2.rs:46:16
|
||||
|
|
||||
LL | reexport2::gated::foo();
|
||||
|
|
@ -28,7 +28,7 @@ LL | #[cfg(false)]
|
|||
LL | pub mod gated {
|
||||
| ^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: could not find `gated` in `reexport30`
|
||||
error[E0433]: cannot find `gated` in `reexport30`
|
||||
--> $DIR/diagnostics-reexport-2.rs:50:17
|
||||
|
|
||||
LL | reexport30::gated::foo();
|
||||
|
|
@ -43,7 +43,7 @@ LL | #[cfg(false)]
|
|||
LL | pub mod gated {
|
||||
| ^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: could not find `gated` in `reexport31`
|
||||
error[E0433]: cannot find `gated` in `reexport31`
|
||||
--> $DIR/diagnostics-reexport-2.rs:54:17
|
||||
|
|
||||
LL | reexport31::gated::foo();
|
||||
|
|
@ -58,7 +58,7 @@ LL | #[cfg(false)]
|
|||
LL | pub mod gated {
|
||||
| ^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: could not find `gated` in `reexport32`
|
||||
error[E0433]: cannot find `gated` in `reexport32`
|
||||
--> $DIR/diagnostics-reexport-2.rs:58:17
|
||||
|
|
||||
LL | reexport32::gated::foo();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ fn main() {
|
|||
//~| NOTE not found in `inner`
|
||||
|
||||
// The module isn't found - we get a diagnostic.
|
||||
inner::doesnt_exist::hello(); //~ ERROR failed to resolve
|
||||
inner::doesnt_exist::hello(); //~ ERROR cannot find
|
||||
//~| NOTE could not find `doesnt_exist` in `inner`
|
||||
|
||||
// It should find the one in the right module, not the wrong one.
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ LL | #[cfg(false)]
|
|||
LL | pub mod doesnt_exist {
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner`
|
||||
error[E0433]: cannot find `doesnt_exist` in `inner`
|
||||
--> $DIR/diagnostics-same-crate.rs:53:12
|
||||
|
|
||||
LL | inner::doesnt_exist::hello();
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
struct ErrorKind;
|
||||
struct Error(ErrorKind);
|
||||
|
||||
impl From<nope::Thing> for Error { //~ ERROR failed to resolve
|
||||
fn from(_: nope::Thing) -> Self { //~ ERROR failed to resolve
|
||||
impl From<nope::Thing> for Error { //~ ERROR cannot find
|
||||
fn from(_: nope::Thing) -> Self { //~ ERROR cannot find
|
||||
unimplemented!()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
|
||||
error[E0433]: cannot find module or crate `nope` in this scope
|
||||
--> $DIR/conflicting-impl-with-err.rs:4:11
|
||||
|
|
||||
LL | impl From<nope::Thing> for Error {
|
||||
|
|
@ -6,7 +6,7 @@ LL | impl From<nope::Thing> for Error {
|
|||
|
|
||||
= help: you might be missing a crate named `nope`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope`
|
||||
error[E0433]: cannot find module or crate `nope` in this scope
|
||||
--> $DIR/conflicting-impl-with-err.rs:5:16
|
||||
|
|
||||
LL | fn from(_: nope::Thing) -> Self {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ where
|
|||
//~^ ERROR only lifetime parameters can be used in this context
|
||||
//~| ERROR defaults for generic parameters are not allowed in `for<...>` binders
|
||||
//~| ERROR defaults for generic parameters are not allowed in `for<...>` binders
|
||||
//~| ERROR failed to resolve: use of undeclared type `COT`
|
||||
//~| ERROR cannot find
|
||||
//~| ERROR the name `N` is already used for a generic parameter in this item's generic parameters
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ error: defaults for generic parameters are not allowed in `for<...>` binders
|
|||
LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
|
||||
| ^^^^^^^
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared type `COT`
|
||||
error[E0433]: cannot find type `COT` in this scope
|
||||
--> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43
|
||||
|
|
||||
LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ where
|
|||
|
||||
fn pop(self) -> (Self::Newlen, Self::Output) {
|
||||
let mut iter = IntoIter::new(self);
|
||||
//~^ ERROR: failed to resolve: use of undeclared type `IntoIter`
|
||||
//~^ ERROR: cannot find
|
||||
let end = iter.next_back().unwrap();
|
||||
let new = [(); N - 1].map(move |()| iter.next().unwrap());
|
||||
(new, end)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `IntoIter`
|
||||
error[E0433]: cannot find type `IntoIter` in this scope
|
||||
--> $DIR/issue-82956.rs:26:24
|
||||
|
|
||||
LL | let mut iter = IntoIter::new(self);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
const REF_INTERIOR_MUT: &usize = {
|
||||
//~^ HELP consider importing this struct
|
||||
static FOO: Sync = AtomicUsize::new(0);
|
||||
//~^ ERROR failed to resolve: use of undeclared type `AtomicUsize`
|
||||
//~^ ERROR cannot find
|
||||
//~| WARN trait objects without an explicit `dyn` are deprecated
|
||||
//~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time
|
||||
//~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `AtomicUsize`
|
||||
error[E0433]: cannot find type `AtomicUsize` in this scope
|
||||
--> $DIR/const_refs_to_static-ice-121413.rs:9:24
|
||||
|
|
||||
LL | static FOO: Sync = AtomicUsize::new(0);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ impl Trait for S {
|
|||
}
|
||||
|
||||
mod prefix {}
|
||||
reuse unresolved_prefix::{a, b, c}; //~ ERROR use of unresolved module or unlinked crate
|
||||
reuse unresolved_prefix::{a, b, c}; //~ ERROR cannot find module or crate `unresolved_prefix`
|
||||
reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ LL | type Type;
|
|||
LL | impl Trait for S {
|
||||
| ^^^^^^^^^^^^^^^^ missing `Type` in implementation
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_prefix`
|
||||
error[E0433]: cannot find module or crate `unresolved_prefix` in this scope
|
||||
--> $DIR/bad-resolve.rs:43:7
|
||||
|
|
||||
LL | reuse unresolved_prefix::{a, b, c};
|
||||
|
|
@ -99,11 +99,11 @@ LL | reuse unresolved_prefix::{a, b, c};
|
|||
|
|
||||
= help: you might be missing a crate named `unresolved_prefix`
|
||||
|
||||
error[E0433]: failed to resolve: `crate` in paths can only be used in start position
|
||||
error[E0433]: `crate` in paths can only be used in start position
|
||||
--> $DIR/bad-resolve.rs:44:29
|
||||
|
|
||||
LL | reuse prefix::{self, super, crate};
|
||||
| ^^^^^ `crate` in paths can only be used in start position
|
||||
| ^^^^^ can only be used in path start position
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ trait Trait {}
|
|||
struct S;
|
||||
|
||||
impl Trait for u8 {
|
||||
reuse unresolved::*; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved`
|
||||
reuse unresolved::*; //~ ERROR cannot find module or crate `unresolved`
|
||||
reuse S::*; //~ ERROR expected trait, found struct `S`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ error: expected trait, found struct `S`
|
|||
LL | reuse S::*;
|
||||
| ^ not a trait
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved`
|
||||
error[E0433]: cannot find module or crate `unresolved` in this scope
|
||||
--> $DIR/glob-bad-path.rs:8:11
|
||||
|
|
||||
LL | reuse unresolved::*;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
mod unresolved {
|
||||
struct S;
|
||||
reuse impl unresolved for S { self.0 }
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved`
|
||||
//~^ ERROR cannot find module or crate `unresolved` in this scope
|
||||
//~| ERROR cannot find trait `unresolved` in this scope
|
||||
|
||||
trait T {}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ error: expected trait, found module `TraitModule`
|
|||
LL | reuse impl TraitModule for S { self.0 }
|
||||
| ^^^^^^^^^^^ not a trait
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved`
|
||||
error[E0433]: cannot find module or crate `unresolved` in this scope
|
||||
--> $DIR/impl-reuse-bad-path.rs:6:16
|
||||
|
|
||||
LL | reuse impl unresolved for S { self.0 }
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `HashMap`
|
||||
error[E0433]: cannot find type `HashMap` in this scope
|
||||
--> $DIR/issue-31997-1.rs:20:19
|
||||
|
|
||||
LL | let mut map = HashMap::new();
|
||||
|
|
|
|||
|
|
@ -2,12 +2,18 @@ mod a {}
|
|||
|
||||
macro_rules! m {
|
||||
() => {
|
||||
use a::$crate; //~ ERROR unresolved import `a::$crate`
|
||||
use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position
|
||||
type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position
|
||||
use a::$crate; //~ ERROR: unresolved import `a::$crate`
|
||||
//~^ NOTE: no `$crate` in `a`
|
||||
use a::$crate::b; //~ ERROR: `$crate` in paths can only be used in start position
|
||||
//~^ NOTE: can only be used in path start position
|
||||
type A = a::$crate; //~ ERROR: `$crate` in paths can only be used in start position
|
||||
//~^ NOTE: can only be used in path start position
|
||||
}
|
||||
}
|
||||
|
||||
m!();
|
||||
//~^ NOTE: in this expansion
|
||||
//~| NOTE: in this expansion
|
||||
//~| NOTE: in this expansion
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:6:16
|
||||
error[E0433]: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:7:16
|
||||
|
|
||||
LL | use a::$crate::b;
|
||||
| ^^^^^^ `$crate` in paths can only be used in start position
|
||||
| ^^^^^^ can only be used in path start position
|
||||
...
|
||||
LL | m!();
|
||||
| ---- in this macro invocation
|
||||
|
|
@ -20,11 +20,11 @@ LL | m!();
|
|||
|
|
||||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:7:21
|
||||
error[E0433]: `$crate` in paths can only be used in start position
|
||||
--> $DIR/dollar-crate-is-keyword-2.rs:9:21
|
||||
|
|
||||
LL | type A = a::$crate;
|
||||
| ^^^^^^ `$crate` in paths can only be used in start position
|
||||
| ^^^^^^ can only be used in path start position
|
||||
...
|
||||
LL | m!();
|
||||
| ---- in this macro invocation
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ fn eii1_impl(x: u64) {
|
|||
println!("{x:?}")
|
||||
}
|
||||
|
||||
#[codegen::eii3] //~ ERROR failed to resolve: could not find `eii3` in `codegen`
|
||||
#[codegen::eii3] //~ ERROR cannot find `eii3` in `codegen`
|
||||
fn eii3_impl(x: u64) {
|
||||
println!("{x:?}")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: could not find `eii3` in `codegen`
|
||||
error[E0433]: cannot find `eii3` in `codegen`
|
||||
--> $DIR/privacy2.rs:16:12
|
||||
|
|
||||
LL | #[codegen::eii3]
|
||||
|
|
|
|||
|
|
@ -12,5 +12,6 @@ impl E {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
E::A::f(); //~ ERROR failed to resolve: `A` is a variant, not a module
|
||||
E::A::f(); //~ ERROR cannot find module `A` in `E`
|
||||
//~^ NOTE: `A` is a variant, not a module
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: `A` is a variant, not a module
|
||||
error[E0433]: cannot find module `A` in `E`
|
||||
--> $DIR/assoc-fn-call-on-variant.rs:15:8
|
||||
|
|
||||
LL | E::A::f();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `NonExistingMap`
|
||||
error[E0433]: cannot find type `NonExistingMap` in this scope
|
||||
--> $DIR/E0433.rs:2:15
|
||||
|
|
||||
LL | let map = NonExistingMap::new();
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@ pub mod m {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
somedep::somefun(); //~ ERROR failed to resolve
|
||||
somedep::somefun(); //~ ERROR cannot find
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
|
||||
error[E0433]: cannot find module or crate `somedep` in this scope
|
||||
--> $DIR/multiple-opts.rs:19:5
|
||||
|
|
||||
LL | somedep::somefun();
|
||||
|
|
|
|||
|
|
@ -3,5 +3,5 @@
|
|||
//@ edition:2018
|
||||
|
||||
fn main() {
|
||||
somedep::somefun(); //~ ERROR failed to resolve
|
||||
somedep::somefun(); //~ ERROR cannot find
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep`
|
||||
error[E0433]: cannot find module or crate `somedep` in this scope
|
||||
--> $DIR/noprelude.rs:6:5
|
||||
|
|
||||
LL | somedep::somefun();
|
||||
|
|
|
|||
2
tests/ui/extern/extern-macro.rs
vendored
2
tests/ui/extern/extern-macro.rs
vendored
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
fn main() {
|
||||
enum Foo {}
|
||||
let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro
|
||||
let _ = Foo::bar!(); //~ ERROR cannot find macro `bar` in enum `Foo`
|
||||
}
|
||||
|
|
|
|||
4
tests/ui/extern/extern-macro.stderr
vendored
4
tests/ui/extern/extern-macro.stderr
vendored
|
|
@ -1,8 +1,8 @@
|
|||
error[E0433]: failed to resolve: partially resolved path in a macro
|
||||
error[E0433]: cannot find macro `bar` in enum `Foo`
|
||||
--> $DIR/extern-macro.rs:5:13
|
||||
|
|
||||
LL | let _ = Foo::bar!();
|
||||
| ^^^^^^^^ partially resolved path in a macro
|
||||
| ^^^^^^^^ a macro can't exist within an enum
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -2,5 +2,5 @@
|
|||
use core::default; //~ ERROR unresolved import `core`
|
||||
|
||||
fn main() {
|
||||
let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve
|
||||
let _: u8 = ::core::default::Default(); //~ ERROR cannot find
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | use core::default;
|
|||
| you might be missing crate `core`
|
||||
| help: try using `std` instead of `core`: `std`
|
||||
|
||||
error[E0433]: failed to resolve: you might be missing crate `core`
|
||||
error[E0433]: cannot find `core` in the crate root
|
||||
--> $DIR/feature-gate-extern_absolute_paths.rs:5:19
|
||||
|
|
||||
LL | let _: u8 = ::core::default::Default();
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
extern "C" fn _f() -> libc::uintptr_t {}
|
||||
//~^ ERROR failed to resolve
|
||||
//~^ ERROR cannot find
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `libc`
|
||||
error[E0433]: cannot find module or crate `libc` in this scope
|
||||
--> $DIR/stashed-issue-121451.rs:1:23
|
||||
|
|
||||
LL | extern "C" fn _f() -> libc::uintptr_t {}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ fn sum2<I: Iterator>(i: I) -> i32 where I::Item = i32 {
|
|||
}
|
||||
fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {
|
||||
//~^ ERROR equality constraints are not yet supported in `where` clauses
|
||||
//~| ERROR failed to resolve: use of undeclared type `I`
|
||||
//~| ERROR cannot find type `I`
|
||||
panic!()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ LL - fn from_iter<T>(_: T) -> Self where T::Item = A, T: IntoIterator,
|
|||
LL + fn from_iter<T>(_: T) -> Self where T::Item = K, T: IntoIterator,
|
||||
|
|
||||
|
||||
error[E0433]: failed to resolve: use of undeclared type `I`
|
||||
error[E0433]: cannot find type `I` in this scope
|
||||
--> $DIR/equality-bound.rs:9:41
|
||||
|
|
||||
LL | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ macro a() {
|
|||
mod u {
|
||||
// Late resolution.
|
||||
fn f() { my_core::mem::drop(0); }
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
//~^ ERROR cannot find
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ mod v {
|
|||
mod u {
|
||||
// Late resolution.
|
||||
fn f() { my_core::mem::drop(0); }
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
//~^ ERROR cannot find
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ LL | a!();
|
|||
|
|
||||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
error[E0433]: cannot find module or crate `my_core` in this scope
|
||||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18
|
||||
|
|
||||
LL | fn f() { my_core::mem::drop(0); }
|
||||
|
|
@ -29,7 +29,7 @@ LL | a!();
|
|||
std::mem
|
||||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
error[E0433]: cannot find module or crate `my_core` in this scope
|
||||
--> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14
|
||||
|
|
||||
LL | fn f() { my_core::mem::drop(0); }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ macro a() {
|
|||
mod u {
|
||||
// Late resolution.
|
||||
fn f() { my_core::mem::drop(0); }
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
//~^ ERROR cannot find
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ mod v {
|
|||
mod u {
|
||||
// Late resolution.
|
||||
fn f() { my_core::mem::drop(0); }
|
||||
//~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
//~^ ERROR cannot find
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ LL | a!();
|
|||
|
|
||||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
error[E0433]: cannot find module or crate `my_core` in this scope
|
||||
--> $DIR/extern-prelude-from-opaque-fail.rs:12:18
|
||||
|
|
||||
LL | fn f() { my_core::mem::drop(0); }
|
||||
|
|
@ -29,7 +29,7 @@ LL | a!();
|
|||
my_core::mem
|
||||
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core`
|
||||
error[E0433]: cannot find module or crate `my_core` in this scope
|
||||
--> $DIR/extern-prelude-from-opaque-fail.rs:25:14
|
||||
|
|
||||
LL | fn f() { my_core::mem::drop(0); }
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ mod foo {
|
|||
#[no_implicit_prelude]
|
||||
mod bar {
|
||||
pub macro m() {
|
||||
Vec::new(); //~ ERROR failed to resolve
|
||||
Vec::new(); //~ ERROR cannot find
|
||||
().clone() //~ ERROR no method named `clone` found
|
||||
}
|
||||
fn f() {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of undeclared type `Vec`
|
||||
error[E0433]: cannot find type `Vec` in this scope
|
||||
--> $DIR/no_implicit_prelude.rs:12:9
|
||||
|
|
||||
LL | fn f() { ::bar::m!(); }
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ pub fn gather_all() -> impl Iterator<Item = Lint> {
|
|||
}
|
||||
|
||||
fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
|
||||
//~^ ERROR: failed to resolve
|
||||
//~^ ERROR: cannot find
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
|
||||
//~^ ERROR: failed to resolve
|
||||
//~^ ERROR: cannot find
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
|
||||
error[E0433]: cannot find module or crate `foo` in this scope
|
||||
--> $DIR/issue-72911.rs:11:33
|
||||
|
|
||||
LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
|
||||
|
|
@ -6,7 +6,7 @@ LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = L
|
|||
|
|
||||
= help: you might be missing a crate named `foo`
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo`
|
||||
error[E0433]: cannot find module or crate `foo` in this scope
|
||||
--> $DIR/issue-72911.rs:16:41
|
||||
|
|
||||
LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ trait MyTrait {
|
|||
async fn foo(self) -> (Self, i32);
|
||||
}
|
||||
|
||||
impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `xyz`
|
||||
impl MyTrait for xyz::T { //~ ERROR cannot find module or crate `xyz`
|
||||
async fn foo(self, key: i32) -> (u32, i32) {
|
||||
(self, key)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `xyz`
|
||||
error[E0433]: cannot find module or crate `xyz` in this scope
|
||||
--> $DIR/stashed-diag-issue-121504.rs:7:18
|
||||
|
|
||||
LL | impl MyTrait for xyz::T {
|
||||
|
|
|
|||
|
|
@ -3,9 +3,12 @@
|
|||
mod foo {}
|
||||
|
||||
use foo::{
|
||||
::bar, //~ ERROR crate root in paths can only be used in start position
|
||||
super::bar, //~ ERROR `super` in paths can only be used in start position
|
||||
self::bar, //~ ERROR `self` in paths can only be used in start position
|
||||
::bar,
|
||||
//~^ ERROR: crate root in paths can only be used in start position
|
||||
super::bar,
|
||||
//~^ ERROR: `super` in paths can only be used in start position
|
||||
self::bar,
|
||||
//~^ ERROR: `self` in paths can only be used in start position
|
||||
};
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,20 @@
|
|||
error[E0433]: failed to resolve: crate root in paths can only be used in start position
|
||||
error[E0433]: the crate root in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:6:5
|
||||
|
|
||||
LL | ::bar,
|
||||
| ^ crate root in paths can only be used in start position
|
||||
| ^ can only be used in path start position
|
||||
|
||||
error[E0433]: failed to resolve: `super` in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:7:5
|
||||
|
|
||||
LL | super::bar,
|
||||
| ^^^^^ `super` in paths can only be used in start position
|
||||
|
||||
error[E0433]: failed to resolve: `self` in paths can only be used in start position
|
||||
error[E0433]: `super` in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:8:5
|
||||
|
|
||||
LL | super::bar,
|
||||
| ^^^^^ can only be used in path start position
|
||||
|
||||
error[E0433]: `self` in paths can only be used in start position
|
||||
--> $DIR/absolute-paths-in-nested-use-groups.rs:10:5
|
||||
|
|
||||
LL | self::bar,
|
||||
| ^^^^ `self` in paths can only be used in start position
|
||||
| ^^^^ can only be used in path start position
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ mod n {
|
|||
|
||||
mod m {
|
||||
fn check() {
|
||||
two_macros::m!(); //~ ERROR failed to resolve: use of unresolved module or unlinked crate `two_macros`
|
||||
two_macros::m!(); //~ ERROR cannot find
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ LL | define_std_as_non_existent!();
|
|||
|
|
||||
= note: this error originates in the macro `define_std_as_non_existent` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `two_macros`
|
||||
error[E0433]: cannot find module or crate `two_macros` in this scope
|
||||
--> $DIR/extern-prelude-extern-crate-fail.rs:10:9
|
||||
|
|
||||
LL | two_macros::m!();
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
// caused by `{{root}}` appearing in diagnostic suggestions
|
||||
|
||||
mod A {
|
||||
use Iuse::{ ::Fish }; //~ ERROR failed to resolve: use of unresolved module or unlinked crate
|
||||
use Iuse::{ ::Fish }; //~ ERROR cannot find module or crate `Iuse` in the crate root
|
||||
}
|
||||
|
||||
mod B {
|
||||
use A::{::Fish}; //~ ERROR failed to resolve: crate root in paths can only be used in start position
|
||||
use A::{::Fish}; //~ ERROR the crate root in paths can only be used in start position
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Iuse`
|
||||
error[E0433]: cannot find module or crate `Iuse` in the crate root
|
||||
--> $DIR/nested-import-root-symbol-150103.rs:6:9
|
||||
|
|
||||
LL | use Iuse::{ ::Fish };
|
||||
|
|
@ -9,11 +9,11 @@ help: you might be missing a crate named `Iuse`, add it to your project and impo
|
|||
LL + extern crate Iuse;
|
||||
|
|
||||
|
||||
error[E0433]: failed to resolve: crate root in paths can only be used in start position
|
||||
error[E0433]: the crate root in paths can only be used in start position
|
||||
--> $DIR/nested-import-root-symbol-150103.rs:10:13
|
||||
|
|
||||
LL | use A::{::Fish};
|
||||
| ^ crate root in paths can only be used in start position
|
||||
| ^ can only be used in path start position
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: unresolved import
|
||||
error[E0433]: cannot find `bar` in `crate`
|
||||
--> $DIR/suggest-import-issue-120074.rs:14:35
|
||||
|
|
||||
LL | println!("Hello, {}!", crate::bar::do_the_thing);
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
error[E0433]: failed to resolve: unresolved import
|
||||
--> $DIR/suggest-import-issue-120074.rs:14:35
|
||||
|
|
||||
LL | println!("Hello, {}!", crate::bar::do_the_thing);
|
||||
| ^^^ unresolved import
|
||||
|
|
||||
help: a similar path exists
|
||||
|
|
||||
LL | println!("Hello, {}!", crate::foo::bar::do_the_thing);
|
||||
| +++++
|
||||
help: consider importing this module
|
||||
|
|
||||
LL + use foo::bar;
|
||||
|
|
||||
help: if you import `bar`, refer to it directly
|
||||
|
|
||||
LL - println!("Hello, {}!", crate::bar::do_the_thing);
|
||||
LL + println!("Hello, {}!", bar::do_the_thing);
|
||||
|
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0433`.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: unresolved import
|
||||
error[E0433]: cannot find `bar` in `crate`
|
||||
--> $DIR/suggest-import-issue-120074.rs:14:35
|
||||
|
|
||||
LL | println!("Hello, {}!", crate::bar::do_the_thing);
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ pub mod foo {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR failed to resolve: unresolved import
|
||||
println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR cannot find `bar` in `crate`
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
//@ edition:2015
|
||||
use clippy::a; //~ ERROR unresolved import `clippy`
|
||||
use clippy::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `clippy`
|
||||
use clippy::a::b; //~ ERROR cannot find
|
||||
|
||||
use rustdoc::a; //~ ERROR unresolved import `rustdoc`
|
||||
use rustdoc::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `rustdoc`
|
||||
use rustdoc::a::b; //~ ERROR cannot find
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `clippy`
|
||||
error[E0433]: cannot find module or crate `clippy` in the crate root
|
||||
--> $DIR/tool-mod-child.rs:3:5
|
||||
|
|
||||
LL | use clippy::a::b;
|
||||
|
|
@ -20,7 +20,7 @@ help: you might be missing a crate named `clippy`, add it to your project and im
|
|||
LL + extern crate clippy;
|
||||
|
|
||||
|
||||
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustdoc`
|
||||
error[E0433]: cannot find module or crate `rustdoc` in the crate root
|
||||
--> $DIR/tool-mod-child.rs:6:5
|
||||
|
|
||||
LL | use rustdoc::a::b;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue