Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy fails with latest master rustc #3500

Closed
phansch opened this issue Dec 6, 2018 · 4 comments
Closed

Clippy fails with latest master rustc #3500

phansch opened this issue Dec 6, 2018 · 4 comments
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@phansch
Copy link
Member

phansch commented Dec 6, 2018

Caused by this rollup: rust-lang/rust#56557
Not sure which PR exactly.

@phansch phansch added the I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️ label Dec 6, 2018
@matthiaskrgr
Copy link
Member

Probably rust-lang/rust@08f8fae
I'll have a look...

@matthiaskrgr
Copy link
Member

Hmm I got it to build via

diff --git a/clippy_lints/src/use_self.rs b/clippy_lints/src/use_self.rs
index 3a71a6d0..27ca01b8 100644
--- a/clippy_lints/src/use_self.rs
+++ b/clippy_lints/src/use_self.rs
@@ -14,7 +14,7 @@ use crate::rustc::ty;
 use crate::rustc::{declare_tool_lint, lint_array};
 use crate::rustc_errors::Applicability;
 use crate::syntax::ast::NodeId;
-use crate::syntax_pos::symbol::keywords::SelfType;
+use crate::syntax_pos::symbol::keywords::SelfUpper;
 use crate::utils::{in_macro, span_lint_and_sugg};
 use if_chain::if_chain;

@@ -226,7 +226,7 @@ struct UseSelfVisitor<'a, 'tcx: 'a> {

 impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
     fn visit_path(&mut self, path: &'tcx Path, _id: HirId) {
-        if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfType.name() {
+        if self.item_path.def == path.def && path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfUpper.name() {
             span_use_self_lint(self.cx, path);
         }

diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs
index 0c6935d8..f1c1b7b5 100644
--- a/clippy_lints/src/utils/mod.rs
+++ b/clippy_lints/src/utils/mod.rs
@@ -970,7 +970,7 @@ pub fn opt_def_id(def: Def) -> Option<DefId> {

 pub fn is_self(slf: &Arg) -> bool {
     if let PatKind::Binding(_, _, name, _) = slf.pat.node {
-        name.name == keywords::SelfValue.name()
+        name.name == keywords::SelfUpper.name()
     } else {
         false
     }

but there are actual test failures now ... :/

@mati865
Copy link
Contributor

mati865 commented Dec 6, 2018

@matthiaskrgr

-        name.name == keywords::SelfValue.name()
+        name.name == keywords::SelfUpper.name()

Shouldn't it be:

-        name.name == keywords::SelfValue.name()
+        name.name == keywords::SelfLower.name()

?

@matthiaskrgr
Copy link
Member

RIght, thanks, I just found out by trial error :P
Will prep PR in a couple of minutes.

@phansch phansch closed this as completed in 45cbdf4 Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants