X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_lint%2Fnonstandard_style.rs;h=40781b0771d89d72a0161bb83ed933f54b21aeb2;hb=30c669819342dc09d6bd29dc72d0ff85381b71d2;hp=09871c0e84049d801888014eafc012a400faa67f;hpb=9395f0af789dc007e23dbae5d961c0751ab2dbe7;p=rust.git diff --git a/src/librustc_lint/nonstandard_style.rs b/src/librustc_lint/nonstandard_style.rs index 09871c0e840..40781b0771d 100644 --- a/src/librustc_lint/nonstandard_style.rs +++ b/src/librustc_lint/nonstandard_style.rs @@ -59,10 +59,10 @@ fn char_has_case(c: char) -> bool { fn is_camel_case(name: ast::Name) -> bool { let name = name.as_str(); + let name = name.trim_matches('_'); if name.is_empty() { return true; } - let name = name.trim_matches('_'); // start with a non-lowercase letter rather than non-uppercase // ones (some scripts don't have a concept of upper/lowercase) @@ -121,7 +121,7 @@ fn check_item(&mut self, cx: &LateContext, it: &hir::Item) { let has_repr_c = it.attrs .iter() .any(|attr| { - attr::find_repr_attrs(cx.tcx.sess.diagnostic(), attr) + attr::find_repr_attrs(&cx.tcx.sess.parse_sess, attr) .iter() .any(|r| r == &attr::ReprC) });