Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Rust timing bot
d060fad6ee
Unrolled build for #145399
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
2026-02-18 18:17:37 +01:00
Esteban Küber
257a415e05 Make suggestion verbose and fix incorrect suggestion usage 2026-02-17 16:51:53 +00:00
Esteban Küber
c73b3d20c6 Unify wording of resolve error
Remove "failed to resolve" 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`
```
2026-02-17 16:51:44 +00:00
249 changed files with 820 additions and 698 deletions

View file

@ -469,9 +469,15 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> {
PathResult::NonModule(partial_res) => { PathResult::NonModule(partial_res) => {
expected_found_error(partial_res.expect_full_res()) expected_found_error(partial_res.expect_full_res())
} }
PathResult::Failed { span, label, suggestion, .. } => { PathResult::Failed {
Err(VisResolutionError::FailedToResolve(span, label, suggestion)) span, label, suggestion, message, segment_name, ..
} } => Err(VisResolutionError::FailedToResolve(
span,
segment_name,
label,
suggestion,
message,
)),
PathResult::Indeterminate => Err(VisResolutionError::Indeterminate(path.span)), PathResult::Indeterminate => Err(VisResolutionError::Indeterminate(path.span)),
} }
} }

View file

@ -32,7 +32,7 @@ use rustc_span::edit_distance::find_best_match_for_name;
use rustc_span::edition::Edition; use rustc_span::edition::Edition;
use rustc_span::hygiene::MacroKind; use rustc_span::hygiene::MacroKind;
use rustc_span::source_map::{SourceMap, Spanned}; 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 thin_vec::{ThinVec, thin_vec};
use tracing::{debug, instrument}; use tracing::{debug, instrument};
@ -899,9 +899,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => { ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => {
self.dcx().create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span }) self.dcx().create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span })
} }
ResolutionError::FailedToResolve { segment, label, suggestion, module } => { ResolutionError::FailedToResolve { segment, label, suggestion, module, message } => {
let mut err = let mut err = struct_span_code_err!(self.dcx(), span, E0433, "{message}");
struct_span_code_err!(self.dcx(), span, E0433, "failed to resolve: {label}");
err.span_label(span, label); err.span_label(span, label);
if let Some((suggestions, msg, applicability)) = suggestion { if let Some((suggestions, msg, applicability)) = suggestion {
@ -909,16 +908,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
err.help(msg); err.help(msg);
return err; return err;
} }
err.multipart_suggestion(msg, suggestions, applicability); err.multipart_suggestion_verbose(msg, suggestions, applicability);
} }
if let Some(segment) = segment {
let module = match module { let module = match module {
Some(ModuleOrUniformRoot::Module(m)) if let Some(id) = m.opt_def_id() => id, Some(ModuleOrUniformRoot::Module(m)) if let Some(id) = m.opt_def_id() => id,
_ => CRATE_DEF_ID.to_def_id(), _ => CRATE_DEF_ID.to_def_id(),
}; };
self.find_cfg_stripped(&mut err, &segment, module); self.find_cfg_stripped(&mut err, &segment, module);
}
err err
} }
@ -1108,9 +1105,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
VisResolutionError::AncestorOnly(span) => { VisResolutionError::AncestorOnly(span) => {
self.dcx().create_err(errs::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, span,
ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None }, ResolutionError::FailedToResolve {
segment,
label,
suggestion,
module: None,
message,
},
), ),
VisResolutionError::ExpectedFound(span, path_str, res) => { VisResolutionError::ExpectedFound(span, path_str, res) => {
self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str }) self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str })
@ -2438,13 +2442,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
failed_segment_idx: usize, failed_segment_idx: usize,
ident: Ident, ident: Ident,
diag_metadata: Option<&DiagMetadata<'_>>, diag_metadata: Option<&DiagMetadata<'_>>,
) -> (String, Option<Suggestion>) { ) -> (String, String, Option<Suggestion>) {
let is_last = failed_segment_idx == path.len() - 1; let is_last = failed_segment_idx == path.len() - 1;
let ns = if is_last { opt_ns.unwrap_or(TypeNS) } else { TypeNS }; let ns = if is_last { opt_ns.unwrap_or(TypeNS) } else { TypeNS };
let module_res = match module { let module_res = match module {
Some(ModuleOrUniformRoot::Module(module)) => module.res(), Some(ModuleOrUniformRoot::Module(module)) => module.res(),
_ => None, _ => 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() { if module_res == self.graph_root.res() {
let is_mod = |res| matches!(res, Res::Def(DefKind::Mod, _)); let is_mod = |res| matches!(res, Res::Def(DefKind::Mod, _));
let mut candidates = self.lookup_import_candidates(ident, TypeNS, parent_scope, is_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 } Path { segments, span: Span::default(), tokens: None }
}; };
( (
message,
String::from("unresolved import"), String::from("unresolved import"),
Some(( Some((
vec![(ident.span, pprust::path_to_string(&path))], vec![(ident.span, pprust::path_to_string(&path))],
@ -2471,6 +2488,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
) )
} else if ident.name == sym::core { } else if ident.name == sym::core {
( (
message,
format!("you might be missing crate `{ident}`"), format!("you might be missing crate `{ident}`"),
Some(( Some((
vec![(ident.span, "std".to_string())], vec![(ident.span, "std".to_string())],
@ -2479,9 +2497,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
)), )),
) )
} else if ident.name == kw::Underscore { } 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() { } 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}`"), format!("use of unresolved module or unlinked crate `{ident}`"),
Some(( Some((
vec![( vec![(
@ -2490,8 +2513,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
)], )],
if was_invoked_from_cargo() { if was_invoked_from_cargo() {
format!( format!(
"if you wanted to use a crate named `{ident}`, use `cargo add {ident}` \ "if you wanted to use a crate named `{ident}`, use `cargo add \
to add it to your `Cargo.toml` and import it in your code", {ident}` to add it to your `Cargo.toml` and import it in your \
code",
) )
} else { } else {
format!( format!(
@ -2503,7 +2527,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
)), )),
) )
} else { } 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 { } else if failed_segment_idx > 0 {
let parent = path[failed_segment_idx - 1].ident.name; 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 { } else if ident.name == kw::SelfUpper {
// As mentioned above, `opt_ns` being `None` indicates a module path in import. // 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 // We can use this to improve a confusing error for, e.g. `use Self::Variant` in an
// impl // impl
if opt_ns.is_none() { 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 { } else {
( (
message,
"`Self` is only available in impls, traits, and type definitions".to_string(), "`Self` is only available in impls, traits, and type definitions".to_string(),
None, None,
) )
@ -2608,12 +2633,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
// } // }
// ``` // ```
Some(LateDecl::RibDef(Res::Local(id))) => { 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 // Name matches item from a local name binding
// created by `use` declaration. For example: // created by `use` declaration. For example:
// ``` // ```
// pub Foo: &str = ""; // pub const Foo: &str = "";
// //
// mod submod { // mod submod {
// use super::Foo; // use super::Foo;
@ -2621,18 +2646,27 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
// // binding `Foo`. // // 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, _ => 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 { } else {
let mut suggestion = None; let mut suggestion = None;
if ident.name == sym::alloc { if ident.name == sym::alloc {
@ -2663,7 +2697,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
ignore_import, ignore_import,
) { ) {
let descr = binding.res().descr(); 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 { } else {
let suggestion = if suggestion.is_some() { let suggestion = if suggestion.is_some() {
suggestion suggestion
@ -2685,7 +2720,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
Applicability::MaybeIncorrect, 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,
)
} }
} }
} }

View file

@ -1775,7 +1775,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
finalize.is_some(), finalize.is_some(),
module_had_parse_errors, module_had_parse_errors,
module, 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 { if segment_idx == 0 {
@ -1823,16 +1829,24 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
module, module,
|| { || {
let name_str = if name == kw::PathRoot { let name_str = if name == kw::PathRoot {
"crate root".to_string() "the crate root".to_string()
} else { } else {
format!("`{name}`") format!("`{name}`")
}; };
let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot { let (message, label) = if segment_idx == 1
format!("global paths cannot start with {name_str}") && path[0].ident.name == kw::PathRoot
{
(
format!("global paths cannot start with {name_str}"),
"cannot start with this".to_string(),
)
} else { } 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.article(),
res.descr() 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)
}, },
); );
} }

View file

@ -1042,16 +1042,18 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
suggestion, suggestion,
module, module,
error_implied_by_parse_error: _, error_implied_by_parse_error: _,
message,
} => { } => {
if no_ambiguity { if no_ambiguity {
assert!(import.imported_module.get().is_none()); assert!(import.imported_module.get().is_none());
self.report_error( self.report_error(
span, span,
ResolutionError::FailedToResolve { ResolutionError::FailedToResolve {
segment: Some(segment_name), segment: segment_name,
label, label,
suggestion, suggestion,
module, module,
message,
}, },
); );
} }

View file

@ -4890,14 +4890,16 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
module, module,
segment_name, segment_name,
error_implied_by_parse_error: _, error_implied_by_parse_error: _,
message,
} => { } => {
return Err(respan( return Err(respan(
span, span,
ResolutionError::FailedToResolve { ResolutionError::FailedToResolve {
segment: Some(segment_name), segment: segment_name,
label, label,
suggestion, suggestion,
module, module,
message,
}, },
)); ));
} }

