Skip to content

Commit

Permalink
Update chalk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper committed Feb 12, 2022
1 parent caa10dc commit f718b51
Show file tree
Hide file tree
Showing 45 changed files with 119 additions and 112 deletions.
@@ -1,6 +1,5 @@
// NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`.
// This should hopefully be fixed with Chalk.
// ignore-compare-mode-chalk

#![feature(associated_type_bounds)]

Expand Down
@@ -1,5 +1,5 @@
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:36
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:36
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely
Expand All @@ -11,7 +11,7 @@ LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
| ++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:43
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:43
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<Self as Case1>::C as Iterator>::Item` is not an iterator
Expand All @@ -23,7 +23,7 @@ LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++

error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:93
|
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/associated-type-bounds/trait-params.rs
@@ -1,5 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?)
// ignore-compare-mode-chalk

#![feature(associated_type_bounds)]

Expand Down
1 change: 0 additions & 1 deletion src/test/ui/associated-type-bounds/union-bounds.rs
@@ -1,5 +1,4 @@
// run-pass
// ignore-compare-mode-chalk

#![feature(associated_type_bounds)]
#![feature(untagged_unions)]
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/associated-types/associated-types-stream.rs
@@ -1,8 +1,6 @@
// run-pass
// Test references to the trait `Stream` in the bounds for associated
// types defined on `Stream`. Issue #20551.
// ignore-compare-mode-chalk


trait Stream {
type Car;
Expand Down
@@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
trait Z<'a, T: ?Sized>
where
T: Z<'a, u16>,
Expand Down
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
|
LL | T: Z<'a, u16>,
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
|
note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
Expand All @@ -14,13 +14,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
|
LL | T: Z<'a, u16>,
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
|
note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
Expand All @@ -29,13 +29,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z`

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-2.rs:16:14
--> $DIR/hr-associated-type-bound-param-2.rs:15:14
|
LL | type W = str;
| ^^^ the trait `Clone` is not implemented for `str`
|
note: required by a bound in `Z`
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
|
LL | trait Z<'a, T: ?Sized>
| - required by a bound in this
Expand Down
@@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
trait Cycle: Sized {
type Next: Cycle<Next = Self>;
}
Expand Down
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:27:14
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`
|
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:18:45
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
Expand All @@ -14,13 +14,13 @@ LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X`

error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/hr-associated-type-bound-param-5.rs:32:14
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
|
LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str`
|
note: required by a bound in `X`
--> $DIR/hr-associated-type-bound-param-5.rs:18:45
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
|
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/associated-types/issue-50301.rs
@@ -1,6 +1,5 @@
// Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301
// check-pass
// ignore-compare-mode-chalk
trait Trait
where
for<'a> &'a Self::IntoIter: IntoIterator<Item = u32>,
Expand Down
6 changes: 6 additions & 0 deletions src/test/ui/chalkify/assert.rs
@@ -0,0 +1,6 @@
// run-pass
// compile-flags: -Z chalk

fn main() {
assert_eq!(1, 1);
}
3 changes: 1 addition & 2 deletions src/test/ui/chalkify/println.rs
Expand Up @@ -2,6 +2,5 @@
// compile-flags: -Z chalk

fn main() {
// FIXME(chalk): Require `RegionOutlives`/`TypeOutlives`/`Subtype` support
//println!("hello");
println!("hello");
}
3 changes: 1 addition & 2 deletions src/test/ui/chalkify/trait-objects.rs
Expand Up @@ -5,8 +5,7 @@ use std::fmt::Display;

fn main() {
let d: &dyn Display = &mut 3;
// FIXME(chalk) should be able to call d.to_string() as well, but doing so
// requires Chalk to be able to prove trait object well-formed goals.
d.to_string();
(&d).to_string();
let f: &dyn Fn(i32) -> _ = &|x| x + x;
f(2);
Expand Down
9 changes: 9 additions & 0 deletions src/test/ui/consts/const-eval/ub-nonnull.chalk.64bit.stderr
@@ -0,0 +1,9 @@
error[E0284]: type annotations needed: cannot satisfy `<usize as SliceIndex<[u8]>>::Output == _`
--> $DIR/ub-nonnull.rs:19:30
|
LL | let out_of_bounds_ptr = &ptr[255];
| ^^^^^^^^ cannot satisfy `<usize as SliceIndex<[u8]>>::Output == _`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0284`.
9 changes: 9 additions & 0 deletions src/test/ui/consts/const-eval/ub-wide-ptr.chalk.64bit.stderr
@@ -0,0 +1,9 @@
error[E0282]: type annotations needed
--> $DIR/ub-wide-ptr.rs:90:67
|
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
| ^^^^^^^^^^^^^^ cannot infer type for type parameter `U` declared on the function `transmute`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0282`.
1 change: 0 additions & 1 deletion src/test/ui/deriving/deriving-associated-types.rs
@@ -1,5 +1,4 @@
// run-pass
// ignore-compare-mode-chalk
pub trait DeclaredTrait {
type Type;
}
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/impl-trait/example-calendar.rs
@@ -1,5 +1,4 @@
// run-pass
// ignore-compare-mode-chalk

#![feature(fn_traits,
step_trait,
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/impl-trait/issue-55872-2.rs
@@ -1,5 +1,4 @@
// edition:2018
// ignore-compare-mode-chalk

#![feature(type_alias_impl_trait)]

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/impl-trait/issue-55872-2.stderr
@@ -1,11 +1,11 @@
error[E0277]: the trait bound `impl Future<Output = [async output]>: Copy` is not satisfied
--> $DIR/issue-55872-2.rs:14:20
--> $DIR/issue-55872-2.rs:13:20
|
LL | fn foo<T>() -> Self::E {
| ^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = [async output]>`

