Skip to content

Instantly share code, notes, and snippets.

use std::marker::PhantomData;
trait Task {
type Output;
type Error;
fn execute(self) -> Result<Self::Output, Self::Error>;
fn and_then<F, B>(self, task: F) -> AndThenTask<Self, B, F>
where
use std::marker::PhantomData;
trait Task {
type Output;
type Error;
fn execute(self) -> Result<Self::Output, Self::Error>;
fn and_then<F, B>(self, task: F) -> AndThenTask<Self, B, F>
where
Crate {
module: Mod {
inner: Span {
lo: BytePos(
0
),
hi: BytePos(
17
),
ctxt: #0
// This program:
#![feature(conservative_impl_trait)]
use std::fmt::Debug;
#[derive(Debug)]
struct Foo<'a> { x: &'a i32 }
unsafe impl Send for Foo<'static> { }
if [ -z "$1" ]; then
echo "Usage: runtest.sh <file.rs> <options>"
exit 1
fi
rm -rf incr
mkdir incr
TEST=$1
shift
REVISIONS=$(re "// ?revisions: ?(.*)" '$1' $TEST)
# Sample TOML configuration file for building Rust.
#
# To configure rustbuild, copy this file to the directory from which you will be
# running the build, and name it config.toml.
#
# All options are commented out by default in this file, and they're commented
# out with their default values. The build system by default looks for
# `config.toml` in the current directory of a build for build configuration, but
# a custom configuration file can also be specified with `--config` to the build
# system.
/// This "type relation" matches up the expected types that we get
/// from a function signature with the types that the user supplied.
/// Our goal is to re-use the **expected signature** ESig en masse,
/// with the caveat that if there are hitherto unresolved variables
/// appearing in ESig, that we may take values for those variables
/// from the **supplied signature** SSig.
///
/// The expectation matcher is always applied to types, E and S,
/// where E is an input/output type from the expected signature,
/// and S is the corresponding type that the user supplied. Note that
ProgramEnvironment {
trait_data: {
Foo: TraitDatum {
binders: for<type> TraitDatumBound {
trait_ref: ?0 as Foo,
where_clauses: [
<?0 as Foo>::Assoc: Foo
],
auto: false
}
// Some basic examples you can use with the repl. Try this
// (you type the parts that go after the `?-`):
//
// cargo run
// ?- load libstd.chalk
// ?- Vec<Box<i32>>: Clone
trait AsRef<T> { }
trait Clone { }
trait Copy where Self: Clone { }