View file

@ -280,10 +280,11 @@ enum ResolutionError<'ra> {
SelfImportOnlyInImportListWithNonEmptyPrefix, SelfImportOnlyInImportListWithNonEmptyPrefix,
/// Error E0433: failed to resolve. /// Error E0433: failed to resolve.
FailedToResolve { FailedToResolve {
segment: Option<Symbol>, segment: Symbol,
label: String, label: String,
suggestion: Option<Suggestion>, suggestion: Option<Suggestion>,
module: Option<ModuleOrUniformRoot<'ra>>, module: Option<ModuleOrUniformRoot<'ra>>,
message: String,
}, },
/// Error E0434: can't capture dynamic environment in a fn item. /// Error E0434: can't capture dynamic environment in a fn item.
CannotCaptureDynamicEnvironmentInFnItem, CannotCaptureDynamicEnvironmentInFnItem,
@ -342,7 +343,7 @@ enum ResolutionError<'ra> {
enum VisResolutionError<'a> { enum VisResolutionError<'a> {
Relative2018(Span, &'a ast::Path), Relative2018(Span, &'a ast::Path),
AncestorOnly(Span), AncestorOnly(Span),
FailedToResolve(Span, String, Option<Suggestion>), FailedToResolve(Span, Symbol, String, Option<Suggestion>, String),
ExpectedFound(Span, String, Res), ExpectedFound(Span, String, Res),
Indeterminate(Span), Indeterminate(Span),
ModuleOnly(Span), ModuleOnly(Span),
@ -486,6 +487,7 @@ enum PathResult<'ra> {
/// The segment name of target /// The segment name of target
segment_name: Symbol, segment_name: Symbol,
error_implied_by_parse_error: bool, error_implied_by_parse_error: bool,
message: String,
}, },
} }
@ -496,10 +498,14 @@ impl<'ra> PathResult<'ra> {
finalize: bool, finalize: bool,
error_implied_by_parse_error: bool, error_implied_by_parse_error: bool,
module: Option<ModuleOrUniformRoot<'ra>>, module: Option<ModuleOrUniformRoot<'ra>>,
label_and_suggestion: impl FnOnce() -> (String, Option<Suggestion>), label_and_suggestion: impl FnOnce() -> (String, String, Option<Suggestion>),
) -> PathResult<'ra> { ) -> PathResult<'ra> {
let (label, suggestion) = let (message, label, suggestion) = if finalize {
if finalize { label_and_suggestion() } else { (String::new(), None) }; 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 { PathResult::Failed {
span: ident.span, span: ident.span,
segment_name: ident.name, segment_name: ident.name,
@ -508,6 +514,7 @@ impl<'ra> PathResult<'ra> {
is_error_from_last_segment, is_error_from_last_segment,
module, module,
error_implied_by_parse_error, error_implied_by_parse_error,
message,
} }
} }
} }

View file

@ -908,10 +908,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
), ),
path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => { path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => {
let mut suggestion = None; let mut suggestion = None;
let (span, label, module, segment) = let (span, message, label, module, segment) = match path_res {
if let PathResult::Failed { span, label, module, segment_name, .. } = PathResult::Failed {
path_res span, label, module, segment_name, message, ..
{ } => {
// try to suggest if it's not a macro, maybe a function // try to suggest if it's not a macro, maybe a function
if let PathResult::NonModule(partial_res) = self if let PathResult::NonModule(partial_res) = self
.cm() .cm()
@ -930,26 +930,52 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
Applicability::MaybeIncorrect, Applicability::MaybeIncorrect,
)); ));
} }
(span, label, module, segment_name) (span, message, label, module, segment_name)
} else { }
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, path_span,
format!( format!(
"partially resolved path in {} {}", "cannot find {expected_descr} `{expected_name}` in {scope}"
kind.article(),
kind.descr()
), ),
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, None,
path.last().map(|segment| segment.ident.name).unwrap(), path.last().map(|segment| segment.ident.name).unwrap(),
) )
}
_ => unreachable!(),
}; };
self.report_error( self.report_error(
span, span,
ResolutionError::FailedToResolve { ResolutionError::FailedToResolve {
segment: Some(segment), segment,
label, label,
suggestion, suggestion,
module, module,
message,
}, },
); );
} }

View file

@ -2,7 +2,7 @@ struct Foo(isize, isize, isize, isize);
pub fn main() { pub fn main() {
let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); 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] { match [5, 5, 5, 5] {
[..] => {}, [..] => {},
} }

View file

@ -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 --> tests/ui/crashes/unreachable-array-or-slice.rs:4:9
| |
LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5);

View file

@ -4,7 +4,7 @@ struct Struct<T>(T);
impl<T> std::ops::Deref for Struct<T> { impl<T> std::ops::Deref for Struct<T> {
type Target = dyn Fn(T); type Target = dyn Fn(T);
fn deref(&self) -> &assert_mem_uninitialized_valid::Target { 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!() unimplemented!()
} }
} }

