Add tests for WellFormed-Type and FromEnv-Type rules

This commit is contained in:
scalexm 2018-06-07 14:45:09 +02:00
parent 09f6cb93ca
commit 796ded2dfd
2 changed files with 30 additions and 0 deletions

View file

@ -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 <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.
#![feature(rustc_attrs)]
#[rustc_dump_program_clauses] //~ ERROR program clause dump
struct Foo<T> where Box<T>: Clone {
_x: std::marker::PhantomData<T>,
}
fn main() { }

View file

@ -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<T>).
= note: FromEnv(std::boxed::Box<T>: std::clone::Clone) :- FromEnv(Foo<T>).
= note: WellFormed(Foo<T>) :- Implemented(T: std::marker::Sized), Implemented(std::boxed::Box<T>: std::clone::Clone).
error: aborting due to previous error