Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_resolve/src/ident.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
Scope::ExternPreludeItems | Scope::ExternPreludeFlags => {
use_prelude || module_and_extern_prelude || extern_prelude
}
Scope::ToolAttributePrelude => use_prelude,
Scope::ToolAttributePrelude => true,
Scope::StdLibPrelude => use_prelude || ns == MacroNS,
Scope::BuiltinTypes => true,
};
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/tool-attributes/no_implicit_prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ mod test2 {
pub use ::std::derive as format_args;
}

#[rustfmt::skip]
//~^ ERROR cannot find module or crate `rustfmt` in this scope
#[my_tool::attr] // Unaffected by the `no_implicit_prelude` attribute
#[rustfmt::skip] // Unaffected by the `no_implicit_prelude` attribute
#[clippy::format_args(Debug)]
//~^ ERROR attribute macro `clippy::format_args` is ambiguous
struct Foo;
Expand Down
9 changes: 1 addition & 8 deletions tests/ui/tool-attributes/no_implicit_prelude.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,5 @@ LL | #[clippy::format_args(Debug)]
= note: ambiguous because of a name conflict with a tool namespace
= note: `clippy` could refer to a tool namespace

error[E0433]: cannot find module or crate `rustfmt` in this scope
--> $DIR/no_implicit_prelude.rs:20:7
|
LL | #[rustfmt::skip]
| ^^^^^^^ use of unresolved module or unlinked crate `rustfmt`

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0433`.
Loading