about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-09-12 09:07:44 -0400
committerMichael Goulet <michael@errs.io>2024-09-12 09:07:44 -0400
commit9d5d03b7dec8a87c81528e9a1310313fa3f0111e (patch)
tree9eea3c65ae35238165d7d9d47c6bf05878d02463 /compiler/rustc_trait_selection/src
parent8d6b88b168e45ee1624699c19443c49665322a91 (diff)
downloadrust-9d5d03b7dec8a87c81528e9a1310313fa3f0111e.tar.gz
rust-9d5d03b7dec8a87c81528e9a1310313fa3f0111e.zip
Don't call extern_crate when local crate name is the same as a dependency and we have a trait error
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
index 5918686213a..85a6ef5caab 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs
@@ -1669,6 +1669,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
             let name = self.tcx.crate_name(trait_def_id.krate);
             let spans: Vec<_> = [trait_def_id, found_type]
                 .into_iter()
+                .filter(|def_id| def_id.krate != LOCAL_CRATE)
                 .filter_map(|def_id| self.tcx.extern_crate(def_id.krate))
                 .map(|data| {
                     let dependency = if data.dependency_of == LOCAL_CRATE {