Remove unused overridden property (#2217)

This commit is contained in:
Charlie Marsh 2023-01-26 14:46:46 -05:00 committed by GitHub
parent 4f3b63edd4
commit f15c562a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 14 deletions

View File

@ -89,9 +89,6 @@ pub struct Scope<'a> {
pub uses_locals: bool,
/// A map from bound name to binding index.
pub values: FxHashMap<&'a str, usize>,
/// A list of (name, index) pairs for bindings that were overridden in the
/// scope.
pub overridden: Vec<(&'a str, usize)>,
}
impl<'a> Scope<'a> {
@ -102,7 +99,6 @@ impl<'a> Scope<'a> {
import_starred: false,
uses_locals: false,
values: FxHashMap::default(),
overridden: Vec::new(),
}
}
}

View File

@ -4508,11 +4508,7 @@ impl<'a> Checker<'a> {
.rules
.enabled(&Rule::TypingOnlyStandardLibraryImport)
{
for (.., index) in scope
.values
.iter()
.chain(scope.overridden.iter().map(|(a, b)| (a, b)))
{
for (.., index) in &scope.values {
let binding = &self.bindings[*index];
if let Some(diagnostic) =
@ -4549,11 +4545,7 @@ impl<'a> Checker<'a> {
let mut ignored: FxHashMap<BindingContext, Vec<UnusedImport>> =
FxHashMap::default();
for (name, index) in scope
.values
.iter()
.chain(scope.overridden.iter().map(|(a, b)| (a, b)))
{
for (name, index) in &scope.values {
let binding = &self.bindings[*index];
let full_name = match &binding.kind {