Update chalk tests

This commit is contained in:
Matthew Jasper 2022-02-09 10:19:31 +00:00
parent caa10dc572
commit f718b51690
45 changed files with 119 additions and 112 deletions

View File

@ -1,6 +1,5 @@
// NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`. // NOTE: rustc cannot currently handle bounds of the form `for<'a> <Foo as Bar<'a>>::Assoc: Baz`.
// This should hopefully be fixed with Chalk. // This should hopefully be fixed with Chalk.
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]

View File

@ -1,5 +1,5 @@
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be sent between threads safely 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>; 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 | ^^^^ `<<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 {
| ++++++++++++++++++++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator 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>; 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 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<<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 {
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely 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>; 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 | ^^^^ `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely

View File

@ -1,5 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?) // build-pass (FIXME(62277): could be check-pass?)
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]

View File

@ -1,5 +1,4 @@
// run-pass // run-pass
// ignore-compare-mode-chalk
#![feature(associated_type_bounds)] #![feature(associated_type_bounds)]
#![feature(untagged_unions)] #![feature(untagged_unions)]

View File

@ -1,8 +1,6 @@
// run-pass // run-pass
// Test references to the trait `Stream` in the bounds for associated // Test references to the trait `Stream` in the bounds for associated
// types defined on `Stream`. Issue #20551. // types defined on `Stream`. Issue #20551.
// ignore-compare-mode-chalk
trait Stream { trait Stream {
type Car; type Car;

View File

@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
trait Z<'a, T: ?Sized> trait Z<'a, T: ?Sized>
where where
T: Z<'a, u16>, T: Z<'a, u16>,

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `str: Clone` is not satisfied 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>, LL | T: Z<'a, u16>,
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str` | ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `Z` 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> LL | trait Z<'a, T: ?Sized>
| - required by a bound in this | - required by a bound in this
@ -14,13 +14,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z` | ^^^^^ required by this bound in `Z`
error[E0277]: the trait bound `str: Clone` is not satisfied 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>, LL | T: Z<'a, u16>,
| ^^^^^^^^^^ the trait `Clone` is not implemented for `str` | ^^^^^^^^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `Z` 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> LL | trait Z<'a, T: ?Sized>
| - required by a bound in this | - required by a bound in this
@ -29,13 +29,13 @@ LL | for<'b> <T as Z<'b, u16>>::W: Clone,
| ^^^^^ required by this bound in `Z` | ^^^^^ required by this bound in `Z`
error[E0277]: the trait bound `str: Clone` is not satisfied 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; LL | type W = str;
| ^^^ the trait `Clone` is not implemented for `str` | ^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `Z` 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> LL | trait Z<'a, T: ?Sized>
| - required by a bound in this | - required by a bound in this

View File

@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
trait Cycle: Sized { trait Cycle: Sized {
type Next: Cycle<Next = Self>; type Next: Cycle<Next = Self>;
} }

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `str: Clone` is not satisfied 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; LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str` | ^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `X` 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>> LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this | - required by a bound in this
@ -14,13 +14,13 @@ LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
| ^^^^^ required by this bound in `X` | ^^^^^ required by this bound in `X`
error[E0277]: the trait bound `str: Clone` is not satisfied 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; LL | type U = str;
| ^^^ the trait `Clone` is not implemented for `str` | ^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `X` 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>> LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
| - required by a bound in this | - required by a bound in this

View File

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

View File

@ -0,0 +1,6 @@
// run-pass
// compile-flags: -Z chalk
fn main() {
assert_eq!(1, 1);
}

View File

@ -2,6 +2,5 @@
// compile-flags: -Z chalk // compile-flags: -Z chalk
fn main() { fn main() {
// FIXME(chalk): Require `RegionOutlives`/`TypeOutlives`/`Subtype` support println!("hello");
//println!("hello");
} }

View File

@ -5,8 +5,7 @@ use std::fmt::Display;
fn main() { fn main() {
let d: &dyn Display = &mut 3; let d: &dyn Display = &mut 3;
// FIXME(chalk) should be able to call d.to_string() as well, but doing so d.to_string();
// 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; let f: &dyn Fn(i32) -> _ = &|x| x + x;
f(2); f(2);

View File

@ -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`.

View File

@ -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`.

View File

@ -1,5 +1,4 @@
// run-pass // run-pass
// ignore-compare-mode-chalk
pub trait DeclaredTrait { pub trait DeclaredTrait {
type Type; type Type;
} }

View File

@ -1,5 +1,4 @@
// run-pass // run-pass
// ignore-compare-mode-chalk
#![feature(fn_traits, #![feature(fn_traits,
step_trait, step_trait,

View File

@ -1,5 +1,4 @@
// edition:2018 // edition:2018
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View File

@ -1,11 +1,11 @@
error[E0277]: the trait bound `impl Future<Output = [async output]>: Copy` is not satisfied 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 { LL | fn foo<T>() -> Self::E {
| ^^^^^^^ the trait `Copy` is not implemented for `impl Future<Output = [async output]>` | ^^^^^^^ 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 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 { LL | fn foo<T>() -> Self::E {
| ____________________________^ | ____________________________^

View File

@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
pub trait Bar { pub trait Bar {

View File

@ -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 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 { LL | fn foo<T>() -> Self::E {
| ____________________________^ | ____________________________^

View File

@ -1,4 +1,5 @@
// check-pass // check-pass
// ignore-compare-mode-chalk
#![allow(dead_code)] #![allow(dead_code)]

View File

@ -1,10 +1,10 @@
// ignore-compare-mode-chalk
trait Next { trait Next {
type Next: Next; type Next: Next;
} }
struct GetNext<T: Next> { t: T } struct GetNext<T: Next> {
t: T,
}
impl<T: Next> Next for GetNext<T> { impl<T: Next> Next for GetNext<T> {
type Next = <GetNext<T> as Next>::Next; type Next = <GetNext<T> as Next>::Next;

View File

@ -1,9 +1,10 @@
// ignore-compare-mode-chalk
trait Next { trait Next {
type Next: Next; type Next: Next;
} }
struct GetNext<T: Next> { t: T } struct GetNext<T: Next> {
t: T,
}
impl<T: Next> Next for GetNext<T> { impl<T: Next> Next for GetNext<T> {
type Next = <GetNext<T::Next> as Next>::Next; type Next = <GetNext<T::Next> as Next>::Next;

View File

@ -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` 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; 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`) = 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>` 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> { LL | impl<T: Next> Next for GetNext<T> {
| ^^^^ ^^^^^^^^^^ | ^^^^ ^^^^^^^^^^

View File

@ -1,5 +1,4 @@
// check-pass // check-pass
// ignore-compare-mode-chalk
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] #[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
struct Array<T> { struct Array<T> {
f00: [T; 00], f00: [T; 00],

View File

@ -1,10 +1,15 @@
// run-pass // run-pass
// ignore-compare-mode-chalk
struct Foo<A: Repr>(<A as Repr>::Data); struct Foo<A: Repr>(<A as Repr>::Data);
impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy { } impl<A> Copy for Foo<A> where <A as Repr>::Data: Copy {}
impl<A> Clone for Foo<A> where <A as Repr>::Data: Clone { impl<A> Clone for Foo<A>
fn clone(&self) -> Self { Foo(self.0.clone()) } where
<A as Repr>::Data: Clone,
{
fn clone(&self) -> Self {
Foo(self.0.clone())
}
} }
trait Repr { trait Repr {
@ -15,5 +20,4 @@ impl<A> Repr for A {
type Data = u32; type Data = u32;
} }
fn main() { fn main() {}
}

View File

@ -1,5 +1,4 @@
// check-pass // check-pass
// ignore-compare-mode-chalk
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]

View File

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

View File

@ -1,5 +1,3 @@
// ignore-compare-mode-chalk
pub trait EdgeTrait<N> { pub trait EdgeTrait<N> {
fn target(&self) -> N; fn target(&self) -> N;
} }
@ -16,12 +14,12 @@ pub trait Graph<'a> {
fn out_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> { fn out_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
Box::new(self.out_edges(u).map(|e| e.target())) 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>> { fn in_neighbors(&'a self, u: &Self::Node) -> Box<dyn Iterator<Item = Self::Node>> {
Box::new(self.in_edges(u).map(|e| e.target())) Box::new(self.in_edges(u).map(|e| e.target()))
//~^ ERROR cannot infer //~^ ERROR cannot infer
} }
} }

View File

@ -1,22 +1,22 @@
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/issue-55796.rs:18:9 --> $DIR/issue-55796.rs:16:9
| |
LL | Box::new(self.out_edges(u).map(|e| e.target())) LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: first, the lifetime cannot outlive the lifetime `'a` as defined here... note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
--> $DIR/issue-55796.rs:7:17 --> $DIR/issue-55796.rs:5:17
| |
LL | pub trait Graph<'a> { LL | pub trait Graph<'a> {
| ^^ | ^^
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:18:40: 18:54]>` will meet its required lifetime bounds note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:16:40: 16:54]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:18:9 --> $DIR/issue-55796.rs:16:9
| |
LL | Box::new(self.out_edges(u).map(|e| e.target())) LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime... = note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-55796.rs:18:9 --> $DIR/issue-55796.rs:16:9
| |
LL | Box::new(self.out_edges(u).map(|e| e.target())) LL | Box::new(self.out_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -24,24 +24,24 @@ LL | Box::new(self.out_edges(u).map(|e| e.target()))
found `Box<dyn Iterator<Item = <Self as Graph<'a>>::Node>>` found `Box<dyn Iterator<Item = <Self as Graph<'a>>::Node>>`
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/issue-55796.rs:23:9 --> $DIR/issue-55796.rs:21:9
| |
LL | Box::new(self.in_edges(u).map(|e| e.target())) LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
note: first, the lifetime cannot outlive the lifetime `'a` as defined here... note: first, the lifetime cannot outlive the lifetime `'a` as defined here...
--> $DIR/issue-55796.rs:7:17 --> $DIR/issue-55796.rs:5:17
| |
LL | pub trait Graph<'a> { LL | pub trait Graph<'a> {
| ^^ | ^^
note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:23:39: 23:53]>` will meet its required lifetime bounds note: ...so that the type `Map<<Self as Graph<'a>>::EdgesIter, [closure@$DIR/issue-55796.rs:21:39: 21:53]>` will meet its required lifetime bounds
--> $DIR/issue-55796.rs:23:9 --> $DIR/issue-55796.rs:21:9
| |
LL | Box::new(self.in_edges(u).map(|e| e.target())) LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: but, the lifetime must be valid for the static lifetime... = note: but, the lifetime must be valid for the static lifetime...
note: ...so that the types are compatible note: ...so that the types are compatible
--> $DIR/issue-55796.rs:23:9 --> $DIR/issue-55796.rs:21:9
| |
LL | Box::new(self.in_edges(u).map(|e| e.target())) LL | Box::new(self.in_edges(u).map(|e| e.target()))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,6 +1,5 @@
// build-pass // build-pass
// ignore-tidy-filelength // ignore-tidy-filelength
// ignore-compare-mode-chalk
#![crate_type = "rlib"] #![crate_type = "rlib"]
fn banana(v: &str) -> u32 { fn banana(v: &str) -> u32 {

View File

@ -1,16 +1,14 @@
// Regression test for #53789. // Regression test for #53789.
// //
// check-pass // check-pass
// ignore-compare-mode-chalk
use std::cmp::Ord;
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::ops::Range; use std::ops::Range;
use std::cmp::Ord;
macro_rules! valuetree { macro_rules! valuetree {
() => { () => {
type ValueTree = type ValueTree = <Self::Strategy as $crate::Strategy>::Value;
<Self::Strategy as $crate::Strategy>::Value;
}; };
} }
@ -41,7 +39,9 @@ macro_rules! product_type {
macro_rules! default { macro_rules! default {
($type: ty, $val: expr) => { ($type: ty, $val: expr) => {
impl Default for $type { impl Default for $type {
fn default() -> Self { $val.into() } fn default() -> Self {
$val.into()
}
} }
}; };
} }
@ -90,21 +90,17 @@ trait ValueTree {
} }
trait Strategy { trait Strategy {
type Value : ValueTree; type Value: ValueTree;
} }
#[derive(Clone)] #[derive(Clone)]
struct VecStrategy<T : Strategy> { struct VecStrategy<T: Strategy> {
element: T, element: T,
size: Range<usize>, size: Range<usize>,
} }
fn vec<T : Strategy>(element: T, size: Range<usize>) fn vec<T: Strategy>(element: T, size: Range<usize>) -> VecStrategy<T> {
-> VecStrategy<T> { VecStrategy { element: element, size: size }
VecStrategy {
element: element,
size: size,
}
} }
type ValueFor<S> = <<S as Strategy>::Value as ValueTree>::Value; type ValueFor<S> = <<S as Strategy>::Value as ValueTree>::Value;
@ -124,7 +120,6 @@ type StrategyType<'a, A> = <A as Arbitrary<'a>>::Strategy;
struct SizeBounds(Range<usize>); struct SizeBounds(Range<usize>);
default!(SizeBounds, 0..100); default!(SizeBounds, 0..100);
impl From<Range<usize>> for SizeBounds { impl From<Range<usize>> for SizeBounds {
fn from(high: Range<usize>) -> Self { fn from(high: Range<usize>) -> Self {
unimplemented!() unimplemented!()
@ -137,24 +132,26 @@ impl From<SizeBounds> for Range<usize> {
} }
} }
fn any_with<'a, A: Arbitrary<'a>>(args: A::Parameters) -> StrategyType<'a, A> {
fn any_with<'a, A: Arbitrary<'a>>(args: A::Parameters)
-> StrategyType<'a, A> {
unimplemented!() unimplemented!()
} }
impl<K: ValueTree, V: ValueTree> Strategy for (K, V) where impl<K: ValueTree, V: ValueTree> Strategy for (K, V)
<K as ValueTree>::Value: Ord { where
<K as ValueTree>::Value: Ord,
{
type Value = TupleValueTree<(K, V)>; type Value = TupleValueTree<(K, V)>;
} }
impl<K: ValueTree, V: ValueTree> ValueTree for TupleValueTree<(K, V)> where impl<K: ValueTree, V: ValueTree> ValueTree for TupleValueTree<(K, V)>
<K as ValueTree>::Value: Ord { where
<K as ValueTree>::Value: Ord,
{
type Value = BTreeMapValueTree<K, V>; type Value = BTreeMapValueTree<K, V>;
} }
#[derive(Clone)] #[derive(Clone)]
struct VecValueTree<T : ValueTree> { struct VecValueTree<T: ValueTree> {
elements: Vec<T>, elements: Vec<T>,
} }
@ -185,8 +182,8 @@ impl<'a, A, B> Arbitrary<'a> for BTreeMap<A, B>
where where
A: Arbitrary<'static> + Ord, A: Arbitrary<'static> + Ord,
B: Arbitrary<'static>, B: Arbitrary<'static>,
StrategyFor<A>: 'static, StrategyFor<A>: 'static,
StrategyFor<B>: 'static, StrategyFor<B>: 'static,
{ {
valuetree!(); valuetree!();
type Parameters = RangedParams2<A::Parameters, B::Parameters>; type Parameters = RangedParams2<A::Parameters, B::Parameters>;
@ -208,10 +205,14 @@ mapfn! {
} }
} }
fn btree_map<K : Strategy + 'static, V : Strategy + 'static> fn btree_map<K: Strategy + 'static, V: Strategy + 'static>(
(key: K, value: V, size: Range<usize>) key: K,
-> BTreeMapStrategy<K, V> value: V,
where ValueFor<K> : Ord { size: Range<usize>,
) -> BTreeMapStrategy<K, V>
where
ValueFor<K>: Ord,
{
unimplemented!() unimplemented!()
} }
@ -245,4 +246,4 @@ mod statics {
} }
} }
fn main() { } fn main() {}

View File

@ -1,6 +1,5 @@
// Check that we check that default associated types satisfy the required // Check that we check that default associated types satisfy the required
// bounds on them. // bounds on them.
// ignore-compare-mode-chalk
#![feature(specialization)] #![feature(specialization)]
//~^ WARNING `specialization` is incomplete //~^ WARNING `specialization` is incomplete

View File

@ -1,5 +1,5 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deafult-associated-type-bound-1.rs:5:12 --> $DIR/default-associated-type-bound-1.rs:4:12
| |
LL | #![feature(specialization)] LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -9,13 +9,13 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete = help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: the trait bound `str: Clone` is not satisfied error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/deafult-associated-type-bound-1.rs:19:22 --> $DIR/default-associated-type-bound-1.rs:18:22
| |
LL | default type U = str; LL | default type U = str;
| ^^^ the trait `Clone` is not implemented for `str` | ^^^ the trait `Clone` is not implemented for `str`
| |
note: required by a bound in `X::U` note: required by a bound in `X::U`
--> $DIR/deafult-associated-type-bound-1.rs:9:13 --> $DIR/default-associated-type-bound-1.rs:8:13
| |
LL | type U: Clone; LL | type U: Clone;
| ^^^^^ required by this bound in `X::U` | ^^^^^ required by this bound in `X::U`

View File

@ -1,5 +1,5 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deafult-associated-type-bound-2.rs:2:12 --> $DIR/default-associated-type-bound-2.rs:2:12
| |
LL | #![feature(specialization)] LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -9,14 +9,14 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete = help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: can't compare `&'static B` with `B` error[E0277]: can't compare `&'static B` with `B`
--> $DIR/deafult-associated-type-bound-2.rs:16:22 --> $DIR/default-associated-type-bound-2.rs:16:22
| |
LL | default type U = &'static B; LL | default type U = &'static B;
| ^^^^^^^^^^ no implementation for `&'static B == B` | ^^^^^^^^^^ no implementation for `&'static B == B`
| |
= help: the trait `PartialEq<B>` is not implemented for `&'static B` = help: the trait `PartialEq<B>` is not implemented for `&'static B`
note: required by a bound in `X::U` note: required by a bound in `X::U`
--> $DIR/deafult-associated-type-bound-2.rs:6:13 --> $DIR/default-associated-type-bound-2.rs:6:13
| |
LL | type U: PartialEq<T>; LL | type U: PartialEq<T>;
| ^^^^^^^^^^^^ required by this bound in `X::U` | ^^^^^^^^^^^^ required by this bound in `X::U`

View File

@ -1,5 +1,5 @@
warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deafult-generic-associated-type-bound.rs:3:12 --> $DIR/default-generic-associated-type-bound.rs:3:12
| |
LL | #![feature(specialization)] LL | #![feature(specialization)]
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -9,14 +9,14 @@ LL | #![feature(specialization)]
= help: consider using `min_specialization` instead, which is more stable and complete = help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: can't compare `T` with `T` error[E0277]: can't compare `T` with `T`
--> $DIR/deafult-generic-associated-type-bound.rs:18:26 --> $DIR/default-generic-associated-type-bound.rs:18:26
| |
LL | default type U<'a> = &'a T; LL | default type U<'a> = &'a T;
| ^^^^^ no implementation for `T == T` | ^^^^^ no implementation for `T == T`
| |
= note: required because of the requirements on the impl of `PartialEq` for `&'a T` = note: required because of the requirements on the impl of `PartialEq` for `&'a T`
note: required by a bound in `X::U` note: required by a bound in `X::U`
--> $DIR/deafult-generic-associated-type-bound.rs:8:17 --> $DIR/default-generic-associated-type-bound.rs:8:17
| |
LL | type U<'a>: PartialEq<&'a Self> where Self: 'a; LL | type U<'a>: PartialEq<&'a Self> where Self: 'a;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `X::U` | ^^^^^^^^^^^^^^^^^^^ required by this bound in `X::U`

View File

@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]
use std::fmt::Debug; use std::fmt::Debug;

