Skip to content

Commit 5808971

Browse files
authored
Add ?Sized bound to a supertrait listing in E0038 error documentation
This example failed to compile because of implicit `Sized` bound for `A` parameter that wasn't required by `Trait`.
1 parent 1e1f25e commit 5808971

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/librustc/error_codes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ trait Foo {
259259
This is similar to the second sub-error, but subtler. It happens in situations
260260
like the following:
261261
262-
```compile_fail
263-
trait Super<A> {}
262+
```
263+
trait Super<A: ?Sized> {}
264264
265265
trait Trait: Super<Self> {
266266
}
@@ -275,8 +275,8 @@ impl Trait for Foo {}
275275
Here, the supertrait might have methods as follows:
276276
277277
```
278-
trait Super<A> {
279-
fn get_a(&self) -> A; // note that this is object safe!
278+
trait Super<A: ?Sized> {
279+
fn get_a(&self) -> &A; // note that this is object safe!
280280
}
281281
```
282282

0 commit comments

Comments
 (0)