]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/unsized3.rs
1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test sized-ness checking in substitution within fn bodies..
16 fn f1
<X
: ?Sized
>(x
: &X
) {
18 //~^ ERROR `X: std::marker::Sized` is not satisfied
27 fn f3
<X
: ?Sized
+ T
>(x
: &X
) {
29 //~^ ERROR `X: std::marker::Sized` is not satisfied
34 // Test with unsized enum.
40 fn f6
<X
: ?Sized
>(x
: &X
) {}
41 fn f7
<X
: ?Sized
>(x1
: &E
<X
>, x2
: &E
<X
>) {
43 //~^ ERROR `X: std::marker::Sized` is not satisfied
48 // Test with unsized struct.
53 fn f8
<X
: ?Sized
>(x1
: &S
<X
>, x2
: &S
<X
>) {
55 //~^ ERROR `X: std::marker::Sized` is not satisfied
60 fn f9
<X
: ?Sized
>(x1
: Box
<S
<X
>>, x2
: Box
<E
<X
>>) {
62 //~^ ERROR `X: std::marker::Sized` is not satisfied
65 fn f10
<X
: ?Sized
>(x1
: Box
<S
<X
>>, x2
: Box
<E
<X
>>) {
67 //~^ ERROR `X: std::marker::Sized` is not satisfied