Skip to content

Commit 67db88f

Browse files
author
Michael Wright
committed
Fix breakage due to rust-lang/rust#62705
Also rename `OUTER_EXPN_INFO` to `OUTER_EXPN_EXPN_INFO` to match new function names.
1 parent bd4c4e7 commit 67db88f

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

clippy_lints/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
668668
utils::internal_lints::CLIPPY_LINTS_INTERNAL,
669669
utils::internal_lints::COMPILER_LINT_FUNCTIONS,
670670
utils::internal_lints::LINT_WITHOUT_LINT_PASS,
671-
utils::internal_lints::OUTER_EXPN_INFO,
671+
utils::internal_lints::OUTER_EXPN_EXPN_INFO,
672672
]);
673673

674674
reg.register_lint_group("clippy::all", Some("clippy"), vec![

clippy_lints/src/utils/internal_lints.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ declare_clippy_lint! {
9393
/// ```rust
9494
/// expr.span.ctxt().outer_expn_info()
9595
/// ```
96-
pub OUTER_EXPN_INFO,
96+
pub OUTER_EXPN_EXPN_INFO,
9797
internal,
98-
"using `cx.outer().expn_info()` instead of `cx.outer_expn_info()`"
98+
"using `cx.outer_expn().expn_info()` instead of `cx.outer_expn_info()`"
9999
}
100100

101101
declare_lint_pass!(ClippyLintsInternal => [CLIPPY_LINTS_INTERNAL]);
@@ -280,15 +280,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CompilerLintFunctions {
280280

281281
pub struct OuterExpnInfoPass;
282282

283-
impl_lint_pass!(OuterExpnInfoPass => [OUTER_EXPN_INFO]);
283+
impl_lint_pass!(OuterExpnInfoPass => [OUTER_EXPN_EXPN_INFO]);
284284

285285
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnInfoPass {
286286
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx hir::Expr) {
287287
let (method_names, arg_lists) = method_calls(expr, 2);
288288
let method_names: Vec<LocalInternedString> = method_names.iter().map(|s| s.as_str()).collect();
289289
let method_names: Vec<&str> = method_names.iter().map(std::convert::AsRef::as_ref).collect();
290290
if_chain! {
291-
if let ["expn_info", "outer"] = method_names.as_slice();
291+
if let ["expn_info", "outer_expn"] = method_names.as_slice();
292292
let args = arg_lists[1];
293293
if args.len() == 1;
294294
let self_arg = &args[0];
@@ -297,9 +297,9 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for OuterExpnInfoPass {
297297
then {
298298
span_lint_and_sugg(
299299
cx,
300-
OUTER_EXPN_INFO,
300+
OUTER_EXPN_EXPN_INFO,
301301
expr.span.trim_start(self_arg.span).unwrap_or(expr.span),
302-
"usage of `outer().expn_info()`",
302+
"usage of `outer_expn().expn_info()`",
303303
"try",
304304
".outer_expn_info()".to_string(),
305305
Applicability::MachineApplicable,

tests/ui/outer_expn_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ declare_lint_pass!(Pass => [TEST_LINT]);
1616

1717
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
1818
fn check_expr(&mut self, _cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
19-
let _ = expr.span.ctxt().outer().expn_info();
19+
let _ = expr.span.ctxt().outer_expn().expn_info();
2020
}
2121
}
2222

tests/ui/outer_expn_info.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
error: usage of `outer().expn_info()`
1+
error: usage of `outer_expn().expn_info()`
22
--> $DIR/outer_expn_info.rs:19:33
33
|
4-
LL | let _ = expr.span.ctxt().outer().expn_info();
5-
| ^^^^^^^^^^^^^^^^^^^^ help: try: `.outer_expn_info()`
4+
LL | let _ = expr.span.ctxt().outer_expn().expn_info();
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.outer_expn_info()`
66
|
77
note: lint level defined here
88
--> $DIR/outer_expn_info.rs:1:9
99
|
1010
LL | #![deny(clippy::internal)]
1111
| ^^^^^^^^^^^^^^^^
12-
= note: `#[deny(clippy::outer_expn_info)]` implied by `#[deny(clippy::internal)]`
12+
= note: `#[deny(clippy::outer_expn_expn_info)]` implied by `#[deny(clippy::internal)]`
1313

1414
error: aborting due to previous error
1515

0 commit comments

Comments
 (0)