error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872-2.rs:14:28
--> $DIR/issue-55872-2.rs:13:28
|
LL | fn foo<T>() -> Self::E {
| ____________________________^
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/impl-trait/issue-55872.rs
@@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)]

pub trait Bar {
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/impl-trait/issue-55872.stderr
@@ -1,5 +1,5 @@
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-55872.rs:13:28
--> $DIR/issue-55872.rs:12:28
|
LL | fn foo<T>() -> Self::E {
| ____________________________^
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/impl-trait/issues/issue-65581.rs
@@ -1,4 +1,5 @@
// check-pass
// ignore-compare-mode-chalk

#![allow(dead_code)]

Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/issues/issue-23122-1.rs
@@ -1,10 +1,10 @@
// ignore-compare-mode-chalk

trait Next {
type Next: Next;
}

struct GetNext<T: Next> { t: T }
struct GetNext<T: Next> {
t: T,
}

impl<T: Next> Next for GetNext<T> {
type Next = <GetNext<T> as Next>::Next;
Expand Down
5 changes: 3 additions & 2 deletions src/test/ui/issues/issue-23122-2.rs
@@ -1,9 +1,10 @@
// ignore-compare-mode-chalk
trait Next {
type Next: Next;
}

struct GetNext<T: Next> { t: T }
struct GetNext<T: Next> {
t: T,
}

impl<T: Next> Next for GetNext<T> {
type Next = <GetNext<T::Next> as Next>::Next;
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-23122-2.stderr
@@ -1,12 +1,12 @@
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
--> $DIR/issue-23122-2.rs:9:17
--> $DIR/issue-23122-2.rs:10:17
|
LL | type Next = <GetNext<T::Next> as Next>::Next;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`)
note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
--> $DIR/issue-23122-2.rs:8:15
--> $DIR/issue-23122-2.rs:9:15
|
LL | impl<T: Next> Next for GetNext<T> {
| ^^^^ ^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/issues/issue-28561.rs
@@ -1,5 +1,4 @@
// check-pass
// ignore-compare-mode-chalk
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct Array<T> {
f00: [T; 00],
Expand Down
16 changes: 10 additions & 6 deletions src/test/ui/issues/issue-33187.rs
@@ -1,10 +1,15 @@
// run-pass
// ignore-compare-mode-chalk

struct Foo<A: Repr>(<A as Repr>::Data);

impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy { }
impl<A> Clone for Foo<A> where <A as Repr>::Data: Clone {
fn clone(&self) -> Self { Foo(self.0.clone()) }
impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy {}
impl<A> Clone for Foo<A>
where
<A as Repr>::Data: Clone,
{
fn clone(&self) -> Self {
Foo(self.0.clone())
}
}

trait Repr {
Expand All @@ -15,5 +20,4 @@ impl<A> Repr for A {
type Data = u32;
}

fn main() {
}
fn main() {}
1 change: 0 additions & 1 deletion src/test/ui/issues/issue-37051.rs
@@ -1,5 +1,4 @@
// check-pass
// ignore-compare-mode-chalk

#![feature(associated_type_defaults)]

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-55796.nll.stderr
@@ -1,5 +1,5 @@
error: lifetime may not live long enough
--> $DIR/issue-55796.rs:18:9
--> $DIR/issue-55796.rs:16:9
|
LL | pub trait Graph<'a> {
| -- lifetime `'a` defined here
Expand All @@ -8,7 +8,7 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`

error: lifetime may not live long enough
--> $DIR/issue-55796.rs:23:9
--> $DIR/issue-55796.rs:21:9
|
LL | pub trait Graph<'a> {
| -- lifetime `'a` defined here
Expand Down
6 changes: 2 additions & 4 deletions src/test/ui/issues/issue-55796.rs
@@ -1,5 +1,3 @@
// ignore-compare-mode-chalk

pub trait EdgeTrait<N> {
fn target(&self) -> N;
}
Expand All @@ -16,12 +14,12 @@ pub trait Graph<'a> {

fn out_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
Box::new(self.out_edges(u).map(|e| e.target()))
//~^ ERROR cannot infer
//~^ ERROR cannot infer
}

fn in_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
Box::new(self.in_edges(u).map(|e| e.target()))
//~^ ERROR cannot infer
//~^ ERROR cannot infer
}
}

Expand Down

0 comments on commit f718b51

Please sign in to comment.