forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check built-in types for well-formedness
Fixes rust-lang#21111. Fixes rust-lang#24707. Fixes rust-lang#24957. Fixes rust-lang#25388. Fixes rust-lang#25637. Fixes rust-lang#26301.
- Loading branch information
Ariel Ben-Yehuda
committed
Jul 9, 2015
1 parent
efc3143
commit 0f08261
Showing
6 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2015 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. | ||
|
||
pub enum BsonValue { | ||
A([u8]), | ||
B([BsonValue]), //~ ERROR the trait `core::marker::Sized` is not implemented | ||
//~^ ERROR the trait `core::marker::Sized` is not implemented | ||
} | ||
|
||
pub fn set_value(_v:&BsonValue) | ||
{ | ||
} | ||
|
||
fn main() | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2015 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. | ||
|
||
// Check that we catch attempts to create non-well-formed types | ||
|
||
struct Bad<T:?Sized+'static, U:?Sized> { | ||
p1: &'static [T], //~ ERROR the trait `core::marker::Sized` is not implemented | ||
p2: U, //~ ERROR the trait `core::marker::Sized` is not implemented | ||
p3: u32 | ||
} | ||
|
||
trait Tr {} | ||
|
||
struct S<T: Tr>(T); | ||
|
||
fn b1() -> &'static [(u8,fn(&'static [S<()>]))] | ||
{} //~^ ERROR the trait `Tr` is not implemented | ||
fn b2() -> &'static [[i8]] | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b3() -> &'static [[u16]; 2] | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b4() -> &'static ([i16],) | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b5() -> &'static (u32,[i32],u32) | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b6() -> &'static (u32,u32,[i64]) | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2015 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. | ||
|
||
struct Wrap<'a, T: ?Sized>(&'a (), T); | ||
|
||
fn foo<'a, T>(_a: for<'s> fn() -> [Wrap<'s, T>]) where Wrap<'a, T>: Sized { | ||
//~^ ERROR mismatched types | ||
//~^^ ERROR mismatched types | ||
} | ||
|
||
fn main() {} |