View file

@ -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 --> tests/fail/rustc-error2.rs:LL:CC
| |
LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target { LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target {

View file

@ -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 --> foo.rs:3:12
| |
3 | x.push(Complete::Item { name: "hello" }); 3 | x.push(Complete::Item { name: "hello" });

View file

@ -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 --> foo.rs:3:12
| |
3 | x.push(Complete::Item { name: "hello" }); 3 | x.push(Complete::Item { name: "hello" });

View file

@ -1,6 +1,6 @@
// Regression test for issue #95879. // Regression test for issue #95879.
use unresolved_crate::module::Name; //~ ERROR failed to resolve use unresolved_crate::module::Name; //~ ERROR cannot find
/// [Name] /// [Name]
pub struct S; pub struct S;

View file

@ -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 --> $DIR/unresolved-import-recovery.rs:3:5
| |
LL | use unresolved_crate::module::Name; LL | use unresolved_crate::module::Name;

View file

@ -1,4 +1,4 @@
// This previously triggered an ICE. // This previously triggered an ICE.
pub(in crate::r#mod) fn main() {} 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`

View file

@ -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 --> $DIR/issue-61732.rs:3:15
| |
LL | pub(in crate::r#mod) fn main() {} LL | pub(in crate::r#mod) fn main() {}

View file

@ -137,7 +137,7 @@ struct MessageWrongType {
struct InvalidPathFieldAttr { struct InvalidPathFieldAttr {
#[nonsense] #[nonsense]
//~^ ERROR `#[nonsense]` is not a valid attribute //~^ 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, foo: String,
} }

View file

@ -90,6 +90,14 @@ struct G {
var: String, var: String,
} }
#[derive(Subdiagnostic)]
#[label("...")]
struct H {
#[primary_span]
span: Span,
var: String,
}
#[derive(Subdiagnostic)] #[derive(Subdiagnostic)]
#[label(slug = 4)] #[label(slug = 4)]
//~^ ERROR no nested attribute expected here //~^ ERROR no nested attribute expected here

View file

@ -35,109 +35,109 @@ LL | #[label(bug = "...")]
| ^ | ^
error: derive(Diagnostic): no nested attribute expected here 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)] LL | #[label(slug = 4)]
| ^^^^ | ^^^^
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute 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)] LL | #[label(slug = 4)]
| ^ | ^
error: derive(Diagnostic): no nested attribute expected here 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("..."))] LL | #[label(slug("..."))]
| ^^^^ | ^^^^
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute 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("..."))] LL | #[label(slug("..."))]
| ^ | ^
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute 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()] LL | #[label()]
| ^ | ^
error: derive(Diagnostic): no nested attribute expected here 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 = "...")] LL | #[label("example message", code = "...")]
| ^^^^ | ^^^^
error: derive(Diagnostic): no nested attribute expected here 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")] LL | #[label("example message", applicability = "machine-applicable")]
| ^^^^^^^^^^^^^ | ^^^^^^^^^^^^^
error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum 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] LL | #[foo]
| ^ | ^
error: derive(Diagnostic): `#[bar]` is not a valid attribute 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] LL | #[bar]
| ^ | ^
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute 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 = "..."] LL | #[bar = "..."]
| ^ | ^
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute 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] LL | #[bar = 4]
| ^ | ^
error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute 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("...")] LL | #[bar("...")]
| ^ | ^
error: derive(Diagnostic): no nested attribute expected here 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 = "...")] LL | #[label(code = "...")]
| ^^^^ | ^^^^
error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute 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 = "...")] LL | #[label(code = "...")]
| ^ | ^
error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` 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] LL | #[primary_span]
| ^ | ^
error: derive(Diagnostic): label without `#[primary_span]` field 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")] LL | #[label("example message")]
| ^ | ^
error: derive(Diagnostic): `#[applicability]` is only valid on suggestions 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] LL | #[applicability]
| ^ | ^
error: derive(Diagnostic): `#[bar]` is not a valid attribute 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] LL | #[bar]
| ^ | ^
@ -145,13 +145,13 @@ LL | #[bar]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute 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 = "..."] LL | #[bar = "..."]
| ^ | ^
error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute 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("...")] LL | #[bar("...")]
| ^ | ^
@ -159,7 +159,7 @@ LL | #[bar("...")]
= help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes
error: unexpected unsupported untagged union error: unexpected unsupported untagged union
--> $DIR/subdiagnostic-derive-inline.rs:290:1 --> $DIR/subdiagnostic-derive-inline.rs:298:1
| |
LL | / union AC { LL | / union AC {
LL | | LL | |
@ -169,97 +169,97 @@ LL | | }
| |_^ | |_^
error: expected this path to be an identifier 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)] LL | #[label("example message", no_crate::example)]
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: derive(Diagnostic): attribute specified multiple times error: derive(Diagnostic): attribute specified multiple times
--> $DIR/subdiagnostic-derive-inline.rs:318:5 --> $DIR/subdiagnostic-derive-inline.rs:326:5
| |
LL | #[primary_span] LL | #[primary_span]
| ^ | ^
| |
note: previously specified here note: previously specified here
--> $DIR/subdiagnostic-derive-inline.rs:315:5 --> $DIR/subdiagnostic-derive-inline.rs:323:5
| |
LL | #[primary_span] LL | #[primary_span]
| ^ | ^
error: derive(Diagnostic): subdiagnostic kind not specified error: derive(Diagnostic): subdiagnostic kind not specified
--> $DIR/subdiagnostic-derive-inline.rs:324:8 --> $DIR/subdiagnostic-derive-inline.rs:332:8
| |
LL | struct AG { LL | struct AG {
| ^^ | ^^
error: derive(Diagnostic): attribute specified multiple times 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 = "...")] LL | #[suggestion("example message", code = "...", code = "...")]
| ^^^^ | ^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/subdiagnostic-derive-inline.rs:361:33 --> $DIR/subdiagnostic-derive-inline.rs:369:33
| |
LL | #[suggestion("example message", code = "...", code = "...")] LL | #[suggestion("example message", code = "...", code = "...")]
| ^^^^ | ^^^^
error: derive(Diagnostic): attribute specified multiple times error: derive(Diagnostic): attribute specified multiple times
--> $DIR/subdiagnostic-derive-inline.rs:379:5 --> $DIR/subdiagnostic-derive-inline.rs:387:5
| |
LL | #[applicability] LL | #[applicability]
| ^ | ^
| |
note: previously specified here note: previously specified here
--> $DIR/subdiagnostic-derive-inline.rs:376:5 --> $DIR/subdiagnostic-derive-inline.rs:384:5
| |
LL | #[applicability] LL | #[applicability]
| ^ | ^
error: derive(Diagnostic): the `#[applicability]` attribute can only be applied to fields of type `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] LL | #[applicability]
| ^ | ^
error: derive(Diagnostic): suggestion without `code = "..."` error: derive(Diagnostic): suggestion without `code = "..."`
--> $DIR/subdiagnostic-derive-inline.rs:402:1 --> $DIR/subdiagnostic-derive-inline.rs:410:1
| |
LL | #[suggestion("example message")] LL | #[suggestion("example message")]
| ^ | ^
error: derive(Diagnostic): invalid applicability 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")] LL | #[suggestion("example message", code = "...", applicability = "foo")]
| ^^^^^ | ^^^^^
error: derive(Diagnostic): suggestion without `#[primary_span]` field 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 = "...")] LL | #[suggestion("example message", code = "...")]
| ^ | ^
error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum 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] LL | #[label]
| ^ | ^
error: derive(Diagnostic): `var` doesn't refer to a field on this type 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")] LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")]
| ^^^^^^^ | ^^^^^^^
error: derive(Diagnostic): `var` doesn't refer to a field on this type 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")] LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")]
| ^^^^^^^ | ^^^^^^^
error: derive(Diagnostic): `#[suggestion_part]` is not a valid attribute 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] LL | #[suggestion_part]
| ^ | ^
@ -267,7 +267,7 @@ LL | #[suggestion_part]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead
error: derive(Diagnostic): `#[suggestion_part(...)]` is not a valid attribute 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 = "...")] LL | #[suggestion_part(code = "...")]
| ^ | ^
@ -275,13 +275,13 @@ LL | #[suggestion_part(code = "...")]
= help: `#[suggestion_part(...)]` is only valid in multipart suggestions = help: `#[suggestion_part(...)]` is only valid in multipart suggestions
error: derive(Diagnostic): suggestion without `#[primary_span]` field 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 = "...")] LL | #[suggestion("example message", code = "...")]
| ^ | ^
error: derive(Diagnostic): invalid nested attribute 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")] 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 = help: only `style` and `applicability` are valid nested attributes
error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields 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")] LL | #[multipart_suggestion("example message", code = "...", applicability = "machine-applicable")]
| ^ | ^
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` 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] LL | #[suggestion_part]
| ^ | ^
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` 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()] LL | #[suggestion_part()]
| ^ | ^
error: derive(Diagnostic): `#[primary_span]` is not a valid attribute 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] 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]` = 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 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")] LL | #[multipart_suggestion("example message")]
| ^ | ^
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` 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] LL | #[suggestion_part]
| ^ | ^
error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` 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()] LL | #[suggestion_part()]
| ^ | ^
error: derive(Diagnostic): `code` is the only valid nested attribute 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")] LL | #[suggestion_part(foo = "bar")]
| ^^^ | ^^^
error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` 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 = "...")] LL | #[suggestion_part(code = "...")]
| ^ | ^
error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` 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()] LL | #[suggestion_part()]
| ^ | ^
error: expected `,` error: expected `,`
--> $DIR/subdiagnostic-derive-inline.rs:559:27 --> $DIR/subdiagnostic-derive-inline.rs:567:27
| |
LL | #[suggestion_part(foo = "bar")] LL | #[suggestion_part(foo = "bar")]
| ^ | ^
error: derive(Diagnostic): attribute specified multiple times 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 = ",,,")] LL | #[suggestion_part(code = "...", code = ",,,")]
| ^^^^ | ^^^^
| |
note: previously specified here note: previously specified here
--> $DIR/subdiagnostic-derive-inline.rs:574:23 --> $DIR/subdiagnostic-derive-inline.rs:582:23
| |
LL | #[suggestion_part(code = "...", code = ",,,")] LL | #[suggestion_part(code = "...", code = ",,,")]
| ^^^^ | ^^^^
error: derive(Diagnostic): `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."` 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] LL | #[applicability]
| ^ | ^
error: derive(Diagnostic): expected exactly one string literal for `code = ...` 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"))] LL | #[suggestion_part(code("foo"))]
| ^^^^^ | ^^^^^
error: unexpected token, expected `)` error: unexpected token, expected `)`
--> $DIR/subdiagnostic-derive-inline.rs:651:28 --> $DIR/subdiagnostic-derive-inline.rs:659:28
| |
LL | #[suggestion_part(code("foo"))] LL | #[suggestion_part(code("foo"))]
| ^^^^^ | ^^^^^
error: derive(Diagnostic): expected exactly one string literal for `code = ...` 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"))] LL | #[suggestion_part(code("foo", "bar"))]
| ^^^^^ | ^^^^^
error: unexpected token, expected `)` error: unexpected token, expected `)`
--> $DIR/subdiagnostic-derive-inline.rs:661:28 --> $DIR/subdiagnostic-derive-inline.rs:669:28
| |
LL | #[suggestion_part(code("foo", "bar"))] LL | #[suggestion_part(code("foo", "bar"))]
| ^^^^^ | ^^^^^
error: derive(Diagnostic): expected exactly one string literal for `code = ...` 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))] LL | #[suggestion_part(code(3))]
| ^ | ^
error: unexpected token, expected `)` error: unexpected token, expected `)`
--> $DIR/subdiagnostic-derive-inline.rs:671:28 --> $DIR/subdiagnostic-derive-inline.rs:679:28
| |
LL | #[suggestion_part(code(3))] LL | #[suggestion_part(code(3))]
| ^ | ^
error: derive(Diagnostic): expected exactly one string literal for `code = ...` 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())] LL | #[suggestion_part(code())]
| ^ | ^
error: expected string literal error: expected string literal
--> $DIR/subdiagnostic-derive-inline.rs:690:30 --> $DIR/subdiagnostic-derive-inline.rs:698:30
| |
LL | #[suggestion_part(code = 3)] LL | #[suggestion_part(code = 3)]
| ^ | ^
error: derive(Diagnostic): attribute specified multiple times 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")] LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")]
| ^ | ^
| |
note: previously specified here 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")] LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")]
| ^ | ^
error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute 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 = "")] LL | #[suggestion_hidden("example message", code = "")]
| ^ | ^
@ -443,7 +443,7 @@ LL | #[suggestion_hidden("example message", code = "")]
= help: Use `#[suggestion(..., style = "hidden")]` instead = help: Use `#[suggestion(..., style = "hidden")]` instead
error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute 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")] 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 = help: Use `#[suggestion(..., style = "hidden")]` instead
error: derive(Diagnostic): invalid suggestion style 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")] 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` = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`
error: expected string literal 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)] LL | #[suggestion("example message", code = "", style = 42)]
| ^^ | ^^
error: expected `=` error: expected `=`
--> $DIR/subdiagnostic-derive-inline.rs:773:49 --> $DIR/subdiagnostic-derive-inline.rs:781:49
| |
LL | #[suggestion("example message", code = "", style)] LL | #[suggestion("example message", code = "", style)]
| ^ | ^
error: expected `=` error: expected `=`
--> $DIR/subdiagnostic-derive-inline.rs:781:49 --> $DIR/subdiagnostic-derive-inline.rs:789:49
| |
LL | #[suggestion("example message", code = "", style("foo"))] LL | #[suggestion("example message", code = "", style("foo"))]
| ^ | ^
error: derive(Diagnostic): `#[primary_span]` is not a valid attribute 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] LL | #[primary_span]
| ^ | ^
@ -486,7 +486,7 @@ LL | #[primary_span]
= help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead
error: derive(Diagnostic): suggestion without `#[primary_span]` field 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 = "")] LL | #[suggestion("example message", code = "")]
| ^ | ^
@ -498,49 +498,49 @@ LL | #[foo]
| ^^^ | ^^^
error: cannot find attribute `foo` in this scope error: cannot find attribute `foo` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:141:3 --> $DIR/subdiagnostic-derive-inline.rs:149:3
| |
LL | #[foo] LL | #[foo]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:155:7 --> $DIR/subdiagnostic-derive-inline.rs:163:7
| |
LL | #[bar] LL | #[bar]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:167:7 --> $DIR/subdiagnostic-derive-inline.rs:175:7
| |
LL | #[bar = "..."] LL | #[bar = "..."]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope 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] LL | #[bar = 4]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:191:7 --> $DIR/subdiagnostic-derive-inline.rs:199:7
| |
LL | #[bar("...")] LL | #[bar("...")]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:252:7 --> $DIR/subdiagnostic-derive-inline.rs:260:7
| |
LL | #[bar] LL | #[bar]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:263:7 --> $DIR/subdiagnostic-derive-inline.rs:271:7
| |
LL | #[bar = "..."] LL | #[bar = "..."]
| ^^^ | ^^^
error: cannot find attribute `bar` in this scope error: cannot find attribute `bar` in this scope
--> $DIR/subdiagnostic-derive-inline.rs:274:7 --> $DIR/subdiagnostic-derive-inline.rs:282:7
| |
LL | #[bar("...")] LL | #[bar("...")]
| ^^^ | ^^^

