Skip to content

Commit 7585475

Browse files
committed
Replace str with Foo in the coherence::fundamental_traits test
1 parent d6eebe7 commit 7585475

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

tests/test/coherence.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -257,31 +257,30 @@ fn downstream_impl_of_fundamental_43355() {
257257

258258
#[test]
259259
fn fundamental_traits() {
260-
// We want to enable negative reasoning about some traits. For example, consider the str type.
261-
// We know that str is never going to be Sized and we have made a decision to allow people to
262-
// depend on that. The following two impls are rejected as overlapping despite the fact that we
263-
// know that str will never be Sized.
260+
// We want to enable negative reasoning about some traits. For example, assume we have some
261+
// "Foo" type which we know is never going to be Sized (ex. str). The following two impls are
262+
// rejected as overlapping despite the fact that we know that Foo will never be Sized.
264263
lowering_error! {
265264
program {
266265
#[upstream] trait Sized { }
267-
#[upstream] struct str2 { } // str is already known to be !Sized, so make a new str type
266+
#[upstream] struct Foo { }
268267
trait Bar { }
269-
impl Bar for str2 { }
268+
impl Bar for Foo { }
270269
impl<T> Bar for T where T: Sized { }
271270
} error_msg {
272271
"overlapping impls of trait `Bar`"
273272
}
274273
}
275274

276275
// If we make Sized fundamental, we're telling the Rust compiler that it can reason negatively
277-
// about it. That means that `not { str: Sized }` is provable. With that change, these two
278-
// impls are now valid.
276+
// about it. That means that `not { Foo: Sized }` is provable. With that change, these two impls
277+
// are now valid.
279278
lowering_success! {
280279
program {
281280
#[upstream] #[fundamental] trait Sized { }
282-
#[upstream] struct str2 { }
281+
#[upstream] struct Foo { }
283282
trait Bar { }
284-
impl Bar for str2 { }
283+
impl Bar for Foo { }
285284
impl<T> Bar for T where T: Sized { }
286285
}
287286
}

0 commit comments

Comments
 (0)