From 796ded2dfd2c042fc355c22558881fc7b6ed00cf Mon Sep 17 00:00:00 2001 From: scalexm Date: Thu, 7 Jun 2018 14:45:09 +0200 Subject: Add tests for `WellFormed-Type` and `FromEnv-Type` rules --- src/test/ui/chalkify/lower_struct.rs | 18 ++++++++++++++++++ src/test/ui/chalkify/lower_struct.stderr | 12 ++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/test/ui/chalkify/lower_struct.rs create mode 100644 src/test/ui/chalkify/lower_struct.stderr (limited to 'src') diff --git a/src/test/ui/chalkify/lower_struct.rs b/src/test/ui/chalkify/lower_struct.rs new file mode 100644 index 00000000000..9287555a056 --- /dev/null +++ b/src/test/ui/chalkify/lower_struct.rs @@ -0,0 +1,18 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(rustc_attrs)] + +#[rustc_dump_program_clauses] //~ ERROR program clause dump +struct Foo where Box: Clone { + _x: std::marker::PhantomData, +} + +fn main() { } diff --git a/src/test/ui/chalkify/lower_struct.stderr b/src/test/ui/chalkify/lower_struct.stderr new file mode 100644 index 00000000000..d6cc9c8e9a4 --- /dev/null +++ b/src/test/ui/chalkify/lower_struct.stderr @@ -0,0 +1,12 @@ +error: program clause dump + --> $DIR/lower_struct.rs:13:1 + | +LL | #[rustc_dump_program_clauses] //~ ERROR program clause dump + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: FromEnv(T: std::marker::Sized) :- FromEnv(Foo). + = note: FromEnv(std::boxed::Box: std::clone::Clone) :- FromEnv(Foo). + = note: WellFormed(Foo) :- Implemented(T: std::marker::Sized), Implemented(std::boxed::Box: std::clone::Clone). + +error: aborting due to previous error + -- cgit 1.4.1-3-g733a5