From e7f6c4c75406c3ecd117d7213e1be3438454b47e Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 5 May 2013 15:55:32 -0400 Subject: compile-fail tests for #[non_owned] and #[mutable] --- src/test/compile-fail/mutable-enum.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/compile-fail/mutable-enum.rs (limited to 'src/test/compile-fail/mutable-enum.rs') diff --git a/src/test/compile-fail/mutable-enum.rs b/src/test/compile-fail/mutable-enum.rs new file mode 100644 index 00000000000..2368e5eb5c5 --- /dev/null +++ b/src/test/compile-fail/mutable-enum.rs @@ -0,0 +1,19 @@ +// Copyright 2013 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. + +#[mutable] +enum Foo { A } + +fn bar(_: T) {} + +fn main() { + let x = A; + bar(x); //~ ERROR instantiating a type parameter with an incompatible type `Foo`, which does not fulfill `Const` +} -- cgit 1.4.1-3-g733a5