View file

@ -56,7 +56,7 @@ fn main() {
// Check that the path of an attribute without a name is printed correctly (issue #140082) // Check that the path of an attribute without a name is printed correctly (issue #140082)
#[::a] #[::a]
//~^ ERROR attribute incompatible with `#[unsafe(naked)]` //~^ 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)] #[unsafe(naked)]
extern "C" fn issue_140082() { extern "C" fn issue_140082() {
naked_asm!("") naked_asm!("")

View file

@ -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 --> $DIR/naked-invalid-attr.rs:57:5
| |
LL | #[::a] LL | #[::a]

View file

@ -1,8 +1,8 @@
// Regression test for https://github.com/rust-lang/rust/issues/143789 // Regression test for https://github.com/rust-lang/rust/issues/143789
#[must_use::skip] #[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() { } fn main() { }
// Regression test for https://github.com/rust-lang/rust/issues/137590 // Regression test for https://github.com/rust-lang/rust/issues/137590
struct S(#[stable::skip] u8, u16, u32); 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`

View file

@ -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 --> $DIR/builtin-attribute-prefix.rs:7:12
| |
LL | struct S(#[stable::skip] u8, u16, u32); LL | struct S(#[stable::skip] u8, u16, u32);
| ^^^^^^ use of unresolved module or unlinked crate `stable` | ^^^^^^ 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 --> $DIR/builtin-attribute-prefix.rs:2:3
| |
LL | #[must_use::skip] LL | #[must_use::skip]

View file

@ -43,11 +43,11 @@
struct Foo { struct Foo {
#[should_panic::skip] #[should_panic::skip]
//~^ ERROR failed to resolve //~^ ERROR cannot find
pub field: u8, pub field: u8,
#[should_panic::a::b::c] #[should_panic::a::b::c]
//~^ ERROR failed to resolve //~^ ERROR cannot find
pub field2: u8, pub field2: u8,
} }
@ -55,6 +55,6 @@ fn foo() {}
fn main() { fn main() {
#[deny::skip] #[deny::skip]
//~^ ERROR failed to resolve //~^ ERROR cannot find
foo(); foo();
} }

View file

@ -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 --> $DIR/check-builtin-attr-ice.rs:45:7
| |
LL | #[should_panic::skip] LL | #[should_panic::skip]
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic` | ^^^^^^^^^^^^ 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 --> $DIR/check-builtin-attr-ice.rs:49:7
| |
LL | #[should_panic::a::b::c] LL | #[should_panic::a::b::c]
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic` | ^^^^^^^^^^^^ 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 --> $DIR/check-builtin-attr-ice.rs:57:7
| |
LL | #[deny::skip] LL | #[deny::skip]

View file

@ -10,27 +10,27 @@
#![crate_type = "lib"] #![crate_type = "lib"]
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
mod we_are_no_strangers_to_love {} mod we_are_no_strangers_to_love {}
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
struct YouKnowTheRules { struct YouKnowTheRules {
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
and_so_do_i: u8, and_so_do_i: u8,
} }
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
fn a_full_commitment() { fn a_full_commitment() {
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
let is_what_i_am_thinking_of = (); let is_what_i_am_thinking_of = ();
} }
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
union AnyOtherGuy { union AnyOtherGuy {
owo: () owo: ()
} }
@ -39,30 +39,30 @@ struct This;
#[cfg_attr(FALSE, doc = "you wouldn't get this")] #[cfg_attr(FALSE, doc = "you wouldn't get this")]
impl From<AnyOtherGuy> for This { impl From<AnyOtherGuy> for This {
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This { fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
//~^ ERROR failed to resolve //~^ ERROR cannot find
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR attributes on expressions are experimental //~^ ERROR attributes on expressions are experimental
//~| ERROR failed to resolve //~| ERROR cannot find
unreachable!() unreachable!()
} }
} }
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
enum NeverGonna { enum NeverGonna {
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
GiveYouUp(#[cfg_attr::no_such_thing] u8), GiveYouUp(#[cfg_attr::no_such_thing] u8),
//~^ ERROR failed to resolve //~^ ERROR cannot find
LetYouDown { LetYouDown {
#![cfg_attr::no_such_thing] #![cfg_attr::no_such_thing]
//~^ ERROR an inner attribute is not permitted in this context //~^ ERROR an inner attribute is not permitted in this context
never_gonna: (), never_gonna: (),
round_around: (), round_around: (),
#[cfg_attr::no_such_thing] #[cfg_attr::no_such_thing]
//~^ ERROR failed to resolve //~^ ERROR cannot find
and_desert_you: (), and_desert_you: (),
}, },
} }

View file

@ -17,79 +17,79 @@ LL | #[cfg_attr::no_such_thing]
= help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable = 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 = 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 --> $DIR/check-cfg_attr-ice.rs:52:3
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:55:7
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:57:17
| |
LL | GiveYouUp(#[cfg_attr::no_such_thing] u8), LL | GiveYouUp(#[cfg_attr::no_such_thing] u8),
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:64:11
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:41:7
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:43:15
| |
LL | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This { LL | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This {
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:45:11
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:32:3
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:24:3
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:27:7
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:16:3
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:19:7
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]
| ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` | ^^^^^^^^ 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 --> $DIR/check-cfg_attr-ice.rs:12:3
| |
LL | #[cfg_attr::no_such_thing] LL | #[cfg_attr::no_such_thing]

View file

@ -2,5 +2,5 @@
mod existent {} mod existent {}
#[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent` #[existent::nonexistent] //~ ERROR cannot find `nonexistent` in `existent`
fn main() {} fn main() {}

View file

@ -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 --> $DIR/custom_attr_multisegment_error.rs:5:13
| |
LL | #[existent::nonexistent] LL | #[existent::nonexistent]

View file

@ -15,12 +15,12 @@ mod internal {
struct S { struct S {
#[rustfmt::skip] #[rustfmt::skip]
pub(in nonexistent) field: u8 //~ ERROR failed to resolve pub(in nonexistent) field: u8 //~ ERROR cannot find
} }
struct Z( struct Z(
#[rustfmt::skip] #[rustfmt::skip]
pub(in nonexistent) u8 //~ ERROR failed to resolve pub(in nonexistent) u8 //~ ERROR cannot find
); );
fn main() {} fn main() {}

View file

@ -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 --> $DIR/field-attributes-vis-unresolved.rs:18:12
| |
LL | pub(in nonexistent) field: u8 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; 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 --> $DIR/field-attributes-vis-unresolved.rs:23:12
| |
LL | pub(in nonexistent) u8 LL | pub(in nonexistent) u8

View file

@ -1,15 +1,15 @@
// issue#140255 // 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() {} 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() {} 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() {} 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 f3() {}
fn main() {} fn main() {}

View file

@ -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 --> $DIR/illegal-macro-use.rs:12:3
| |
LL | #[macro_escape::a::b] LL | #[macro_escape::a::b]
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape` | ^^^^^^^^^^^^ 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 --> $DIR/illegal-macro-use.rs:9:3
| |
LL | #[macro_escape::a] LL | #[macro_escape::a]
| ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape` | ^^^^^^^^^^^^ 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 --> $DIR/illegal-macro-use.rs:6:3
| |
LL | #[macro_use::a::b] LL | #[macro_use::a::b]
| ^^^^^^^^^ use of unresolved module or unlinked crate `macro_use` | ^^^^^^^^^ 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 --> $DIR/illegal-macro-use.rs:3:3
| |
LL | #[macro_use::a] LL | #[macro_use::a]

View file

@ -42,7 +42,7 @@ fn main() {
//~| HELP: `S5` has a name defined in the doc alias attribute as `DocAliasS5` //~| HELP: `S5` has a name defined in the doc alias attribute as `DocAliasS5`
not_exist_module::DocAliasS1; 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` //~| HELP: you might be missing a crate named `not_exist_module`
use_doc_alias_name_extern::DocAliasS1; 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` //~| HELP: `S1` has a name defined in the doc alias attribute as `DocAliasS1`
m::n::DocAliasX::y::S6; 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` //~| HELP: `x` has a name defined in the doc alias attribute as `DocAliasX`
m::n::x::y::DocAliasS6; m::n::x::y::DocAliasS6;

View file

@ -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 --> $DIR/use-doc-alias-name.rs:52:11
| |
LL | m::n::DocAliasX::y::S6; LL | m::n::DocAliasX::y::S6;
@ -136,7 +136,7 @@ LL - doc_alias_f2();
LL + f(); 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 --> $DIR/use-doc-alias-name.rs:44:5
| |
LL | not_exist_module::DocAliasS1; LL | not_exist_module::DocAliasS1;

View file

@ -4,9 +4,9 @@
fn main() { fn main() {
let mut a = E::StructVar { boxed: Box::new(5_i32) }; 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 { match a {
E::StructVar { box boxed } => { } E::StructVar { box boxed } => { }
//~^ ERROR failed to resolve: use of undeclared type `E` //~^ ERROR cannot find type `E`
} }
} }

View file

@ -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 --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17
| |
LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; 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) }; 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 --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9
| |
LL | E::StructVar { box boxed } => { } LL | E::StructVar { box boxed } => { }

View file

@ -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 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. // 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 could not find `doesnt_exist` in `inner`
//~| NOTE found an item that was configured out //~| NOTE found an item that was configured out

View file

@ -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 --> $DIR/diagnostics-cross-crate.rs:17:23
| |
LL | cfged_out::inner::doesnt_exist::hello(); LL | cfged_out::inner::doesnt_exist::hello();

View file

@ -40,22 +40,22 @@ mod reexport32 {
fn main() { fn main() {
reexport::gated::foo(); reexport::gated::foo();
//~^ ERROR failed to resolve: could not find `gated` in `reexport` //~^ ERROR cannot find
//~| NOTE could not find `gated` in `reexport` //~| NOTE could not find `gated` in `reexport`
reexport2::gated::foo(); reexport2::gated::foo();
//~^ ERROR failed to resolve: could not find `gated` in `reexport2` //~^ ERROR cannot find
//~| NOTE could not find `gated` in `reexport2` //~| NOTE could not find `gated` in `reexport2`
reexport30::gated::foo(); reexport30::gated::foo();
//~^ ERROR failed to resolve: could not find `gated` in `reexport30` //~^ ERROR cannot find
//~| NOTE could not find `gated` in `reexport30` //~| NOTE could not find `gated` in `reexport30`
reexport31::gated::foo(); reexport31::gated::foo();
//~^ ERROR failed to resolve: could not find `gated` in `reexport31` //~^ ERROR cannot find
//~| NOTE could not find `gated` in `reexport31` //~| NOTE could not find `gated` in `reexport31`
reexport32::gated::foo(); reexport32::gated::foo();
//~^ ERROR failed to resolve: could not find `gated` in `reexport32` //~^ ERROR cannot find
//~| NOTE could not find `gated` in `reexport32` //~| NOTE could not find `gated` in `reexport32`
} }

View file

@ -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 --> $DIR/diagnostics-reexport-2.rs:42:15
| |
LL | reexport::gated::foo(); LL | reexport::gated::foo();
@ -13,7 +13,7 @@ LL | #[cfg(false)]
LL | pub mod gated { 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 --> $DIR/diagnostics-reexport-2.rs:46:16
| |
LL | reexport2::gated::foo(); LL | reexport2::gated::foo();
@ -28,7 +28,7 @@ LL | #[cfg(false)]
LL | pub mod gated { 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 --> $DIR/diagnostics-reexport-2.rs:50:17
| |
LL | reexport30::gated::foo(); LL | reexport30::gated::foo();
@ -43,7 +43,7 @@ LL | #[cfg(false)]
LL | pub mod gated { 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 --> $DIR/diagnostics-reexport-2.rs:54:17
| |
LL | reexport31::gated::foo(); LL | reexport31::gated::foo();
@ -58,7 +58,7 @@ LL | #[cfg(false)]
LL | pub mod gated { 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 --> $DIR/diagnostics-reexport-2.rs:58:17
| |
LL | reexport32::gated::foo(); LL | reexport32::gated::foo();

View file

@ -50,7 +50,7 @@ fn main() {
//~| NOTE not found in `inner` //~| NOTE not found in `inner`
// The module isn't found - we get a diagnostic. // 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` //~| NOTE could not find `doesnt_exist` in `inner`
// It should find the one in the right module, not the wrong one. // It should find the one in the right module, not the wrong one.

View file

@ -28,7 +28,7 @@ LL | #[cfg(false)]
LL | pub mod doesnt_exist { 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 --> $DIR/diagnostics-same-crate.rs:53:12
| |
LL | inner::doesnt_exist::hello(); LL | inner::doesnt_exist::hello();

View file

@ -1,8 +1,8 @@
struct ErrorKind; struct ErrorKind;
struct Error(ErrorKind); struct Error(ErrorKind);
impl From<nope::Thing> for Error { //~ ERROR failed to resolve impl From<nope::Thing> for Error { //~ ERROR cannot find
fn from(_: nope::Thing) -> Self { //~ ERROR failed to resolve fn from(_: nope::Thing) -> Self { //~ ERROR cannot find
unimplemented!() unimplemented!()
} }
} }

View file

@ -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 --> $DIR/conflicting-impl-with-err.rs:4:11
| |
LL | impl From<nope::Thing> for Error { 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` = 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 --> $DIR/conflicting-impl-with-err.rs:5:16
| |
LL | fn from(_: nope::Thing) -> Self { LL | fn from(_: nope::Thing) -> Self {

View file

@ -11,7 +11,7 @@ where
//~^ ERROR only lifetime parameters can be used in this context //~^ 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 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 //~| ERROR the name `N` is already used for a generic parameter in this item's generic parameters
{ {
} }

View file

@ -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]:, 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 --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43
| |
LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:,

View file

@ -24,7 +24,7 @@ where
fn pop(self) -> (Self::Newlen, Self::Output) { fn pop(self) -> (Self::Newlen, Self::Output) {
let mut iter = IntoIter::new(self); 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 end = iter.next_back().unwrap();
let new = [(); N - 1].map(move |()| iter.next().unwrap()); let new = [(); N - 1].map(move |()| iter.next().unwrap());
(new, end) (new, end)

View file

@ -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 --> $DIR/issue-82956.rs:26:24
| |
LL | let mut iter = IntoIter::new(self); LL | let mut iter = IntoIter::new(self);

View file

@ -7,7 +7,7 @@
const REF_INTERIOR_MUT: &usize = { const REF_INTERIOR_MUT: &usize = {
//~^ HELP consider importing this struct //~^ HELP consider importing this struct
static FOO: Sync = AtomicUsize::new(0); 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 //~| 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 //~| 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! //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!

View file

@ -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 --> $DIR/const_refs_to_static-ice-121413.rs:9:24
| |
LL | static FOO: Sync = AtomicUsize::new(0); LL | static FOO: Sync = AtomicUsize::new(0);

View file

@ -40,7 +40,7 @@ impl Trait for S {
} }
mod prefix {} 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 reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position
fn main() {} fn main() {}

View file

@ -91,7 +91,7 @@ LL | type Type;
LL | impl Trait for S { LL | impl Trait for S {
| ^^^^^^^^^^^^^^^^ missing `Type` in implementation | ^^^^^^^^^^^^^^^^ 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 --> $DIR/bad-resolve.rs:43:7
| |
LL | reuse unresolved_prefix::{a, b, c}; 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` = 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 --> $DIR/bad-resolve.rs:44:29
| |
LL | reuse prefix::{self, super, crate}; 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 error: aborting due to 12 previous errors

View file

@ -5,7 +5,7 @@ trait Trait {}
struct S; struct S;
impl Trait for u8 { 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` reuse S::*; //~ ERROR expected trait, found struct `S`
} }

View file

@ -4,7 +4,7 @@ error: expected trait, found struct `S`
LL | reuse S::*; LL | reuse S::*;
| ^ not a trait | ^ 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 --> $DIR/glob-bad-path.rs:8:11
| |
LL | reuse unresolved::*; LL | reuse unresolved::*;

View file

@ -4,7 +4,7 @@
mod unresolved { mod unresolved {
struct S; struct S;
reuse impl unresolved for S { self.0 } 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 //~| ERROR cannot find trait `unresolved` in this scope
trait T {} trait T {}

View file

@ -16,7 +16,7 @@ error: expected trait, found module `TraitModule`
LL | reuse impl TraitModule for S { self.0 } LL | reuse impl TraitModule for S { self.0 }
| ^^^^^^^^^^^ not a trait | ^^^^^^^^^^^ 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 --> $DIR/impl-reuse-bad-path.rs:6:16
| |
LL | reuse impl unresolved for S { self.0 } LL | reuse impl unresolved for S { self.0 }

View file

@ -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 --> $DIR/issue-31997-1.rs:20:19
| |
LL | let mut map = HashMap::new(); LL | let mut map = HashMap::new();

View file

@ -2,12 +2,18 @@ mod a {}
macro_rules! m { macro_rules! m {
() => { () => {
use a::$crate; //~ ERROR unresolved import `a::$crate` use a::$crate; //~ ERROR: unresolved import `a::$crate`
use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position //~^ NOTE: no `$crate` in `a`
type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position 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!(); m!();
//~^ NOTE: in this expansion
//~| NOTE: in this expansion
//~| NOTE: in this expansion
fn main() {} fn main() {}

View file

@ -1,8 +1,8 @@
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/dollar-crate-is-keyword-2.rs:6:16 --> $DIR/dollar-crate-is-keyword-2.rs:7:16
| |
LL | use a::$crate::b; 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!(); LL | m!();
| ---- in this macro invocation | ---- 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) = 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 error[E0433]: `$crate` in paths can only be used in start position
--> $DIR/dollar-crate-is-keyword-2.rs:7:21 --> $DIR/dollar-crate-is-keyword-2.rs:9:21
| |
LL | type A = a::$crate; 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!(); LL | m!();
| ---- in this macro invocation | ---- in this macro invocation

View file

@ -13,7 +13,7 @@ fn eii1_impl(x: u64) {
println!("{x:?}") 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) { fn eii3_impl(x: u64) {
println!("{x:?}") println!("{x:?}")
} }

View file

@ -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 --> $DIR/privacy2.rs:16:12
| |
LL | #[codegen::eii3] LL | #[codegen::eii3]

View file

@ -12,5 +12,6 @@ impl E {
} }
fn main() { 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
} }

View file

@ -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 --> $DIR/assoc-fn-call-on-variant.rs:15:8
| |
LL | E::A::f(); LL | E::A::f();

View file

@ -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 --> $DIR/E0433.rs:2:15
| |
LL | let map = NonExistingMap::new(); LL | let map = NonExistingMap::new();

View file

@ -16,5 +16,5 @@ pub mod m {
} }
fn main() { fn main() {
somedep::somefun(); //~ ERROR failed to resolve somedep::somefun(); //~ ERROR cannot find
} }

View file

@ -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 --> $DIR/multiple-opts.rs:19:5
| |
LL | somedep::somefun(); LL | somedep::somefun();

View file

@ -3,5 +3,5 @@
//@ edition:2018 //@ edition:2018
fn main() { fn main() {
somedep::somefun(); //~ ERROR failed to resolve somedep::somefun(); //~ ERROR cannot find
} }

View file

@ -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 --> $DIR/noprelude.rs:6:5
| |
LL | somedep::somefun(); LL | somedep::somefun();

View file

@ -2,5 +2,5 @@
fn main() { fn main() {
enum Foo {} 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`
} }

View file

@ -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 --> $DIR/extern-macro.rs:5:13
| |
LL | let _ = Foo::bar!(); 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 error: aborting due to 1 previous error

View file

@ -2,5 +2,5 @@
use core::default; //~ ERROR unresolved import `core` use core::default; //~ ERROR unresolved import `core`
fn main() { fn main() {
let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve let _: u8 = ::core::default::Default(); //~ ERROR cannot find
} }

View file

@ -7,7 +7,7 @@ LL | use core::default;
| you might be missing crate `core` | you might be missing crate `core`
| help: try using `std` instead of `core`: `std` | 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 --> $DIR/feature-gate-extern_absolute_paths.rs:5:19
| |
LL | let _: u8 = ::core::default::Default(); LL | let _: u8 = ::core::default::Default();

View file

@ -1,4 +1,4 @@
extern "C" fn _f() -> libc::uintptr_t {} extern "C" fn _f() -> libc::uintptr_t {}
//~^ ERROR failed to resolve //~^ ERROR cannot find
fn main() {} fn main() {}

View file

@ -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 --> $DIR/stashed-issue-121451.rs:1:23
| |
LL | extern "C" fn _f() -> libc::uintptr_t {} LL | extern "C" fn _f() -> libc::uintptr_t {}

View file

@ -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 { fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {
//~^ ERROR equality constraints are not yet supported in `where` clauses //~^ 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!() panic!()
} }

View file

@ -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, 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 --> $DIR/equality-bound.rs:9:41
| |
LL | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 { LL | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 {

View file

@ -10,7 +10,7 @@ macro a() {
mod u { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } 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 { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } 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() {} fn main() {}

View file

@ -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) = 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 --> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }
@ -29,7 +29,7 @@ LL | a!();
std::mem std::mem
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) = 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 --> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }

View file

@ -10,7 +10,7 @@ macro a() {
mod u { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } 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 { mod u {
// Late resolution. // Late resolution.
fn f() { my_core::mem::drop(0); } 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() {} fn main() {}

View file

@ -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) = 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 --> $DIR/extern-prelude-from-opaque-fail.rs:12:18
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }
@ -29,7 +29,7 @@ LL | a!();
my_core::mem my_core::mem
= note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) = 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 --> $DIR/extern-prelude-from-opaque-fail.rs:25:14
| |
LL | fn f() { my_core::mem::drop(0); } LL | fn f() { my_core::mem::drop(0); }

View file

@ -9,7 +9,7 @@ mod foo {
#[no_implicit_prelude] #[no_implicit_prelude]
mod bar { mod bar {
pub macro m() { pub macro m() {
Vec::new(); //~ ERROR failed to resolve Vec::new(); //~ ERROR cannot find
().clone() //~ ERROR no method named `clone` found ().clone() //~ ERROR no method named `clone` found
} }
fn f() { fn f() {

View file

@ -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 --> $DIR/no_implicit_prelude.rs:12:9
| |
LL | fn f() { ::bar::m!(); } LL | fn f() { ::bar::m!(); }

View file

@ -9,12 +9,12 @@ pub fn gather_all() -> impl Iterator<Item = Lint> {
} }
fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> {
//~^ ERROR: failed to resolve //~^ ERROR: cannot find
unimplemented!() unimplemented!()
} }
fn lint_files() -> impl Iterator<Item = foo::MissingItem> { fn lint_files() -> impl Iterator<Item = foo::MissingItem> {
//~^ ERROR: failed to resolve //~^ ERROR: cannot find
unimplemented!() unimplemented!()
} }

View file

@ -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 --> $DIR/issue-72911.rs:11:33
| |
LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { 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` = 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 --> $DIR/issue-72911.rs:16:41
| |
LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> { LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> {

View file

@ -4,7 +4,7 @@ trait MyTrait {
async fn foo(self) -> (Self, i32); 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) { async fn foo(self, key: i32) -> (u32, i32) {
(self, key) (self, key)
} }

View file

@ -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 --> $DIR/stashed-diag-issue-121504.rs:7:18
| |
LL | impl MyTrait for xyz::T { LL | impl MyTrait for xyz::T {

View file

@ -3,9 +3,12 @@
mod foo {} mod foo {}
use foo::{ use foo::{
::bar, //~ ERROR crate root in paths can only be used in start position ::bar,
super::bar, //~ ERROR `super` in paths can only be used in start position //~^ ERROR: crate root in paths can only be used in start position
self::bar, //~ ERROR `self` 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() {} fn main() {}

View file

@ -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 --> $DIR/absolute-paths-in-nested-use-groups.rs:6:5
| |
LL | ::bar, 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 error[E0433]: `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
--> $DIR/absolute-paths-in-nested-use-groups.rs:8:5 --> $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, 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 error: aborting due to 3 previous errors

View file

@ -7,7 +7,7 @@ mod n {
mod m { mod m {
fn check() { fn check() {
two_macros::m!(); //~ ERROR failed to resolve: use of unresolved module or unlinked crate `two_macros` two_macros::m!(); //~ ERROR cannot find
} }
} }

View file

@ -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) = 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 --> $DIR/extern-prelude-extern-crate-fail.rs:10:9
| |
LL | two_macros::m!(); LL | two_macros::m!();

View file

@ -3,11 +3,11 @@
// caused by `{{root}}` appearing in diagnostic suggestions // caused by `{{root}}` appearing in diagnostic suggestions
mod A { 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 { 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() {} fn main() {}

View file

@ -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 --> $DIR/nested-import-root-symbol-150103.rs:6:9
| |
LL | use Iuse::{ ::Fish }; 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; 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 --> $DIR/nested-import-root-symbol-150103.rs:10:13
| |
LL | use A::{::Fish}; 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 error: aborting due to 2 previous errors

View file

@ -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 --> $DIR/suggest-import-issue-120074.rs:14:35
| |
LL | println!("Hello, {}!", crate::bar::do_the_thing); LL | println!("Hello, {}!", crate::bar::do_the_thing);

View file

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

View file

@ -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 --> $DIR/suggest-import-issue-120074.rs:14:35
| |
LL | println!("Hello, {}!", crate::bar::do_the_thing); LL | println!("Hello, {}!", crate::bar::do_the_thing);

View file

@ -11,5 +11,5 @@ pub mod foo {
} }
fn main() { 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`
} }

View file

@ -1,8 +1,8 @@
//@ edition:2015 //@ edition:2015
use clippy::a; //~ ERROR unresolved import `clippy` 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; //~ 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() {} fn main() {}

View file

@ -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 --> $DIR/tool-mod-child.rs:3:5
| |
LL | use clippy::a::b; 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; 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 --> $DIR/tool-mod-child.rs:6:5
| |
LL | use rustdoc::a::b; LL | use rustdoc::a::b;

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