View File

@ -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 error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-53598.rs:20:42 --> $DIR/issue-53598.rs:19:42
| |
LL | fn foo<T: Debug>(_: T) -> Self::Item { LL | fn foo<T: Debug>(_: T) -> Self::Item {
| __________________________________________^ | __________________________________________^

View File

@ -1,4 +1,3 @@
// ignore-compare-mode-chalk
#![feature(arbitrary_self_types)] #![feature(arbitrary_self_types)]
#![feature(type_alias_impl_trait)] #![feature(type_alias_impl_trait)]

View File

@ -1,5 +1,5 @@
error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias error: type parameter `impl Deref<Target = Self>` is part of concrete type but not used in parameter list for the `impl Trait` type alias
--> $DIR/issue-57700.rs:16:58 --> $DIR/issue-57700.rs:15:58
| |
LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar { LL | fn foo(self: impl Deref<Target = Self>) -> Self::Bar {
| __________________________________________________________^ | __________________________________________________________^

View File

@ -1,5 +1,3 @@
// ignore-compare-mode-chalk
trait Bug { trait Bug {
type Item: Bug; type Item: Bug;

View File

@ -1,5 +1,5 @@
error[E0658]: `impl Trait` in type aliases is unstable error[E0658]: `impl Trait` in type aliases is unstable
--> $DIR/issue-60371.rs:10:17 --> $DIR/issue-60371.rs:8:17
| |
LL | type Item = impl Bug; LL | type Item = impl Bug;
| ^^^^^^^^ | ^^^^^^^^
@ -8,7 +8,7 @@ LL | type Item = impl Bug;
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
error[E0277]: the trait bound `(): Bug` is not satisfied error[E0277]: the trait bound `(): Bug` is not satisfied
--> $DIR/issue-60371.rs:12:40 --> $DIR/issue-60371.rs:10:40
| |
LL | const FUN: fn() -> Self::Item = || (); LL | const FUN: fn() -> Self::Item = || ();
| ^ the trait `Bug` is not implemented for `()` | ^ the trait `Bug` is not implemented for `()`
@ -17,7 +17,7 @@ LL | const FUN: fn() -> Self::Item = || ();
<&() as Bug> <&() as Bug>
error: non-defining opaque type use in defining scope error: non-defining opaque type use in defining scope
--> $DIR/issue-60371.rs:12:37 --> $DIR/issue-60371.rs:10:37
| |
LL | impl Bug for &() { LL | impl Bug for &() {
| - cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type | - cannot use static lifetime; use a bound lifetime instead or remove the lifetime parameter from the opaque type