Coder Social home page Coder Social logo

predicates-rs's Introduction

predicates-rs

An implementation of boolean-valued predicate functions in Rust.

Documentation License Crates.io

Changelog

Usage

First, add this to your Cargo.toml:

[dependencies]
predicates = "3.1.0"

Next, add this to your crate:

extern crate predicates;

use predicates::prelude::*;

For more information on using predicates, look at the documentation

License

predicates-rs is distributed under the terms of both the MIT license and the Apache License (Version 2.0).

Credits

Big thanks to futures-rs, whose slick API design informed a lot of decisions made on the API design of this library.

predicates-rs's People

Contributors

asomers avatar bronson avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar epage avatar farodin91 avatar fornwall avatar kammitama5 avatar luser avatar marieell avatar nastevens avatar peter-kehl avatar psiace avatar ramosbugs avatar renovate[bot] avatar rshearman avatar smoelius avatar taminomara avatar tim77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

predicates-rs's Issues

Release please

Could you please release a new version of predicates and predicates-tree? As soon as you do that, I'll be able to publish the first version of my new crate!

String equality predicate with diffing

Something cobalt's dir diffing does is using the difference crate to provide a diff for the user, making it easier to spot why the test failed.

Providing this as a predicate will be very helpful for assert_cli and dir-diff.

Snapshot tests

Did we ever talk about snapshot tests? I don't recall, and I didn't find an issue in this or the assert_{cmd,cli} repos.

The idea is this: Instead of manually writing predicate::path::eq_file(Path::new("some.file")).utf8().unwrap();, you'd have a predicate::eq_snapshot!() macro that expands to a uniq filename predicate with the ability to create that file with the content it gets on the first test run or when using RECORD_SNAPSHOTS=1 or something similar.

Refactor src/path/fs predicates.

I realized, we could reuse these predicates for being able to create file-backed eq predicates for strings / bytes.

Other changes

  • Add find_case to it
  • Switch the equality check to use difference.

Decouple `Predicate` from implementations

assert_cli is going to optionally allow users to create predicates for verifying the results of their application.

My current thoughts are

  • Allow users to decide if they want predicates and, if so, which
  • Minimize predicate API breakages from impacting assert_cli's API

From this, my thought is that we should move Predicate into a predicates-core crate. assert_cli will accept a predicates_core::Predicate. Users of assert_cli can then depend on predicates if they want and pass some in. This will allow us to make breaking changes to the predicates without breaking the APIs that accept predicates.

Predicates for file metadata

We already have file type. Additionally:

  • Permissions
  • atime, mtime, etc

For some of these, we'd have to decide how to handle this cross-platform.

RFC: Moving fmt::Display from Predicates to a separate method

With adding a way to show predicates with the item being evaluated keeping the current non-evaluated as the Display implementation is a bit confusing as two completely distinct ways of creating a humane readable string. I propose that the fmt::Display implementation be removed and be moved to a seperate method so that's easy to understand that when you want to display a human readable version of a predicate you call either of the methods.

Current

Evaluated

let predicate_fn = predicate::ne(5).not().and(predicate::ge(5));
let (result, output) = predicate_fn.stringify(&5);
println!("{}", output);

Non-evaluated

let predicate_fn = predicate::ne(5).not().and(predicate::ge(5));
println!("{}", predicate_fn);

Proposed

Evaluated

let predicate_fn = predicate::ne(5).not().and(predicate::ge(5));
let (result, output) = predicate_fn.stringify_with_item(&5);
println!("{}", output);

Non-evaluated

let predicate_fn = predicate::ne(5).not().and(predicate::ge(5));
let (result, output) = predicate_fn.stringify();
println!("{}", output);

`Contains` behavior is confusing

Currently, the expression hash.contains(5) gets translated to contains(hash).eval(&5). If you understand that context, it makes sense. If you are coming from another language that uses in or contains operators, it gets confusing (the expression 4 < 5 gets translated to: lt(5).eval(&4))

  • Some languages have an in operator. So 5 in hash would naturally translate to in(hash).eval(&5).
  • Some languages flip that and have a contains operator. So hash contains 5 would naturally translate to contains(5).eval(&hash).

