Skip to content

Commit 7e9e724

Browse files
author
The Miri Cronjob Bot
committed
Merge ref '3507a749b365' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 3507a749b365aae4eefa96ab700a9315d3280ee7 Filtered ref: 67f9124a1e199effc310447c1c1f9548093bd8f9 This merge was created using https://github.com/rust-lang/josh-sync.
2 parents 188717a + 7c55b50 commit 7e9e724

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

clippy_lints/src/item_name_repetitions.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use rustc_data_structures::fx::FxHashSet;
88
use rustc_hir::{EnumDef, FieldDef, Item, ItemKind, OwnerId, QPath, TyKind, Variant, VariantData};
99
use rustc_lint::{LateContext, LateLintPass};
1010
use rustc_session::impl_lint_pass;
11-
use rustc_span::MacroKind;
1211
use rustc_span::symbol::Symbol;
1312

1413
declare_clippy_lint! {
@@ -503,8 +502,8 @@ impl LateLintPass<'_> for ItemNameRepetitions {
503502
);
504503
}
505504

506-
let is_macro_rule = matches!(item.kind, ItemKind::Macro(_, _, MacroKind::Bang));
507-
if both_are_public && item_camel.len() > mod_camel.len() && !is_macro_rule {
505+
let is_macro = matches!(item.kind, ItemKind::Macro(_, _, _));
506+
if both_are_public && item_camel.len() > mod_camel.len() && !is_macro {
508507
let matching = count_match_start(mod_camel, &item_camel);
509508
let rmatching = count_match_end(mod_camel, &item_camel);
510509
let nchars = mod_camel.chars().count();

clippy_lints/src/redundant_pub_crate.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use rustc_lint::{LateContext, LateLintPass};
77
use rustc_middle::ty;
88
use rustc_session::impl_lint_pass;
99
use rustc_span::def_id::CRATE_DEF_ID;
10-
use rustc_span::hygiene::MacroKind;
1110

1211
declare_clippy_lint! {
1312
/// ### What it does
@@ -89,7 +88,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
8988
// We ignore macro exports. And `ListStem` uses, which aren't interesting.
9089
fn is_ignorable_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
9190
if let ItemKind::Use(path, kind) = item.kind {
92-
let ignore = matches!(path.res.macro_ns, Some(Res::Def(DefKind::Macro(MacroKind::Bang), _)))
91+
let ignore = matches!(path.res.macro_ns, Some(Res::Def(DefKind::Macro(_), _)))
9392
|| kind == UseKind::ListStem;
9493
if ignore {
9594
return true;

tests/missing-test-files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(rust_2018_idioms, unused_lifetimes)]
22
#![allow(clippy::assertions_on_constants)]
3-
#![feature(path_file_prefix)]
3+
#![cfg_attr(bootstrap, feature(path_file_prefix))]
44

55
use std::cmp::Ordering;
66
use std::ffi::OsStr;

tests/ui/crashes/ice-6255.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro_rules! define_other_core {
99
}
1010

1111
fn main() {
12-
core::panic!();
12+
core::panic!(); //~ ERROR: `core` is ambiguous
1313
}
1414

1515
define_other_core!();

tests/ui/crashes/ice-6255.stderr

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,25 @@ LL | define_other_core!();
99
|
1010
= note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)
1111

12-
error: aborting due to 1 previous error
12+
error[E0659]: `core` is ambiguous
13+
--> tests/ui/crashes/ice-6255.rs:12:5
14+
|
15+
LL | core::panic!();
16+
| ^^^^ ambiguous name
17+
|
18+
= note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution
19+
= note: `core` could refer to a built-in crate
20+
note: `core` could also refer to the crate imported here
21+
--> tests/ui/crashes/ice-6255.rs:6:9
22+
|
23+
LL | extern crate std as core;
24+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
25+
...
26+
LL | define_other_core!();
27+
| -------------------- in this macro invocation
28+
= help: use `crate::core` to refer to this crate unambiguously
29+
= note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)
30+
31+
error: aborting due to 2 previous errors
1332

33+
For more information about this error, try `rustc --explain E0659`.

0 commit comments

Comments
 (0)