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.
Make wf check the bounds of built-in types
Fixes rust-lang#24957
- Loading branch information
Showing
12 changed files
with
165 additions
and
33 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
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
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,24 @@ | ||
// 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 { | ||
//~^ ERROR the trait `core::marker::Sized` is not implemented | ||
//~^^ ERROR the trait `core::marker::Sized` is not implemented | ||
A([u8]), | ||
B([BsonValue]), | ||
} | ||
|
||
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
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,41 @@ | ||
// 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 | ||
|
||
trait Tr {} | ||
|
||
fn g1<X: ?Sized>(x: X) {} //~ERROR the trait `core::marker::Sized` is not implemented | ||
fn g2<X: ?Sized + Tr>(x: X) {} //~ERROR the trait `core::marker::Sized` is not implemented | ||
|
||
fn bogus( //~ERROR the trait `core::marker::Sized` is not implemented | ||
_: [u8]) | ||
{ | ||
loop {} | ||
} | ||
|
||
struct S<T: Tr>(T); | ||
|
||
fn b1() -> &'static [(u8,fn(&'static [S<()>]))] | ||
{} //~^ ERROR the trait `Tr` is not implemented | ||
fn b2() -> fn([u8]) | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b3() -> fn()->[u8] | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b4() -> &'static [[u8]] | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b5() -> &'static [[u8]; 2] | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b6() -> &'static ([u8],) | ||
{} //~^ ERROR the trait `core::marker::Sized` is not implemented | ||
fn b7() -> &'static (u32,[u8],u32) | ||
{} //~^ 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() {} |