"All" Predicate for tuples

For my application I have need of a predicate that works on tuples. The function predicate is more cumbersome than I would like. Ideally, the predicate would apply a different predicate to every member of the tuple, and return the AND of all its children. It would be a macro, and usage would be something like this:

tuple!(eq(4), gt(10)).eval(&(4u32, 20i16)

Do you think that such a macro would be of general use? If not I'll add it to my crate alone. If so, I'll make a PR for predicates-rs.

Build broken with float-cmp 0.4.1

After updating my lockfile such that float-cmp went from 0.4.0 to 0.4.1 I see:

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> /home/brian/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-1.0.1/src/float/close.rs:86:18
   |
86 |         variable.approx_eq(&self.target, self.epsilon, self.ulps)
   |                  ^^^^^^^^^ expected 2 parameters

Predicates for string line count

Hello,

First, thanks for your hard work on this crate, I use it with assert_cmd and it's easy to both read and use. :)

I test every line, of my output, but I want to be sure I didn't miss anything.

Is there any hope to see a predicate for line countโ€ฏ?

Like a predicate::str::line_count(5) to check the output line count is 5โ€ฏ?

Hope this feature make sense and will brings some interest.

Keep the good work!

Directory diff predicate

Based on #32, let's provide a directory predicate.

What do we care about?

  • empty directories?
  • .keep files in directories
  • treating files as str
    • normalize line endings?
    • (with rich reporting) show a diff of files on failure?

How do we handle heterogeneous content?

  • Don't
  • dir-diff, filtering for the content we want, and run the dir-diff multiple times
  • A lambda
  • Accepting [[globs], Predicate]?

Additional resources

Implement Predicate<PathBuf> for BinaryFilePredicate

It would be handy if BinaryFilePredicate implemented Predicate<PathBuf>. There are some functions that, for lifetime reasons, must take a 'static argument, like PathBuf. Right now those functions can't easily use predicates.

Better documentation for find_case

It sounds like Predicate::find_case is important, but for the life of me I can't figure out how to use it. Could you please expand its documentation? What I'm looking for is a way to do something like this, so I can print a useful message whenever a predicate fails.

assert!(pred.eval(&input), pred.fail_message(&input))

RUSTSEC-2020-0095: difference is unmaintained

summary

Predicates-rs depends on an unmaintained crate and triggers audit warnings.
Not a show-stopper, but predicates-rs is depended on transitively by a lot of crates.
There seems to be a few alternate diffing crates, but I haven't looked into them.

As an aside, many rust projects use github actions to run regular cargo audit, see https://github.com/actions-rs/audit-check

reproduce

I tried this code: cargo audit

I expected to see this happen: No report

Instead this happened:

    Fetching advisory database from `https://github.com/RustSec/advisory-db.git`
      Loaded 263 security advisories (from /home/work/.cargo/advisory-db)
    Updating crates.io index
    Scanning Cargo.lock for vulnerabilities (67 crate dependencies)
Crate:         difference
Version:       2.0.0
Warning:       unmaintained
Title:         difference is unmaintained
Date:          2020-12-20
ID:            RUSTSEC-2020-0095
URL:           https://rustsec.org/advisories/RUSTSEC-2020-0095
Dependency tree:
difference 2.0.0
โ””โ”€โ”€ predicates 1.0.7
    โ””โ”€โ”€ assert_cmd 1.0.3
        โ””โ”€โ”€ (redacted)

warning: 1 allowed warning found

Meta

predicates-rs version: 1.0.7

Refactor API / source layout?

The layout in the docs / source feels strange with everything buried under the predicate module. The goal seems to be to allow imports like:

use predicates::{predicate, Predicate};

Proposal:

  • Move all predicate modules into the root with a pub use in lib.rs
  • Move Predicate and BoxedPredicate in dedicated private files in the root with a pub use in lib.rs.
  • Create a prelude module that contains
    • Predicate
    • predicate module which only re-exports the factory functions
      • Add a note to the factory functions about this
      • Add a note to the *Predicates about using the factories from predicate.

The standard import would now look like:

use predicates::prelude::*;

Benefits

  • Standard import is more consistent with regular stuff
  • Source and docs organization will be less nested
  • Docs will be a little more organized
  • The scope of the predicate module will be narrowed to just factories which imo makes the intent / starting point more clear.

Consolidate predicate efforts?

I've created some predicates for assert_cli and expect to be creating more.

I'm wondering if you want to join efforts in providing general predicates for exposure in different APIs

  • Would you be interested in moving to the new assert.rs org with the intent of having others help support you in maintaining this crate?
  • Are you interested in more and more complex predicates being added? As one example, assert_cli will show a diff if two strings are different
  • How amenable are you to the API evolving to support additional or different needs? For example, a version of eval that reports what didn't match of the expression?

RE consolidating on orgs, I'm inspired by killercups #rust2018 post:

There is no reason why so many popular crates should live in user-repos instead of in community-managed organizations (speaking in Github terms). Writing and then publishing a bunch of code as a crate one thing, but maintaining it, fixing bugs, replying to issues and pull requests, that takes up a lot of time as well. Time, that a lot of developers don't have, or don't want to invest. cargo-edit, for example, which lives under my Github username, has two wonderful maintainers, who are more active than I am. But should I create a cargo-edit organization and move the repo there? If there was a good and definitive answer, which would neither make me deal with the organizational aspects not result in accumulating lot of junk code, I'd be really happy.

https://deterministic.space/rust-2018.html#aim-for-long-term-stability-of-the-library-ecosystem

What kind of `into`s should be supported?

What kind of conversions from non-predicates should be supported? Or conversions from one type of predicate to another?

Ideas include

  • An into implementation that converts anything that implements Eq into a predicate. This would allow theoretical API to do something like 5.assert(5).
  • Create a predicate that auto-adapts types and create an Into of it.

Add CONTRIBUTING document

Contents can be modeled after rust-lang's document: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md

In addition to the content in that document, the following copyright should be applied to all new files:

// Copyright (c) 2018 The predicates-rs Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

Internal DSL for Predicates?

iirc Rust's logical operators force a return type, preventing using them in a DSL (pred && pred).

What about the bitwise operators (pred & pred)? Should this be done to make the API "more ergonomic"?

What about not-ing? And if our choice in operator for not-ing is at a weird precedence level compare to the others, which should we prefer?

Floating point "closeness" predicate

This isn't needed for any of my cases but just wanted to bring it up for rounding things out.

Floating point equality is weird. Generally, its best to do a "closeness" check.

PredicateBoolean doesn't implement Predicate<T> for T: ?Sized

I tried this code:

let p: Box<dyn Predicate<str>> = Box::new(always());

I expected to see this happen: It should compile fine

Instead this happened: Build fails with this error:

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> src/constant.rs:86:38
   |
86 |     let p: Box<dyn Predicate<str>> = Box::new(always());
   |                                      ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `str`
   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
   = note: required because of the requirements on the impl of `predicates_core::core::Predicate<str>` for `constant::BooleanPredicate`
   = note: required for the cast to the object type `dyn predicates_core::core::Predicate<str>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.

Meta

predicates-rs version: 1.0.1
rustc --version --verbose:

> rustc --version --verbose
rustc 1.41.0-nightly (1bd30ce2a 2019-11-15)
binary: rustc
commit-hash: 1bd30ce2aac40c7698aa4a1b9520aa649ff2d1c5
commit-date: 2019-11-15
host: x86_64-unknown-freebsd
release: 1.41.0-nightly
LLVM version: 9.0

Originally reported at asomers/mockall#78

The crates.io release and the master branch of this repository don't match

Hey,

so the released version on crates.io is from commit a9503ad (https://docs.rs/crate/predicates/1.0.2/source/.cargo_vcs_info.json) which isn't on any branch but does exist on the repository. That's confusing because master says float-cmp should be 0.6 while on crates.io it's currently 0.5.

I think it would be a good idea to release the current master branch as a new version to fix that discrepancy between the repository and crates.io

Color output

Partially inspired by assert-rs/assert_cmd#121

With typos, I found yansi worked well. The main question will be when to decide to turn it on/off because tests don't really have an initialization step.

API doesn't work well with distinct owned / ref types

EqPredicate stores T and its eval takes a &T. But what about Vec/slice, String/str, and PathBuf/path?

Exploration Summary

After making Predicate use generics rather than associated types (see #29)

Dead ends

  • Predicate { eval<I: AsRef<Item>>(&self, item: I) }: not object-safe which means we can't Box<Predicate> or &Predicate.
  • Predicate { eval(&self, item: Item) } (ie Item=&str rather than Item=str): violates borrow checker in boolean predicates
  • Above with Item: Copy: Lifetime issues (branch)
  • impl Predicate<AsRef<T>> for EqPredicate<T>: No AsRef implemented for numeric types
  • impl Predicate<Borrow<T>> for EqPredicate<T>: Sized issues (branch)

Options:

  • Create an AsRef adapter

Crate includes big .tags file

1.0.7 is the first version to include .tags, making it ten times as big as previous versions. .tags could either be added to .gitignore and removed from the repo or but in cargo's exclude attribute.

Show diff horizontally aligned?

The string diffs from predicates are great, but would be easier to read if they started in the same column.

I have this code using assert_fs:

    temp.child("subdir")
        .child("subfile")
        .assert("Must I paint you a picture");

I get this output:

---- transport::local::test::write_file stdout ----
thread 'transport::local::test::write_file' panicked at 'Unexpected file, failed var - original <= 0
โ””โ”€โ”€ var - original <= 0
    โ”œโ”€โ”€ original: Must I paint you a picture
    โ”œโ”€โ”€ actual distance: 2
    โ”œโ”€โ”€ diff: Must I paint you a picture
Must I paint you a picture?

    โ””โ”€โ”€ var as str: Must I paint you a picture?

I would prefer something like this:

---- transport::local::test::write_file stdout ----
thread 'transport::local::test::write_file' panicked at 'Unexpected file, failed var - original <= 0
โ””โ”€โ”€ var - original <= 0
    โ”œโ”€โ”€ original: Must I paint you a picture
    โ”œโ”€โ”€ actual distance: 2
    โ”œโ”€โ”€ diff: 
Must I paint you a picture
Must I paint you a picture?
    โ””โ”€โ”€ var as str: Must I paint you a picture?

Meta

predicates-rs version: 1.0.4
rustc --version --verbose:

rustc 1.45.0-beta.3359 (b7dc83a3f 2020-06-03)
binary: rustc
commit-hash: b7dc83a3f6ca9746fb3d121761c3605477b77d90
commit-date: 2020-06-03
host: x86_64-apple-darwin
release: 1.45.0-beta.3359
LLVM version: 10.0

Predicates for tuple.n

Something like this.

use predicates::reflection;
use predicates::Predicate;
use std::fmt;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct Tuple0<T>(T);

fn tuple0<T>(inner: T) -> Tuple0<T> {
    Tuple0(inner)
}

impl<T: fmt::Display> fmt::Display for Tuple0<T> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{{let var = var.0; {}}}", self.0)
    }
}

impl<T: fmt::Display> reflection::PredicateReflection for Tuple0<T> {}

impl<T0, U0> Predicate<(U0,)> for Tuple0<T0>
where
    T0: fmt::Display + Predicate<U0>,
{
    fn eval(&self, variable: &(U0,)) -> bool {
        self.0.eval(&variable.0)
    }
}

impl<T, U, U1> Predicate<(U, U1)> for Tuple0<T>
where
    T: fmt::Display + Predicate<U>,
{
    fn eval(&self, variable: &(U, U1)) -> bool {
        self.0.eval(&variable.0)
    }
}

// impl<T, U, U1, U2> Predicate<(U, U1, U2)> for Tuple0<T>
// impl<T, U, U1, U2, U3> Predicate<(U, U1, U2, U3)> for Tuple0<T>
// ...

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct Tuple1<T>(T);

fn tuple1<T>(inner: T) -> Tuple1<T> {
    Tuple1(inner)
}

impl<T: fmt::Display> fmt::Display for Tuple1<T> {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "{{let var = var.1; {}}}", self.0)
    }
}

impl<T: fmt::Display> reflection::PredicateReflection for Tuple1<T> {}

impl<T, U0, U> Predicate<(U0, U)> for Tuple1<T>
where
    T: fmt::Display + Predicate<U>,
{
    fn eval(&self, variable: &(U0, U)) -> bool {
        self.0.eval(&variable.1)
    }
}

// impl<T, U0, U, U2> Predicate<(U0, U, U2)> for Tuple1<T>
// impl<T, U0, U, U2, U3> Predicate<(U0, U, U2, U3)> for Tuple1<T>
// ...

fn main() {
    use predicates::prelude::*;

    let t1 = (0,);
    let t2 = (0, 1);

    let p0 = tuple0(predicates::ord::eq(0));
    let p1 = tuple1(predicates::ord::eq(2));

    assert_eq!(p0.eval(&t1), true);
    assert_eq!(p0.eval(&t2), true);
    assert_eq!(p1.eval(&t2), false);
    assert_eq!(p0.and(p1).eval(&t2), false);
    assert_eq!(p0.or(p1).eval(&t2), true);
}

Re-license to "predicates-rs Project Developers"

Update license statements across project to apply to "predicates-rs Project Developers". Currently I (@nastevens) am the listed copyright holder, so I will make a clear statement in the PR for these changes that I am transferring my rights.

predicates-core MSRV 1.19 -> 1.31 in 1.0.1

This ticket doesn't require action, its just for your information.

Testing indicates that 1.0.1 changes the effective MSRV from 1.19.0 to 1.31.0

https://kentfredric.github.io/rust-vmatrix/crates-p/pr/predicates-core/

snapshot_20201229_185213

Failure on rust 1.30
  Compiling predicates-core v1.0.1
    Running `rustc --edition=2018 --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=eac2f78185e84610 -C extra-filename=-eac2f78185e84610 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_30_1_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_30_1_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc`
error: Edition 2018 is unstable and only available for nightly builds of rustc.                            
                                                                                                          
error: Could not compile `predicates-core`.                                                                

Caused by:
 process didn't exit successfully: `rustc --edition=2018 --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=eac2f78185e84610 -C extra-filename=-eac2f78185e84610 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_30_1_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_30_1_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc` (exit code: 1)
Failure on rust 1.27 to 1.29
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: unable to get packages from source

Caused by:
  failed to parse manifest at `/tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/Cargo.toml`

Caused by:
  editions are unstable

Caused by:
  feature `edition` is required

this Cargo does not support nightly features, but if you
switch to nightly channel you can add
`cargo-features = ["edition"]` to enable this feature
Failure on rust 1.26
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling predicates-core v1.0.1
     Running `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=d28798d656779a9a -C extra-filename=-d28798d656779a9a --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_26_2_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_26_2_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc`
error[E0658]: `crate` in paths is experimental (see issue #45477)
 --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/core.rs:9:5
  |
9 | use crate::reflection;
  |     ^^^^^

error[E0658]: `crate` in paths is experimental (see issue #45477)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs:24:9
   |
24 | pub use crate::core::*;
   |         ^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:18:40
   |
18 |     fn parameters<'a>(&'a self) -> Box<dyn Iterator<Item = Parameter<'a>> + 'a> {
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:24:38
   |
24 |     fn children<'a>(&'a self) -> Box<dyn Iterator<Item = Child<'a>> + 'a> {
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:38:39
   |
38 | pub struct Parameter<'a>(&'a str, &'a dyn fmt::Display);
   |                                       ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:42:41
   |
42 |     pub fn new(key: &'a str, value: &'a dyn fmt::Display) -> Self {
   |                                         ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:52:29
   |
52 |     pub fn value(&self) -> &dyn fmt::Display {
   |                             ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:70:35
   |
70 | pub struct Child<'a>(&'a str, &'a dyn PredicateReflection);
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:74:41
   |
74 |     pub fn new(key: &'a str, value: &'a dyn PredicateReflection) -> Self {
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:84:29
   |
84 |     pub fn value(&self) -> &dyn PredicateReflection {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:103:27
    |
103 |     predicate: Option<&'a dyn PredicateReflection>,
    |                           ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:111:38
    |
111 |     pub fn new(predicate: Option<&'a dyn PredicateReflection>, result: bool) -> Self {
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:133:40
    |
133 |     pub fn predicate(&self) -> Option<&dyn PredicateReflection> {
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:223:51
    |
223 | pub struct Product(borrow::Cow<'static, str>, Box<dyn fmt::Display>);
    |                                                   ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:244:29
    |
244 |     pub fn value(&self) -> &dyn fmt::Display {
    |                             ^^^^^^^^^^^^^^^^

error: aborting due to 15 previous errors

For more information about this error, try `rustc --explain E0658`.
error: Could not compile `predicates-core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=d28798d656779a9a -C extra-filename=-d28798d656779a9a --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_26_2_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_26_2_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc` (exit code: 101)
Failure on rust 1.25
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling predicates-core v1.0.1
     Running `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=ac856e13a35423d4 -C extra-filename=-ac856e13a35423d4 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_25_0_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_25_0_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc`
error[E0658]: `crate` in paths is experimental (see issue #45477)
 --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/core.rs:9:5
  |
9 | use crate::reflection;
  |     ^^^^^

error[E0658]: `crate` in paths is experimental (see issue #45477)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs:24:9
   |
24 | pub use crate::core::*;
   |         ^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:18:40
   |
18 |     fn parameters<'a>(&'a self) -> Box<dyn Iterator<Item = Parameter<'a>> + 'a> {
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:24:38
   |
24 |     fn children<'a>(&'a self) -> Box<dyn Iterator<Item = Child<'a>> + 'a> {
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:38:39
   |
38 | pub struct Parameter<'a>(&'a str, &'a dyn fmt::Display);
   |                                       ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:42:41
   |
42 |     pub fn new(key: &'a str, value: &'a dyn fmt::Display) -> Self {
   |                                         ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:52:29
   |
52 |     pub fn value(&self) -> &dyn fmt::Display {
   |                             ^^^^^^^^^^^^^^^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:58:42
   |
58 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:64:42
   |
64 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:70:35
   |
70 | pub struct Child<'a>(&'a str, &'a dyn PredicateReflection);
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:74:41
   |
74 |     pub fn new(key: &'a str, value: &'a dyn PredicateReflection) -> Self {
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:84:29
   |
84 |     pub fn value(&self) -> &dyn PredicateReflection {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:90:42
   |
90 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:96:42
   |
96 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:103:27
    |
103 |     predicate: Option<&'a dyn PredicateReflection>,
    |                           ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:111:38
    |
111 |     pub fn new(predicate: Option<&'a dyn PredicateReflection>, result: bool) -> Self {
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:133:40
    |
133 |     pub fn predicate(&self) -> Option<&dyn PredicateReflection> {
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:143:44
    |
143 |     pub fn products(&self) -> CaseProducts<'_> {
    |                                            ^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:150:44
    |
150 |     pub fn children(&self) -> CaseChildren<'_> {
    |                                            ^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:158:42
    |
158 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:223:51
    |
223 | pub struct Product(borrow::Cow<'static, str>, Box<dyn fmt::Display>);
    |                                                   ^^^^^^^^^^^^^^^^

error[E0658]: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:244:29
    |
244 |     pub fn value(&self) -> &dyn fmt::Display {
    |                             ^^^^^^^^^^^^^^^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:250:42
    |
250 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error[E0658]: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:256:42
    |
256 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error: aborting due to 24 previous errors

error: Could not compile `predicates-core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=ac856e13a35423d4 -C extra-filename=-ac856e13a35423d4 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_25_0_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_25_0_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc` (exit code: 101)
Failure on rust 1.24
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling predicates-core v1.0.1
     Running `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=6c6a7c081787498a -C extra-filename=-6c6a7c081787498a --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_24_1_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_24_1_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc`
error: `crate` in paths is experimental (see issue #45477)
 --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/core.rs:9:5
  |
9 | use crate::reflection;
  |     ^^^^^

error: `crate` in paths is experimental (see issue #45477)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs:24:9
   |
24 | pub use crate::core::*;
   |         ^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:18:40
   |
18 |     fn parameters<'a>(&'a self) -> Box<dyn Iterator<Item = Parameter<'a>> + 'a> {
   |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:24:38
   |
24 |     fn children<'a>(&'a self) -> Box<dyn Iterator<Item = Child<'a>> + 'a> {
   |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:38:39
   |
38 | pub struct Parameter<'a>(&'a str, &'a dyn fmt::Display);
   |                                       ^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:42:41
   |
42 |     pub fn new(key: &'a str, value: &'a dyn fmt::Display) -> Self {
   |                                         ^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:52:29
   |
52 |     pub fn value(&self) -> &dyn fmt::Display {
   |                             ^^^^^^^^^^^^^^^^

error: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:58:42
   |
58 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:64:42
   |
64 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:70:35
   |
70 | pub struct Child<'a>(&'a str, &'a dyn PredicateReflection);
   |                                   ^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:74:41
   |
74 |     pub fn new(key: &'a str, value: &'a dyn PredicateReflection) -> Self {
   |                                         ^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:84:29
   |
84 |     pub fn value(&self) -> &dyn PredicateReflection {
   |                             ^^^^^^^^^^^^^^^^^^^^^^^

error: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:90:42
   |
90 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error: underscore lifetimes are unstable (see issue #44524)
  --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:96:42
   |
96 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
   |                                          ^^

error: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:103:27
    |
103 |     predicate: Option<&'a dyn PredicateReflection>,
    |                           ^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:111:38
    |
111 |     pub fn new(predicate: Option<&'a dyn PredicateReflection>, result: bool) -> Self {
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:133:40
    |
133 |     pub fn predicate(&self) -> Option<&dyn PredicateReflection> {
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^

error: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:143:44
    |
143 |     pub fn products(&self) -> CaseProducts<'_> {
    |                                            ^^

error: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:150:44
    |
150 |     pub fn children(&self) -> CaseChildren<'_> {
    |                                            ^^

error: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:158:42
    |
158 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:223:51
    |
223 | pub struct Product(borrow::Cow<'static, str>, Box<dyn fmt::Display>);
    |                                                   ^^^^^^^^^^^^^^^^

error: `dyn Trait` syntax is unstable (see issue #44662)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:244:29
    |
244 |     pub fn value(&self) -> &dyn fmt::Display {
    |                             ^^^^^^^^^^^^^^^^

error: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:250:42
    |
250 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error: underscore lifetimes are unstable (see issue #44524)
   --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/reflection.rs:256:42
    |
256 |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    |                                          ^^

error: aborting due to 24 previous errors

error: Could not compile `predicates-core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=6c6a7c081787498a -C extra-filename=-6c6a7c081787498a --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_24_1_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_24_1_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc` (exit code: 101)
Failure on rust 1.14 - 1.23
    Updating registry `https://github.com/rust-lang/crates.io-index`
   Compiling predicates-core v1.0.1
     Running `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=7496c2056dd620d1 -C extra-filename=-7496c2056dd620d1 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_23_0_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_23_0_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc`
error: expected identifier, found keyword `crate`
 --> /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/core.rs:9:5
  |
9 | use crate::reflection;
  |     ^^^^^

error: aborting due to previous error

error: Could not compile `predicates-core`.

Caused by:
  process didn't exit successfully: `rustc --crate-name predicates_core /tmp/Wkpp3jDiZE/vcheck_pl/cargo_1/.cargo/registry/src/github.com-1ecc6299db9ec823/predicates-core-1.0.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=7496c2056dd620d1 -C extra-filename=-7496c2056dd620d1 --out-dir /tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_23_0_1/target/debug/deps -L dependency=/tmp/Wkpp3jDiZE/vcheck_pl/predicates-core-rustc1_23_0_1/target/debug/deps --cap-lints allow -C linker=x86_64-pc-linux-gnu-gcc` (exit code: 101)

Casual observation suggests the main culprit for this regression is:

I believe there is sometimes some value in incrementing semver when changing minimum supported rust, especially when you advertise a "stable API" ( 1.x )

Though documenting the minimum supported rust somewhere top-level (README) also goes a long way.

Setting up a CI server to check your documented MSRV sticks is also quite welcome.

In the event this issue is not helpful, just let me know and I'll try to avoid filing similar issues on this crate in future.

NB: I don't directly use predicates-core, I'm just doing build testing across the ecosystem.

An `eval` that tells me why the predicate failed

In using this with assertions, like assert_cli, it'd be a very big help for debuggability to tell people why the assertion failed.

Requirements

Some possible requirements include (yes, some will be contradictory)

  • low overhead in the success case
  • be clear about what all the values shown mean
    • e.g. is_close has several params. If do we inline substitution, it might not be clear
  • don't overwhelm the user
  • show me all of the failures because the first might not be the root cause (particularly when doing dir-diffing)
  • show me all of the successes because a later failure might be rooted in the wrong thing succeeding
  • Make things clear in the formatting
  • Programmatically report the result so assert_cmd and friends can decide whether to panic (return error, etc)

Example of odd cases to watch for

  • is_close taking several parameters
  • from_utf8, trim, a potential normalize_newlines, from_file_path transform the data being passed down
    • Some of these also changes item's type
  • name shifts the child predicate into an equivalent of a named field
  • not flips what case we are looking for

Open Questions

  • Is this feature important enough and Debug implementations common enough that we can justify requiring Predicate<Item: Debug>?
    • atm we're leaning towards this being acceptable

API Design Options

cases_iter(item, yes: bool) -> Iterator

This returns an iterator of examples of cases for why yes. Each case in the iterator can show the full expression tree and what each part evaluates to.

The yes is needed to flip what we are looking for when evaluating not.

tree_eval(item) -> (bool, tree)

Returns the result of eval plus a renderable tree using the treeline crate.

Requires the following Predicate methods

  • stringify: like Display but substitutes the Item in
  • make_tree: creates the renderabvle tree
  • tree_eval: the actual function, a default trait implementation exists

See #39

table_eval(item) -> (bool, table)

Like tree_eval but render a table using term-table

See #39

prove(&'a self, item, yes:bool) -> Option<Tree<'a>>

Creates a Tree of the predicates and their intermediate values using references, owned values, and Cow. Different render implementations can be written against this, whether tree, table, or something else.

Only return those parts for support yes.

If None is returned, then nothing supports yes.

Impl `Fn*` for predicates as unstable feature

Hi. What do you think adding fn_traits and unboxed_closures features as unstable crate feature; and impl Fn* for predicates?
This will allow functions that take predicates of the form Fn* take the following form:
a.filter(eq(5))
instead
a.filter(|some_variable| eq(5).eval(some_variable))
or
a.filter(|some_variable| some_variable == 5)

see working example

Feature: show line numbers and/or context in diffs

@colin-kiegel from assert-rs/assert_cli#17

Just a random idea. :-)

git diffs provide some context and line numbers. If the output is really huge and lines are similar, this might be helpful - but certainly not straightforward. Should probably even be implement upstream first in the difference crate.

@@ -93,7 +93,7 @@
 #[derive(Debug)]
 pub struct Assert {
     cmd: Vec<String>,
-    expect_success: bool,
+    expect_success: Option<bool>,
     expect_exit_code: Option<i32>,
     expect_stdout: Option<OutputAssertion>,
     expect_stderr: Option<OutputAssertion>,

instead of

-    expect_success: bool,
+    expect_success: Option<bool>,

Smarter `find_case` for `eq_file`

Right now, its a default implementation

Ideally

  • For Str, perform difference where applicable
    • Do we also need to do this for eval? Not sure if there is a difference

String Conversion Predicates

Adapters from one Item type to another would be really useful.

Example: In creating a predicate for a file, it'd be helpful to wrap a predicate on str with a predicate on [u8] that will do a from_utf8 on the variable before passing it down.

These would be exposed on a PredicateStrExt

  • .trim, .trim_left, .trim_right: trim the value before passing it to the wrapped predicate
  • .from_utf8, .from_utf8_lossy, .from_utf16, .from_utf16_lossy: Wrap a str predicate as a byte predicate

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.