From 06a6d8127276ac0d3ed116ceaa31c923b89dc0d9 Mon Sep 17 00:00:00 2001 From: Martin Ombura Jr Date: Mon, 14 Mar 2022 08:12:37 +0200 Subject: [PATCH 1/2] some formatting fixes --- text/0255-object-safety.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text/0255-object-safety.md b/text/0255-object-safety.md index bb5284fa331..bf098e251c4 100644 --- a/text/0255-object-safety.md +++ b/text/0255-object-safety.md @@ -33,7 +33,7 @@ SomeTrait for SomeTrait { ... }`, but that seems weird and confusing and rather like boilerplate. Note that the precise mechanism here is out of scope for this RFC). -This is only sound if the trait is /object-safe/. We say a method `m` on trait +This is only sound if the trait is object-safe. We say a method `m` on trait `T` is object-safe if it is legal (in current Rust) to call `x.m(...)` where `x` has type `&T`, i.e., `x` is a trait object. If all methods in `T` are object- safe, then we say `T` is object-safe. @@ -61,8 +61,8 @@ traits. This makes both method call and using trait objects with generic code simpler. The downside is that it makes Rust less flexible, since not all traits can be used to create trait objects. -Software evolution is improved with this proposal: imagine adding a non-object- -safe method to a previously object-safe trait. With this proposal, you would +Software evolution is improved with this proposal: imagine adding a non-object-safe +method to a previously object-safe trait. With this proposal, you would then get errors wherever a trait-object is created. The error would explain why the trait object could not be created and point out exactly which method was to blame and why. Without this proposal, the only errors you would get would be From 5eb9201c57b6311bedb96041620ac7cff82d82a6 Mon Sep 17 00:00:00 2001 From: Martin Ombura Jr Date: Mon, 14 Mar 2022 08:18:44 +0200 Subject: [PATCH 2/2] removes additional spacing between hyphen and word safe --- text/0255-object-safety.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0255-object-safety.md b/text/0255-object-safety.md index bf098e251c4..982d9d24bf9 100644 --- a/text/0255-object-safety.md +++ b/text/0255-object-safety.md @@ -35,8 +35,8 @@ RFC). This is only sound if the trait is object-safe. We say a method `m` on trait `T` is object-safe if it is legal (in current Rust) to call `x.m(...)` where `x` -has type `&T`, i.e., `x` is a trait object. If all methods in `T` are object- -safe, then we say `T` is object-safe. +has type `&T`, i.e., `x` is a trait object. If all methods in `T` are object-safe, +then we say `T` is object-safe. If we ignore this restriction we could allow code such as the following: