Skip to content

Commit

Permalink
Bless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Oct 16, 2024
1 parent 451e19b commit 6281e9e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 73 deletions.
3 changes: 2 additions & 1 deletion tests/ui/higher-ranked/structually-relate-aliases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type Assoc<'a, T> = <T as ToUnit<'a>>::Unit;
impl<T> Overlap<T> for T {}

impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
//~^ ERROR conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>`
//~^ ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
//~| ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied

fn main() {}
32 changes: 20 additions & 12 deletions tests/ui/higher-ranked/structually-relate-aliases.stderr
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)`
--> $DIR/structually-relate-aliases.rs:13:1
error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
--> $DIR/structually-relate-aliases.rs:13:36
|
LL | impl<T> Overlap<T> for T {}
| ------------------------ first implementation here
LL |
LL | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a (), _)`
| ^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
| ++++++++++++++++++++

error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
--> $DIR/structually-relate-aliases.rs:13:17
|
LL | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `T`
|
help: consider restricting type parameter `T`
|
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
| ++++++++++++++++++++

error: aborting due to 1 previous error
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0119`.
For more information about this error, try `rustc --explain E0277`.
18 changes: 9 additions & 9 deletions tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ fn main() {
}

fn weird0() -> impl Sized + !Sized {}
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~^ ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
fn weird1() -> impl !Sized + Sized {}
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~^ ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
fn weird2() -> impl !Sized {}
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
//~^ ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
//~| ERROR the trait bound `(): !Sized` is not satisfied
Original file line number Diff line number Diff line change
@@ -1,74 +1,56 @@
error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
|
LL | fn weird0() -> impl Sized + !Sized {}
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:15:36
|
LL | fn weird0() -> impl Sized + !Sized {}
| ^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:15:1
|
LL | fn weird0() -> impl Sized + !Sized {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
|
LL | fn weird1() -> impl !Sized + Sized {}
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:19:36
|
LL | fn weird1() -> impl !Sized + Sized {}
| ^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:19:1
|
LL | fn weird1() -> impl !Sized + Sized {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:23:16
|
LL | fn weird2() -> impl !Sized {}
| ^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:23:28
|
LL | fn weird2() -> impl !Sized {}
| ^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the size for values of type `()` cannot be known at compilation time
error[E0277]: the trait bound `(): !Sized` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:23:1
|
LL | fn weird2() -> impl !Sized {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
|
= help: the trait bound `(): !Sized` is not satisfied
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied

error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied
--> $DIR/opaque-type-unsatisfied-bound.rs:12:13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#![feature(negative_bounds, unboxed_closures)]

fn produce() -> impl !Fn<(u32,)> {}
//~^ ERROR expected a `Fn(u32)` closure, found `()`
//~| ERROR expected a `Fn(u32)` closure, found `()`
//~| ERROR expected a `Fn(u32)` closure, found `()`
//~^ ERROR the trait bound `(): !Fn(u32)` is not satisfied
//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied
//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied

fn main() {}
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
error[E0277]: expected a `Fn(u32)` closure, found `()`
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17
|
LL | fn produce() -> impl !Fn<(u32,)> {}
| ^^^^^^^^^^^^^^^^ expected an `Fn(u32)` closure, found `()`
|
= help: the trait bound `(): !Fn(u32)` is not satisfied
| ^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied

error[E0277]: expected a `Fn(u32)` closure, found `()`
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:34
|
LL | fn produce() -> impl !Fn<(u32,)> {}
| ^^ expected an `Fn(u32)` closure, found `()`
|
= help: the trait bound `(): !Fn(u32)` is not satisfied
| ^^ the trait bound `(): !Fn(u32)` is not satisfied

error[E0277]: expected a `Fn(u32)` closure, found `()`
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:1
|
LL | fn produce() -> impl !Fn<(u32,)> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn(u32)` closure, found `()`
|
= help: the trait bound `(): !Fn(u32)` is not satisfied
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied

error: aborting due to 3 previous errors

Expand Down

0 comments on commit 6281e9e

Please sign in to comment.