Skip to content

Commit 233e9bb

Browse files
committed
self.context.span
1 parent 3aaed23 commit 233e9bb

File tree

1 file changed

+2
-4
lines changed
  • crates/ty_python_semantic/src/types

1 file changed

+2
-4
lines changed

crates/ty_python_semantic/src/types/infer.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! be considered a bug.)
3636
3737
use itertools::{Either, Itertools};
38-
use ruff_db::diagnostic::{Annotation, DiagnosticId, Severity, Span};
38+
use ruff_db::diagnostic::{Annotation, DiagnosticId, Severity};
3939
use ruff_db::files::File;
4040
use ruff_db::parsed::{ParsedModuleRef, parsed_module};
4141
use ruff_python_ast::visitor::{Visitor, walk_expr};
@@ -4720,9 +4720,7 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
47204720
{
47214721
builder
47224722
.into_diagnostic(format_args!("no binding for nonlocal `{name}` found"))
4723-
.annotate(Annotation::primary(
4724-
Span::from(self.context.file()).with_range(*range),
4725-
));
4723+
.annotate(Annotation::primary(self.context.span(*range)));
47264724
}
47274725
}
47284726
}

0 commit comments

Comments
 (0)