From fa62b5fa6d63c5baa120979b0539bf3f323dc70b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kopp=C3=A1ny=20P=C3=A1zm=C3=A1n?= Date: Tue, 5 Nov 2024 14:09:30 +0100 Subject: [PATCH 1/2] trait object constraint correction --- src/types/trait-object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/trait-object.md b/src/types/trait-object.md index 7a72f330e..3cd91036e 100644 --- a/src/types/trait-object.md +++ b/src/types/trait-object.md @@ -24,7 +24,7 @@ Trait objects are written as the keyword `dyn` followed by a set of trait bounds, but with the following restrictions on the trait bounds. r[type.trait-object.constraint] -All traits except the first trait must be auto traits, there may not be more than one +All traits except one trait must be auto traits, there may not be more than one lifetime, and opt-out bounds (e.g. `?Sized`) are not allowed. Furthermore, paths to traits may be parenthesized. From e00926bbea38971f57e72960b9004332bfc16558 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 5 Nov 2024 13:51:51 -0800 Subject: [PATCH 2/2] Update wording to be "not more than one" --- src/types/trait-object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/trait-object.md b/src/types/trait-object.md index 3cd91036e..0c4c7596b 100644 --- a/src/types/trait-object.md +++ b/src/types/trait-object.md @@ -24,7 +24,7 @@ Trait objects are written as the keyword `dyn` followed by a set of trait bounds, but with the following restrictions on the trait bounds. r[type.trait-object.constraint] -All traits except one trait must be auto traits, there may not be more than one +There may not be more than one non-auto trait, no more than one lifetime, and opt-out bounds (e.g. `?Sized`) are not allowed. Furthermore, paths to traits may be parenthesized.