Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9a6ef78

Browse files
authoredSep 11, 2023
Unrolled build for rust-lang#115743
Rollup merge of rust-lang#115743 - compiler-errors:no-impls, r=davidtwco Point out if a local trait has no implementations Slightly helps with rust-lang#115741
2 parents 3ebb562 + 30e6cea commit 9a6ef78

File tree

63 files changed

+658
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+658
-6
lines changed
 

‎compiler/rustc_middle/src/ty/trait_def.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ pub struct TraitImpls {
9090
}
9191

9292
impl TraitImpls {
93+
pub fn is_empty(&self) -> bool {
94+
self.blanket_impls.is_empty() && self.non_blanket_impls.is_empty()
95+
}
96+
9397
pub fn blanket_impls(&self) -> &[DefId] {
9498
self.blanket_impls.as_slice()
9599
}

‎compiler/rustc_trait_selection/messages.ftl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,7 @@ trait_selection_no_value_in_rustc_on_unimplemented = this attribute must have a
4040
.label = expected value here
4141
.note = eg `#[rustc_on_unimplemented(message="foo")]`
4242
43+
trait_selection_trait_has_no_impls = this trait has no implementations, consider adding one
44+
4345
trait_selection_ty_alias_overflow = in case this is a recursive type alias, consider using a struct, enum, or union instead
4446
trait_selection_unable_to_construct_constant_value = unable to construct a constant value for the unevaluated constant {$unevaluated}

0 commit comments

Comments
 (0)
This repository has been archived.