@@ -257,31 +257,30 @@ fn downstream_impl_of_fundamental_43355() {
257
257
258
258
#[ test]
259
259
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.
264
263
lowering_error ! {
265
264
program {
266
265
#[ upstream] trait Sized { }
267
- #[ upstream] struct str2 { } // str is already known to be !Sized, so make a new str type
266
+ #[ upstream] struct Foo { }
268
267
trait Bar { }
269
- impl Bar for str2 { }
268
+ impl Bar for Foo { }
270
269
impl <T > Bar for T where T : Sized { }
271
270
} error_msg {
272
271
"overlapping impls of trait `Bar`"
273
272
}
274
273
}
275
274
276
275
// 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.
279
278
lowering_success ! {
280
279
program {
281
280
#[ upstream] #[ fundamental] trait Sized { }
282
- #[ upstream] struct str2 { }
281
+ #[ upstream] struct Foo { }
283
282
trait Bar { }
284
- impl Bar for str2 { }
283
+ impl Bar for Foo { }
285
284
impl <T > Bar for T where T : Sized { }
286
285
}
287
286
}
0 commit comments