Fix binding mode problems
This commit is contained in:
parent
e1819a889a
commit
3d5438accd
67 changed files with 154 additions and 181 deletions
|
@ -183,7 +183,7 @@ impl EarlyLintPass for NonAsciiIdents {
|
|||
#[allow(rustc::potential_query_instability)]
|
||||
let mut symbols: Vec<_> = symbols.iter().collect();
|
||||
symbols.sort_by_key(|k| k.1);
|
||||
for (symbol, &sp) in symbols.iter() {
|
||||
for &(ref symbol, &sp) in symbols.iter() {
|
||||
let symbol_str = symbol.as_str();
|
||||
if symbol_str.is_ascii() {
|
||||
continue;
|
||||
|
@ -242,7 +242,7 @@ impl EarlyLintPass for NonAsciiIdents {
|
|||
UnordMap::with_capacity(symbols.len());
|
||||
let mut skeleton_buf = String::new();
|
||||
|
||||
for (&symbol, &sp) in symbols.iter() {
|
||||
for &(&symbol, &sp) in symbols.iter() {
|
||||
use unicode_security::confusable_detection::skeleton;
|
||||
|
||||
let symbol_str = symbol.as_str();
|
||||
|
@ -298,7 +298,7 @@ impl EarlyLintPass for NonAsciiIdents {
|
|||
script_states.insert(latin_augmented_script_set, ScriptSetUsage::Verified);
|
||||
|
||||
let mut has_suspicious = false;
|
||||
for (symbol, &sp) in symbols.iter() {
|
||||
for &(ref symbol, &sp) in symbols.iter() {
|
||||
let symbol_str = symbol.as_str();
|
||||
for ch in symbol_str.chars() {
|
||||
if ch.is_ascii() {
|
||||
|
|
|
@ -344,7 +344,7 @@ impl<'tcx> LateLintPass<'tcx> for NonSnakeCase {
|
|||
ast::attr::find_by_name(cx.tcx.hir().attrs(hir::CRATE_HIR_ID), sym::crate_name)
|
||||
.and_then(|attr| {
|
||||
if let AttrKind::Normal(n) = &attr.kind
|
||||
&& let AttrItem { args: AttrArgs::Eq { eq_span: _, expr: ref lit }, .. } =
|
||||
&& let AttrItem { args: AttrArgs::Eq { eq_span: _, expr: lit }, .. } =
|
||||
n.as_ref()
|
||||
&& let ast::LitKind::Str(name, ..) = lit.kind
|
||||
{
|
||||
|
|
|
@ -1791,7 +1791,7 @@ impl<'tcx> LateLintPass<'tcx> for VariantSizeDifferences {
|
|||
let t = cx.tcx.type_of(it.owner_id).instantiate_identity();
|
||||
let ty = cx.tcx.erase_regions(t);
|
||||
let Ok(layout) = cx.layout_of(ty) else { return };
|
||||
let Variants::Multiple { tag_encoding: TagEncoding::Direct, tag, ref variants, .. } =
|
||||
let Variants::Multiple { tag_encoding: TagEncoding::Direct, tag, variants, .. } =
|
||||
&layout.variants
|
||||
else {
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue