Skip to content

Commit f718b51

Browse files
committed
Update chalk tests
1 parent caa10dc commit f718b51

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+119
-112
lines changed

src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`.
22
// This should hopefully be fixed with Chalk.
3-
// ignore-compare-mode-chalk
43

54
#![feature(associated_type_bounds)]
65

src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr

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

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

2525
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
26-
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
26+
--> $DIR/bad-bounds-on-assoc-in-trait.rs:26:93
2727
|
2828
LL | type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
2929
| ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely

src/test/ui/associated-type-bounds/trait-params.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// build-pass (FIXME(62277): could be check-pass?)
2-
// ignore-compare-mode-chalk
32

43
#![feature(associated_type_bounds)]
54

src/test/ui/associated-type-bounds/union-bounds.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// ignore-compare-mode-chalk
32

43
#![feature(associated_type_bounds)]
54
#![feature(untagged_unions)]

src/test/ui/associated-types/associated-types-stream.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// run-pass
22
// Test references to the trait `Stream` in the bounds for associated
33
// types defined on `Stream`. Issue #20551.
4-
// ignore-compare-mode-chalk
5-
64

75
trait Stream {
86
type Car;

src/test/ui/associated-types/hr-associated-type-bound-param-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-compare-mode-chalk
21
trait Z<'a, T: ?Sized>
32
where
43
T: Z<'a, u16>,

src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `str: Clone` is not satisfied
2-
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
2+
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
33
|
44
LL | T: Z<'a, u16>,
55
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
66
|
77
note: required by a bound in `Z`
8-
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
8+
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
99
|
1010
LL | trait Z<'a, T: ?Sized>
1111
| - required by a bound in this
@@ -14,13 +14,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
1414
| ^^^^^ required by this bound in `Z`
1515

1616
error[E0277]: the trait bound `str: Clone` is not satisfied
17-
--> $DIR/hr-associated-type-bound-param-2.rs:4:8
17+
--> $DIR/hr-associated-type-bound-param-2.rs:3:8
1818
|
1919
LL | T: Z<'a, u16>,
2020
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
2121
|
2222
note: required by a bound in `Z`
23-
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
23+
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
2424
|
2525
LL | trait Z<'a, T: ?Sized>
2626
| - required by a bound in this
@@ -29,13 +29,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
2929
| ^^^^^ required by this bound in `Z`
3030

3131
error[E0277]: the trait bound `str: Clone` is not satisfied
32-
--> $DIR/hr-associated-type-bound-param-2.rs:16:14
32+
--> $DIR/hr-associated-type-bound-param-2.rs:15:14
3333
|
3434
LL | type W = str;
3535
| ^^^ the trait `Clone` is not implemented for `str`
3636
|
3737
note: required by a bound in `Z`
38-
--> $DIR/hr-associated-type-bound-param-2.rs:7:35
38+
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
3939
|
4040
LL | trait Z<'a, T: ?Sized>
4141
| - required by a bound in this

src/test/ui/associated-types/hr-associated-type-bound-param-5.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-compare-mode-chalk
21
trait Cycle: Sized {
32
type Next: Cycle<Next = Self>;
43
}

src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `str: Clone` is not satisfied
2-
--> $DIR/hr-associated-type-bound-param-5.rs:27:14
2+
--> $DIR/hr-associated-type-bound-param-5.rs:26:14
33
|
44
LL | type U = str;
55
| ^^^ the trait `Clone` is not implemented for `str`
66
|
77
note: required by a bound in `X`
8-
--> $DIR/hr-associated-type-bound-param-5.rs:18:45
8+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
99
|
1010
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
1111
| - required by a bound in this
@@ -14,13 +14,13 @@ LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
1414
| ^^^^^ required by this bound in `X`
1515

1616
error[E0277]: the trait bound `str: Clone` is not satisfied
17-
--> $DIR/hr-associated-type-bound-param-5.rs:32:14
17+
--> $DIR/hr-associated-type-bound-param-5.rs:31:14
1818
|
1919
LL | type U = str;
2020
| ^^^ the trait `Clone` is not implemented for `str`
2121
|
2222
note: required by a bound in `X`
23-
--> $DIR/hr-associated-type-bound-param-5.rs:18:45
23+
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
2424
|
2525
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
2626
| - required by a bound in this

src/test/ui/associated-types/issue-50301.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301
22
// check-pass
3-
// ignore-compare-mode-chalk
43
trait Trait
54
where
65
for<'a> &'a Self::IntoIter: IntoIterator<Item = u32>,

src/test/ui/chalkify/assert.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// run-pass
2+
// compile-flags: -Z chalk
3+
4+
fn main() {
5+
assert_eq!(1, 1);
6+
}

src/test/ui/chalkify/println.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
// compile-flags: -Z chalk
33

44
fn main() {
5-
// FIXME(chalk): Require `RegionOutlives`/`TypeOutlives`/`Subtype` support
6-
//println!("hello");
5+
println!("hello");
76
}

src/test/ui/chalkify/trait-objects.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ use std::fmt::Display;
55

66
fn main() {
77
let d: &dyn Display = &mut 3;
8-
// FIXME(chalk) should be able to call d.to_string() as well, but doing so
9-
// requires Chalk to be able to prove trait object well-formed goals.
8+
d.to_string();
109
(&d).to_string();
1110
let f: &dyn Fn(i32) -> _ = &|x| x + x;
1211
f(2);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0284]: type annotations needed: cannot satisfy `<usize as SliceIndex<[u8]>>::Output == _`
2+
--> $DIR/ub-nonnull.rs:19:30
3+
|
4+
LL | let out_of_bounds_ptr = &ptr[255];
5+
| ^^^^^^^^ cannot satisfy `<usize as SliceIndex<[u8]>>::Output == _`
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0284`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/ub-wide-ptr.rs:90:67
3+
|
4+
LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
5+
| ^^^^^^^^^^^^^^ cannot infer type for type parameter `U` declared on the function `transmute`
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0282`.

src/test/ui/deriving/deriving-associated-types.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// ignore-compare-mode-chalk
32
pub trait DeclaredTrait {
43
type Type;
54
}

src/test/ui/impl-trait/example-calendar.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// run-pass
2-
// ignore-compare-mode-chalk
32

43
#![feature(fn_traits,
54
step_trait,

src/test/ui/impl-trait/issue-55872-2.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// edition:2018
2-
// ignore-compare-mode-chalk
32

43
#![feature(type_alias_impl_trait)]
54

src/test/ui/impl-trait/issue-55872-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0277]: the trait bound `impl Future<Output = [async output]>: Copy` is not satisfied
2-
--> $DIR/issue-55872-2.rs:14:20
2+
--> $DIR/issue-55872-2.rs:13:20
33
|
44
LL | fn foo<T>() -> Self::E {
55
| ^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = [async output]>`
66

77
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
8-
--> $DIR/issue-55872-2.rs:14:28
8+
--> $DIR/issue-55872-2.rs:13:28
99
|
1010
LL | fn foo<T>() -> Self::E {
1111
| ____________________________^

src/test/ui/impl-trait/issue-55872.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// ignore-compare-mode-chalk
21
#![feature(type_alias_impl_trait)]
32

43
pub trait Bar {

src/test/ui/impl-trait/issue-55872.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
2-
--> $DIR/issue-55872.rs:13:28
2+
--> $DIR/issue-55872.rs:12:28
33
|
44
LL | fn foo<T>() -> Self::E {
55
| ____________________________^

src/test/ui/impl-trait/issues/issue-65581.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// check-pass
2+
// ignore-compare-mode-chalk
23

34
#![allow(dead_code)]
45

src/test/ui/issues/issue-23122-1.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// ignore-compare-mode-chalk
2-
31
trait Next {
42
type Next: Next;
53
}
64

7-
struct GetNext<T: Next> { t: T }
5+
struct GetNext<T: Next> {
6+
t: T,
7+
}
88

99
impl<T: Next> Next for GetNext<T> {
1010
type Next = <GetNext<T> as Next>::Next;

src/test/ui/issues/issue-23122-2.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
// ignore-compare-mode-chalk
21
trait Next {
32
type Next: Next;
43
}
54

6-
struct GetNext<T: Next> { t: T }
5+
struct GetNext<T: Next> {
6+
t: T,
7+
}
78

89
impl<T: Next> Next for GetNext<T> {
910
type Next = <GetNext<T::Next> as Next>::Next;

src/test/ui/issues/issue-23122-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
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`
2-
--> $DIR/issue-23122-2.rs:9:17
2+
--> $DIR/issue-23122-2.rs:10:17
33
|
44
LL | type Next = <GetNext<T::Next> as Next>::Next;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_23122_2`)
88
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>`
9-
--> $DIR/issue-23122-2.rs:8:15
9+
--> $DIR/issue-23122-2.rs:9:15
1010
|
1111
LL | impl<T: Next> Next for GetNext<T> {
1212
| ^^^^ ^^^^^^^^^^

src/test/ui/issues/issue-28561.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// check-pass
2-
// ignore-compare-mode-chalk
32
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
43
struct Array<T> {
54
f00: [T; 00],

src/test/ui/issues/issue-33187.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// run-pass
2-
// ignore-compare-mode-chalk
2+
33
struct Foo<A: Repr>(<A as Repr>::Data);
44

5-
impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy { }
6-
impl<A> Clone for Foo<A> where <A as Repr>::Data: Clone {
7-
fn clone(&self) -> Self { Foo(self.0.clone()) }
5+
impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy {}
6+
impl<A> Clone for Foo<A>
7+
where
8+
<A as Repr>::Data: Clone,
9+
{
10+
fn clone(&self) -> Self {
11+
Foo(self.0.clone())
12+
}
813
}
914

1015
trait Repr {
@@ -15,5 +20,4 @@ impl<A> Repr for A {
1520
type Data = u32;
1621
}
1722

18-
fn main() {
19-
}
23+
fn main() {}

src/test/ui/issues/issue-37051.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
// check-pass
2-
// ignore-compare-mode-chalk
32

43
#![feature(associated_type_defaults)]
54

src/test/ui/issues/issue-55796.nll.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/issue-55796.rs:18:9
2+
--> $DIR/issue-55796.rs:16:9
33
|
44
LL | pub trait Graph<'a> {
55
| -- lifetime `'a` defined here
@@ -8,7 +8,7 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
99

1010
error: lifetime may not live long enough
11-
--> $DIR/issue-55796.rs:23:9
11+
--> $DIR/issue-55796.rs:21:9
1212
|
1313
LL | pub trait Graph<'a> {
1414
| -- lifetime `'a` defined here

src/test/ui/issues/issue-55796.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// ignore-compare-mode-chalk
2-
31
pub trait EdgeTrait<N> {
42
fn target(&self) -> N;
53
}
@@ -16,12 +14,12 @@ pub trait Graph<'a> {
1614

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

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

0 commit comments

Comments
 (0)