test: Fix fallout in tests
This commit is contained in:
parent
eeb94886ad
commit
0791f9f406
112 changed files with 205 additions and 466 deletions
|
@ -8,10 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(core)]
|
pub trait Foo {
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
pub trait Foo : MarkerTrait {
|
|
||||||
fn bar();
|
fn bar();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,4 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(core)]
|
trait Foo {}
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {}
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
pub mod bar {
|
pub mod bar {
|
||||||
use std::marker;
|
use std::marker;
|
||||||
|
|
||||||
pub trait Bar: marker::MarkerTrait + 'static {}
|
pub trait Bar: 'static {}
|
||||||
|
|
||||||
impl Bar for .. {}
|
impl Bar for .. {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,12 @@
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -14,16 +14,13 @@
|
||||||
//! (#14132).
|
//! (#14132).
|
||||||
|
|
||||||
#![crate_name = "a"]
|
#![crate_name = "a"]
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
macro_rules! three {
|
macro_rules! three {
|
||||||
() => { 3 }
|
() => { 3 }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait U : MarkerTrait {}
|
pub trait U {}
|
||||||
pub trait V : MarkerTrait {}
|
pub trait V {}
|
||||||
impl U for () {}
|
impl U for () {}
|
||||||
impl V for () {}
|
impl V for () {}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(core)]
|
pub trait Foo {
|
||||||
|
|
||||||
pub trait Foo : ::std::marker::MarkerTrait {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Foo for isize {
|
impl Foo for isize {
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
#![feature(optin_builtin_traits, core)]
|
#![feature(optin_builtin_traits, core)]
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
pub trait DefaultedTrait { }
|
||||||
|
|
||||||
pub trait DefaultedTrait : MarkerTrait { }
|
|
||||||
impl DefaultedTrait for .. { }
|
impl DefaultedTrait for .. { }
|
||||||
|
|
||||||
pub struct Something<T> { t: T }
|
pub struct Something<T> { t: T }
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// Check that an associated type cannot be bound in an expression path.
|
// Check that an associated type cannot be bound in an expression path.
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {
|
trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn bar() -> isize;
|
fn bar() -> isize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// Test that we do not ICE when an impl is missing an associated type (and that we report
|
// Test that we do not ICE when an impl is missing an associated type (and that we report
|
||||||
// a useful error, of course).
|
// a useful error, of course).
|
||||||
|
|
||||||
trait Trait : ::std::marker::MarkerTrait {
|
trait Trait {
|
||||||
type Type;
|
type Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {
|
trait Foo {
|
||||||
type X;
|
type X;
|
||||||
type Y;
|
type Y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// which checks that the trait interface itself is not considered an
|
// which checks that the trait interface itself is not considered an
|
||||||
// error as long as all impls satisfy the constraint.
|
// error as long as all impls satisfy the constraint.
|
||||||
|
|
||||||
trait Get : ::std::marker::MarkerTrait {
|
trait Get {
|
||||||
type Value;
|
type Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
// which checks that the trait interface itself is not considered an
|
// which checks that the trait interface itself is not considered an
|
||||||
// error as long as all impls satisfy the constraint.
|
// error as long as all impls satisfy the constraint.
|
||||||
|
|
||||||
trait Get : ::std::marker::MarkerTrait {
|
trait Get {
|
||||||
type Value;
|
type Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// Check that an associated type cannot be bound in an expression path.
|
// Check that an associated type cannot be bound in an expression path.
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {
|
trait Foo {
|
||||||
type A;
|
type A;
|
||||||
fn bar() -> isize;
|
fn bar() -> isize;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
|
|
||||||
trait Trait : ::std::marker::MarkerTrait {}
|
trait Trait {}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x: Vec<Trait + Sized> = Vec::new();
|
let x: Vec<Trait + Sized> = Vec::new();
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
// Test that two blanket impls conflict (at least without negative
|
// Test that two blanket impls conflict (at least without negative
|
||||||
// bounds). After all, some other crate could implement Even or Odd
|
// bounds). After all, some other crate could implement Even or Odd
|
||||||
|
@ -20,9 +19,9 @@ trait MyTrait {
|
||||||
fn get(&self) -> usize;
|
fn get(&self) -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Even : MarkerTrait { }
|
trait Even { }
|
||||||
|
|
||||||
trait Odd : MarkerTrait { }
|
trait Odd { }
|
||||||
|
|
||||||
impl Even for isize { }
|
impl Even for isize { }
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@ trait MyTrait {
|
||||||
fn get(&self) -> usize;
|
fn get(&self) -> usize;
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Even : ::std::marker::MarkerTrait { }
|
trait Even {}
|
||||||
|
|
||||||
trait Odd : ::std::marker::MarkerTrait { }
|
trait Odd {}
|
||||||
|
|
||||||
impl<T:Even> MyTrait for T { //~ ERROR E0119
|
impl<T:Even> MyTrait for T { //~ ERROR E0119
|
||||||
fn get(&self) -> usize { 0 }
|
fn get(&self) -> usize { 0 }
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
trait MyTrait : ::std::marker::MarkerTrait {}
|
trait MyTrait {}
|
||||||
|
|
||||||
struct TestType<T>(::std::marker::PhantomData<T>);
|
struct TestType<T>(::std::marker::PhantomData<T>);
|
||||||
|
|
||||||
|
|
|
@ -10,21 +10,19 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait MyTrait {}
|
||||||
|
|
||||||
trait MyTrait: MarkerTrait {}
|
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
//~^ ERROR conflicting implementations for trait `MyTrait`
|
//~^ ERROR conflicting implementations for trait `MyTrait`
|
||||||
|
|
||||||
trait MySafeTrait: MarkerTrait {}
|
trait MySafeTrait {}
|
||||||
|
|
||||||
unsafe impl MySafeTrait for .. {}
|
unsafe impl MySafeTrait for .. {}
|
||||||
//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
|
//~^ ERROR implementing the trait `MySafeTrait` is not unsafe
|
||||||
|
|
||||||
unsafe trait MyUnsafeTrait: MarkerTrait {}
|
unsafe trait MyUnsafeTrait {}
|
||||||
|
|
||||||
impl MyUnsafeTrait for .. {}
|
impl MyUnsafeTrait for .. {}
|
||||||
//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
|
//~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
|
||||||
|
|
|
@ -17,11 +17,9 @@
|
||||||
|
|
||||||
extern crate coherence_copy_like_lib as lib;
|
extern crate coherence_copy_like_lib as lib;
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
struct MyType { x: i32 }
|
struct MyType { x: i32 }
|
||||||
|
|
||||||
trait MyTrait : MarkerTrait { }
|
trait MyTrait { }
|
||||||
|
|
||||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,9 @@
|
||||||
|
|
||||||
extern crate coherence_copy_like_lib as lib;
|
extern crate coherence_copy_like_lib as lib;
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
struct MyType { x: i32 }
|
struct MyType { x: i32 }
|
||||||
|
|
||||||
trait MyTrait : MarkerTrait { }
|
trait MyTrait { }
|
||||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||||
|
|
||||||
// `MyStruct` is not declared fundamental, therefore this would
|
// `MyStruct` is not declared fundamental, therefore this would
|
||||||
|
|
|
@ -15,11 +15,9 @@
|
||||||
|
|
||||||
extern crate coherence_copy_like_lib as lib;
|
extern crate coherence_copy_like_lib as lib;
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
struct MyType { x: i32 }
|
struct MyType { x: i32 }
|
||||||
|
|
||||||
trait MyTrait : MarkerTrait { }
|
trait MyTrait { }
|
||||||
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
|
||||||
|
|
||||||
// Tuples are not fundamental, therefore this would require that
|
// Tuples are not fundamental, therefore this would require that
|
||||||
|
|
|
@ -15,7 +15,7 @@ struct Fat<T: ?Sized> {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Foo;
|
struct Foo;
|
||||||
trait Bar : ::std::marker::MarkerTrait {}
|
trait Bar {}
|
||||||
impl Bar for Foo {}
|
impl Bar for Foo {}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
|
|
|
@ -10,10 +10,8 @@
|
||||||
|
|
||||||
// Test implicit coercions involving DSTs and raw pointers.
|
// Test implicit coercions involving DSTs and raw pointers.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
struct S;
|
struct S;
|
||||||
trait T : MarkerTrait {}
|
trait T {}
|
||||||
impl T for S {}
|
impl T for S {}
|
||||||
|
|
||||||
struct Foo<T: ?Sized> {
|
struct Foo<T: ?Sized> {
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::num::SignedInt;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _f = 10.abs; //~ ERROR attempted to take value of method
|
let _f = 10i32.abs; //~ ERROR attempted to take value of method
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Node {
|
||||||
|
|
||||||
trait Node : MarkerTrait {
|
|
||||||
fn zomg();
|
fn zomg();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,8 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait Str : MarkerTrait {}
|
trait Str {}
|
||||||
|
|
||||||
trait Something {
|
trait Something {
|
||||||
fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
|
fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait ListItem<'a> {
|
||||||
|
|
||||||
trait ListItem<'a> : MarkerTrait {
|
|
||||||
fn list_name() -> &'a str;
|
fn list_name() -> &'a str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
pub trait AbstractRenderer {}
|
||||||
|
|
||||||
pub trait AbstractRenderer : MarkerTrait {}
|
|
||||||
|
|
||||||
fn _create_render(_: &()) ->
|
fn _create_render(_: &()) ->
|
||||||
AbstractRenderer
|
AbstractRenderer
|
||||||
|
|
|
@ -8,14 +8,11 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#![feature(unboxed_closures)]
|
|
||||||
|
|
||||||
use std::any::Any;
|
use std::any::Any;
|
||||||
use std::any::TypeId;
|
use std::any::TypeId;
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
pub trait Pt : MarkerTrait {}
|
pub trait Pt {}
|
||||||
pub trait Rt : MarkerTrait {}
|
pub trait Rt {}
|
||||||
|
|
||||||
trait Private<P: Pt, R: Rt> {
|
trait Private<P: Pt, R: Rt> {
|
||||||
fn call(&self, p: P, r: R);
|
fn call(&self, p: P, r: R);
|
||||||
|
|
|
@ -8,13 +8,11 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
fn add_state(op: <isize as HasState>::State) {
|
fn add_state(op: <isize as HasState>::State) {
|
||||||
//~^ ERROR the trait `HasState` is not implemented for the type `isize`
|
//~^ ERROR the trait `HasState` is not implemented for the type `isize`
|
||||||
}
|
}
|
||||||
|
|
||||||
trait HasState : MarkerTrait {
|
trait HasState {
|
||||||
type State;
|
type State;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Foo {
|
||||||
|
|
||||||
trait Foo : MarkerTrait {
|
|
||||||
type Item;
|
type Item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,9 @@
|
||||||
// cause compiler to loop. Note that no instances
|
// cause compiler to loop. Note that no instances
|
||||||
// of such a type could ever be constructed.
|
// of such a type could ever be constructed.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
struct t(Box<t>); //~ ERROR this type cannot be instantiated
|
struct t(Box<t>); //~ ERROR this type cannot be instantiated
|
||||||
|
|
||||||
trait to_str_2 : MarkerTrait {
|
trait to_str_2 {
|
||||||
fn my_to_string() -> String;
|
fn my_to_string() -> String;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,9 @@
|
||||||
// away.
|
// away.
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
use std::ops::{Shl, Shr};
|
use std::ops::{Shl, Shr};
|
||||||
|
|
||||||
pub trait Subscriber : MarkerTrait {
|
pub trait Subscriber {
|
||||||
type Input;
|
type Input;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
unsafe trait Trait {
|
||||||
|
|
||||||
unsafe trait Trait: MarkerTrait {
|
|
||||||
//~^ error: traits with default impls (`e.g. unsafe impl Trait for ..`) must have no methods or associated items
|
//~^ error: traits with default impls (`e.g. unsafe impl Trait for ..`) must have no methods or associated items
|
||||||
type Output;
|
type Output;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,12 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::num::ToPrimitive;
|
pub trait ToPrimitive {
|
||||||
|
fn to_int(&self) -> isize { 0 }
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ToPrimitive for i32 {}
|
||||||
|
impl ToPrimitive for isize {}
|
||||||
|
|
||||||
trait Add {
|
trait Add {
|
||||||
fn to_int(&self) -> isize;
|
fn to_int(&self) -> isize;
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait I {}
|
||||||
|
|
||||||
trait I : MarkerTrait {}
|
|
||||||
type K = I+'static;
|
type K = I+'static;
|
||||||
|
|
||||||
fn foo(_x: K) {} //~ ERROR: the trait `core::marker::Sized` is not implemented
|
fn foo(_x: K) {} //~ ERROR: the trait `core::marker::Sized` is not implemented
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait A {}
|
||||||
|
|
||||||
trait A : MarkerTrait {}
|
|
||||||
|
|
||||||
struct Struct {
|
struct Struct {
|
||||||
r: A+'static
|
r: A+'static
|
||||||
|
@ -22,6 +20,6 @@ fn new_struct(r: A+'static)
|
||||||
Struct { r: r }
|
Struct { r: r }
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Curve : MarkerTrait {}
|
trait Curve {}
|
||||||
enum E {X(Curve+'static)}
|
enum E {X(Curve+'static)}
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -10,14 +10,12 @@
|
||||||
|
|
||||||
// Test the mechanism for warning about possible missing `self` declarations.
|
// Test the mechanism for warning about possible missing `self` declarations.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait CtxtFn {
|
trait CtxtFn {
|
||||||
fn f8(self, usize) -> usize;
|
fn f8(self, usize) -> usize;
|
||||||
fn f9(usize) -> usize; //~ NOTE candidate
|
fn f9(usize) -> usize; //~ NOTE candidate
|
||||||
}
|
}
|
||||||
|
|
||||||
trait OtherTrait : MarkerTrait {
|
trait OtherTrait {
|
||||||
fn f9(usize) -> usize; //~ NOTE candidate
|
fn f9(usize) -> usize; //~ NOTE candidate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +24,7 @@ trait OtherTrait : MarkerTrait {
|
||||||
// declaration to match against, so we wind up prisizeing it as a
|
// declaration to match against, so we wind up prisizeing it as a
|
||||||
// candidate. This seems not unreasonable -- perhaps the user meant to
|
// candidate. This seems not unreasonable -- perhaps the user meant to
|
||||||
// implement it, after all.
|
// implement it, after all.
|
||||||
trait UnusedTrait : MarkerTrait {
|
trait UnusedTrait {
|
||||||
fn f9(usize) -> usize; //~ NOTE candidate
|
fn f9(usize) -> usize; //~ NOTE candidate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +52,7 @@ impl Myisize {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trait ManyImplTrait : MarkerTrait {
|
trait ManyImplTrait {
|
||||||
fn is_str() -> bool { //~ NOTE candidate
|
fn is_str() -> bool { //~ NOTE candidate
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,12 +10,11 @@
|
||||||
|
|
||||||
// Test which of the builtin types are considered POD.
|
// Test which of the builtin types are considered POD.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
fn assert_copy<T:Copy>() { }
|
fn assert_copy<T:Copy>() { }
|
||||||
|
|
||||||
trait Dummy : MarkerTrait { }
|
trait Dummy { }
|
||||||
|
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
struct MyStruct {
|
struct MyStruct {
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Foo {
|
||||||
|
|
||||||
trait Foo : MarkerTrait {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T:Copy> Foo for T {
|
impl<T:Copy> Foo for T {
|
||||||
|
|
|
@ -12,10 +12,8 @@
|
||||||
// in this file all test the "kind" violates detected during kindck.
|
// in this file all test the "kind" violates detected during kindck.
|
||||||
// See all `regions-bounded-by-send.rs`
|
// See all `regions-bounded-by-send.rs`
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
fn assert_send<T:Send>() { }
|
fn assert_send<T:Send>() { }
|
||||||
trait Dummy : MarkerTrait { }
|
trait Dummy { }
|
||||||
trait Message : Send { }
|
trait Message : Send { }
|
||||||
|
|
||||||
// careful with object types, who knows what they close over...
|
// careful with object types, who knows what they close over...
|
||||||
|
|
|
@ -12,10 +12,8 @@
|
||||||
// is broken into two parts because some errors occur in distinct
|
// is broken into two parts because some errors occur in distinct
|
||||||
// phases in the compiler. See kindck-send-object2.rs as well!
|
// phases in the compiler. See kindck-send-object2.rs as well!
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
fn assert_send<T:Send+'static>() { }
|
fn assert_send<T:Send+'static>() { }
|
||||||
trait Dummy : MarkerTrait { }
|
trait Dummy { }
|
||||||
|
|
||||||
// careful with object types, who knows what they close over...
|
// careful with object types, who knows what they close over...
|
||||||
fn test51<'a>() {
|
fn test51<'a>() {
|
||||||
|
|
|
@ -10,10 +10,8 @@
|
||||||
|
|
||||||
// Continue kindck-send-object1.rs.
|
// Continue kindck-send-object1.rs.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
fn assert_send<T:Send>() { }
|
fn assert_send<T:Send>() { }
|
||||||
trait Dummy : MarkerTrait { }
|
trait Dummy { }
|
||||||
|
|
||||||
fn test50() {
|
fn test50() {
|
||||||
assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Sync` is not implemented
|
assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Sync` is not implemented
|
||||||
|
|
|
@ -105,7 +105,7 @@ impl PrivTrait for (Private<isize>,) {
|
||||||
fn bar(&self) -> Private<isize> { panic!() }
|
fn bar(&self) -> Private<isize> { panic!() }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait ParamTrait<T> : marker::MarkerTrait {
|
pub trait ParamTrait<T> {
|
||||||
fn foo() -> T;
|
fn foo() -> T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,7 @@
|
||||||
// Test that an object type `Box<Foo>` is not considered to implement the
|
// Test that an object type `Box<Foo>` is not considered to implement the
|
||||||
// trait `Foo`. Issue #5087.
|
// trait `Foo`. Issue #5087.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Foo {}
|
||||||
|
|
||||||
trait Foo : MarkerTrait {}
|
|
||||||
fn take_foo<F:Foo>(f: F) {}
|
fn take_foo<F:Foo>(f: F) {}
|
||||||
fn take_object(f: Box<Foo>) { take_foo(f); }
|
fn take_object(f: Box<Foo>) { take_foo(f); }
|
||||||
//~^ ERROR the trait `Foo` is not implemented
|
//~^ ERROR the trait `Foo` is not implemented
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// Check that we correctly prevent users from making trait objects
|
// Check that we correctly prevent users from making trait objects
|
||||||
// from traits with static methods.
|
// from traits with static methods.
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {
|
trait Foo {
|
||||||
fn foo();
|
fn foo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,9 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::{MarkerTrait, PhantomData};
|
use std::marker::{PhantomData};
|
||||||
|
|
||||||
unsafe trait Zen: MarkerTrait {}
|
unsafe trait Zen {}
|
||||||
|
|
||||||
unsafe impl Zen for .. {}
|
unsafe impl Zen for .. {}
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
|
|
||||||
// public type, private value
|
// public type, private value
|
||||||
pub mod foo1 {
|
pub mod foo1 {
|
||||||
use std::marker::MarkerTrait;
|
pub trait Bar {
|
||||||
|
|
||||||
pub trait Bar : MarkerTrait {
|
|
||||||
}
|
}
|
||||||
pub struct Baz;
|
pub struct Baz;
|
||||||
|
|
||||||
|
@ -41,7 +39,7 @@ fn test_list1() {
|
||||||
|
|
||||||
// private type, public value
|
// private type, public value
|
||||||
pub mod foo2 {
|
pub mod foo2 {
|
||||||
trait Bar : ::std::marker::MarkerTrait {
|
trait Bar {
|
||||||
}
|
}
|
||||||
pub struct Baz;
|
pub struct Baz;
|
||||||
|
|
||||||
|
@ -62,7 +60,7 @@ fn test_list2() {
|
||||||
|
|
||||||
// neither public
|
// neither public
|
||||||
pub mod foo3 {
|
pub mod foo3 {
|
||||||
trait Bar : ::std::marker::MarkerTrait {
|
trait Bar {
|
||||||
}
|
}
|
||||||
pub struct Baz;
|
pub struct Baz;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// Test that attempts to implicitly coerce a value into an
|
// Test that attempts to implicitly coerce a value into an
|
||||||
// object respect the lifetime bound on the object type.
|
// object respect the lifetime bound on the object type.
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {}
|
trait Foo {}
|
||||||
impl<'a> Foo for &'a [u8] {}
|
impl<'a> Foo for &'a [u8] {}
|
||||||
|
|
||||||
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
|
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
|
|
||||||
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
|
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait X {}
|
||||||
|
|
||||||
trait X : MarkerTrait {}
|
|
||||||
|
|
||||||
trait Iter {
|
trait Iter {
|
||||||
type Item: X;
|
type Item: X;
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
#![feature(box_syntax)]
|
#![feature(box_syntax)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Foo { }
|
||||||
|
|
||||||
trait Foo : MarkerTrait { }
|
|
||||||
|
|
||||||
impl<'a> Foo for &'a isize { }
|
impl<'a> Foo for &'a isize { }
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
trait TraitNotAStruct : ::std::marker::MarkerTrait { }
|
trait TraitNotAStruct {}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
TraitNotAStruct{ value: 0 };
|
TraitNotAStruct{ value: 0 };
|
||||||
|
|
|
@ -8,9 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Trait {}
|
||||||
|
|
||||||
trait Trait : MarkerTrait {}
|
|
||||||
|
|
||||||
struct Foo<T:Trait> {
|
struct Foo<T:Trait> {
|
||||||
x: T,
|
x: T,
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
// Tests for "default" bounds inferred for traits with no bounds list.
|
// Tests for "default" bounds inferred for traits with no bounds list.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Foo {}
|
||||||
|
|
||||||
trait Foo : MarkerTrait {}
|
|
||||||
|
|
||||||
fn a(_x: Box<Foo+Send>) {
|
fn a(_x: Box<Foo+Send>) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
// trait impl is only applied to a trait object, not concrete types which implement
|
// trait impl is only applied to a trait object, not concrete types which implement
|
||||||
// the trait.
|
// the trait.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait T {}
|
||||||
|
|
||||||
trait T : MarkerTrait {}
|
|
||||||
|
|
||||||
impl<'a> T+'a {
|
impl<'a> T+'a {
|
||||||
fn foo(&self) {}
|
fn foo(&self) {}
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::num::Int;
|
use std::ops::Add;
|
||||||
|
|
||||||
trait BrokenAdd: Int {
|
trait BrokenAdd: Copy + Add<Output=Self> {
|
||||||
fn broken_add<T>(&self, rhs: T) -> Self {
|
fn broken_add<T>(&self, rhs: T) -> Self {
|
||||||
*self + rhs //~ ERROR mismatched types
|
*self + rhs //~ ERROR mismatched types
|
||||||
//~| expected `Self`
|
//~| expected `Self`
|
||||||
|
@ -20,7 +20,7 @@ trait BrokenAdd: Int {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Int> BrokenAdd for T {}
|
impl<T: Copy + Add<Output=T>> BrokenAdd for T {}
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let foo: u8 = 0;
|
let foo: u8 = 0;
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait MyTrait {}
|
||||||
|
|
||||||
trait MyTrait: MarkerTrait {}
|
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait MyTrait {}
|
||||||
|
|
||||||
trait MyTrait: MarkerTrait {}
|
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
impl<T> !MyTrait for *mut T {}
|
impl<T> !MyTrait for *mut T {}
|
||||||
|
|
|
@ -10,13 +10,11 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait MyTrait {}
|
||||||
|
|
||||||
trait MyTrait: MarkerTrait {}
|
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
|
|
||||||
unsafe trait MyUnsafeTrait: MarkerTrait {}
|
unsafe trait MyUnsafeTrait {}
|
||||||
|
|
||||||
unsafe impl MyUnsafeTrait for .. {}
|
unsafe impl MyUnsafeTrait for .. {}
|
||||||
|
|
||||||
|
|
|
@ -15,15 +15,13 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait Defaulted { }
|
||||||
|
|
||||||
trait Defaulted : MarkerTrait { }
|
|
||||||
impl Defaulted for .. { }
|
impl Defaulted for .. { }
|
||||||
impl<'a,T:Signed> Defaulted for &'a T { }
|
impl<'a,T:Signed> Defaulted for &'a T { }
|
||||||
impl<'a,T:Signed> Defaulted for &'a mut T { }
|
impl<'a,T:Signed> Defaulted for &'a mut T { }
|
||||||
fn is_defaulted<T:Defaulted>() { }
|
fn is_defaulted<T:Defaulted>() { }
|
||||||
|
|
||||||
trait Signed : MarkerTrait { }
|
trait Signed { }
|
||||||
impl Signed for i32 { }
|
impl Signed for i32 { }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait MyTrait : 'static {}
|
trait MyTrait : 'static {}
|
||||||
|
|
||||||
impl MyTrait for .. {}
|
impl MyTrait for .. {}
|
||||||
|
|
|
@ -13,9 +13,7 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait NotImplemented { }
|
||||||
|
|
||||||
trait NotImplemented: MarkerTrait { }
|
|
||||||
|
|
||||||
trait MyTrait : NotImplemented {}
|
trait MyTrait : NotImplemented {}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,9 @@
|
||||||
|
|
||||||
#![feature(optin_builtin_traits)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait NotImplemented { }
|
||||||
|
|
||||||
trait NotImplemented: MarkerTrait { }
|
trait MyTrait
|
||||||
|
|
||||||
trait MyTrait: MarkerTrait
|
|
||||||
where Option<Self> : NotImplemented
|
where Option<Self> : NotImplemented
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
// Test `?Sized` local variables.
|
// Test `?Sized` local variables.
|
||||||
|
|
||||||
use std::marker;
|
trait T {}
|
||||||
|
|
||||||
trait T : marker::MarkerTrait { }
|
|
||||||
|
|
||||||
fn f1<X: ?Sized>(x: &X) {
|
fn f1<X: ?Sized>(x: &X) {
|
||||||
let _: X; // <-- this is OK, no bindings created, no initializer.
|
let _: X; // <-- this is OK, no bindings created, no initializer.
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
// Test sized-ness checking in substitution in impls.
|
// Test sized-ness checking in substitution in impls.
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
trait T {}
|
||||||
|
|
||||||
trait T : MarkerTrait {}
|
|
||||||
|
|
||||||
// I would like these to fail eventually.
|
// I would like these to fail eventually.
|
||||||
// impl - bounded
|
// impl - bounded
|
||||||
|
|
|
@ -25,8 +25,6 @@ use sub::sub2 as msalias;
|
||||||
use sub::sub2;
|
use sub::sub2;
|
||||||
use sub::sub2::nested_struct as sub_struct;
|
use sub::sub2::nested_struct as sub_struct;
|
||||||
use std::num::One;
|
use std::num::One;
|
||||||
use std::num::cast;
|
|
||||||
use std::num::{from_int,from_i8,from_i32};
|
|
||||||
|
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
|
|
||||||
|
@ -42,7 +40,6 @@ fn test_alias<I: Iterator>(i: Option<<I as Iterator>::Item>) {
|
||||||
|
|
||||||
// import tests
|
// import tests
|
||||||
fn foo(x: &One) {}
|
fn foo(x: &One) {}
|
||||||
let _: Option<u8> = from_i32(45);
|
|
||||||
|
|
||||||
let x = 42;
|
let x = 42;
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
trait Foo {
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait Foo : MarkerTrait {
|
|
||||||
type T;
|
type T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,10 +13,6 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
impl X for f64 { type Y = isize; }
|
impl X for f64 { type Y = isize; }
|
||||||
trait X : MarkerTrait { type Y; }
|
trait X { type Y; }
|
||||||
fn main() {}
|
fn main() {}
|
||||||
|
|
|
@ -14,10 +14,9 @@
|
||||||
|
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
use std::slice;
|
use std::slice;
|
||||||
|
|
||||||
trait Bound : MarkerTrait {}
|
trait Bound {}
|
||||||
|
|
||||||
impl<'a> Bound for &'a i32 {}
|
impl<'a> Bound for &'a i32 {}
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,9 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
pub trait Integral {
|
||||||
|
|
||||||
pub trait Integral : MarkerTrait {
|
|
||||||
type Opposite;
|
type Opposite;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,17 +12,14 @@
|
||||||
// `Item` originates in a where-clause, not the declaration of
|
// `Item` originates in a where-clause, not the declaration of
|
||||||
// `T`. Issue #20300.
|
// `T`. Issue #20300.
|
||||||
|
|
||||||
|
use std::marker::{PhantomData};
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::{MarkerTrait, PhantomData};
|
|
||||||
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
|
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
|
||||||
use std::sync::atomic::Ordering::SeqCst;
|
use std::sync::atomic::Ordering::SeqCst;
|
||||||
|
|
||||||
static COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
static COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||||
|
|
||||||
// Preamble.
|
// Preamble.
|
||||||
trait Trait : MarkerTrait { type Item; }
|
trait Trait { type Item; }
|
||||||
struct Struct;
|
struct Struct;
|
||||||
impl Trait for Struct {
|
impl Trait for Struct {
|
||||||
type Item = u32;
|
type Item = u32;
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
macro_rules! assert_approx_eq {
|
macro_rules! assert_approx_eq {
|
||||||
($a:expr, $b:expr) => ({
|
($a:expr, $b:expr) => ({
|
||||||
use std::num::Float;
|
|
||||||
let (a, b) = (&$a, &$b);
|
let (a, b) = (&$a, &$b);
|
||||||
assert!((*a - *b).abs() < 1.0e-6,
|
assert!((*a - *b).abs() < 1.0e-6,
|
||||||
"{} is not approximately equal to {}", *a, *b);
|
"{} is not approximately equal to {}", *a, *b);
|
||||||
|
|
|
@ -31,7 +31,6 @@ enum Bar {
|
||||||
Quux(u32),
|
Quux(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(FromPrimitive)]
|
|
||||||
enum Baz { A=0, B=5, }
|
enum Baz { A=0, B=5, }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
// Copyright 2013-2014 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(core)]
|
|
||||||
|
|
||||||
use std::num::FromPrimitive;
|
|
||||||
use std::isize;
|
|
||||||
|
|
||||||
#[derive(PartialEq, FromPrimitive, Debug)]
|
|
||||||
enum A {
|
|
||||||
Foo = isize::MAX,
|
|
||||||
Bar = 1,
|
|
||||||
Baz = 3,
|
|
||||||
Qux,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
let x: Option<A> = FromPrimitive::from_int(isize::MAX);
|
|
||||||
assert_eq!(x, Some(A::Foo));
|
|
||||||
|
|
||||||
let x: Option<A> = FromPrimitive::from_int(1);
|
|
||||||
assert_eq!(x, Some(A::Bar));
|
|
||||||
|
|
||||||
let x: Option<A> = FromPrimitive::from_int(3);
|
|
||||||
assert_eq!(x, Some(A::Baz));
|
|
||||||
|
|
||||||
let x: Option<A> = FromPrimitive::from_int(4);
|
|
||||||
assert_eq!(x, Some(A::Qux));
|
|
||||||
|
|
||||||
let x: Option<A> = FromPrimitive::from_int(5);
|
|
||||||
assert_eq!(x, None);
|
|
||||||
}
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
use std::num::Int;
|
use std::ops::Add;
|
||||||
|
|
||||||
fn wsucc<T:Int>(n: T) -> T { n + { return n } }
|
fn wsucc<T:Add<Output=T> + Copy>(n: T) -> T { n + { return n } }
|
||||||
|
|
||||||
pub fn main() { }
|
pub fn main() { }
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
// Copyright 2014 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(std_misc)]
|
|
||||||
|
|
||||||
use std::num::strconv::ExponentFormat::{ExpBin, ExpDec};
|
|
||||||
use std::num::strconv::SignificantDigits::DigMax;
|
|
||||||
use std::num::strconv::SignFormat::{SignAll, SignNeg};
|
|
||||||
use std::num::strconv::float_to_str_common as to_string;
|
|
||||||
|
|
||||||
macro_rules! t {
|
|
||||||
($a:expr, $b:expr) => { { let (r, _) = $a; assert_eq!(r, $b.to_string()); } }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn main() {
|
|
||||||
// Basic usage
|
|
||||||
t!(to_string(1.2345678e-5f64, 10, true, SignNeg, DigMax(6), ExpDec, false),
|
|
||||||
"1.234568e-5");
|
|
||||||
|
|
||||||
// Hexadecimal output
|
|
||||||
t!(to_string(7.281738281250e+01f64, 16, true, SignAll, DigMax(6), ExpBin, false),
|
|
||||||
"+1.2345p+6");
|
|
||||||
t!(to_string(-1.777768135071e-02f64, 16, true, SignAll, DigMax(6), ExpBin, false),
|
|
||||||
"-1.2345p-6");
|
|
||||||
|
|
||||||
// Some denormals
|
|
||||||
t!(to_string(4.9406564584124654e-324f64, 10, true, SignNeg, DigMax(6), ExpBin, false),
|
|
||||||
"1p-1074");
|
|
||||||
t!(to_string(2.2250738585072009e-308f64, 10, true, SignNeg, DigMax(6), ExpBin, false),
|
|
||||||
"1p-1022");
|
|
||||||
}
|
|
|
@ -8,12 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
trait A {
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait A : MarkerTrait {
|
|
||||||
extern "fastcall" fn test1(i: i32);
|
extern "fastcall" fn test1(i: i32);
|
||||||
extern fn test2(i: i32);
|
extern fn test2(i: i32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,17 +8,14 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
use std::f64;
|
||||||
#![feature(std_misc)]
|
|
||||||
|
|
||||||
use std::num::Float;
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let nan: f64 = Float::nan();
|
let nan: f64 = f64::NAN;
|
||||||
assert!((nan).is_nan());
|
assert!((nan).is_nan());
|
||||||
|
|
||||||
let inf: f64 = Float::infinity();
|
let inf: f64 = f64::INFINITY;
|
||||||
let neg_inf: f64 = Float::neg_infinity();
|
let neg_inf: f64 = -f64::INFINITY;
|
||||||
assert_eq!(-inf, neg_inf);
|
assert_eq!(-inf, neg_inf);
|
||||||
|
|
||||||
assert!( nan != nan);
|
assert!( nan != nan);
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
macro_rules! assert_approx_eq {
|
macro_rules! assert_approx_eq {
|
||||||
($a:expr, $b:expr) => ({
|
($a:expr, $b:expr) => ({
|
||||||
use std::num::Float;
|
|
||||||
let (a, b) = (&$a, &$b);
|
let (a, b) = (&$a, &$b);
|
||||||
assert!((*a - *b).abs() < 1.0e-6,
|
assert!((*a - *b).abs() < 1.0e-6,
|
||||||
"{} is not approximately equal to {}", *a, *b);
|
"{} is not approximately equal to {}", *a, *b);
|
||||||
|
|
|
@ -12,10 +12,7 @@
|
||||||
|
|
||||||
#![feature(collections)]
|
#![feature(collections)]
|
||||||
|
|
||||||
extern crate collections;
|
|
||||||
|
|
||||||
use std::collections::BitVec;
|
use std::collections::BitVec;
|
||||||
use std::num::Float;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Generate sieve of Eratosthenes for n up to 1e6
|
// Generate sieve of Eratosthenes for n up to 1e6
|
||||||
|
|
|
@ -10,11 +10,7 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
trait Foo {
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait Foo : MarkerTrait {
|
|
||||||
fn quux(u8) {}
|
fn quux(u8) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,35 +8,30 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
#![feature(zero_one)]
|
||||||
|
|
||||||
#![feature(core)]
|
use std::num::Zero;
|
||||||
|
|
||||||
use std::num::Int;
|
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
|
||||||
// Avoid using constants, which would trigger compile-time errors.
|
|
||||||
fn min_val<T: Int>() -> T { Int::min_value() }
|
|
||||||
fn zero<T: Int>() -> T { Int::zero() }
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
assert!(thread::spawn(move|| { min_val::<isize>() / -1; }).join().is_err());
|
assert!(thread::spawn(move|| { isize::min_value() / -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i8>() / -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i8::min_value() / -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i16>() / -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i16::min_value() / -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i32>() / -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i32::min_value() / -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i64>() / -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i64::min_value() / -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1isize / zero::<isize>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1isize / isize::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i8 / zero::<i8>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i8 / i8::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i16 / zero::<i16>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i16 / i16::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i32 / zero::<i32>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i32 / i32::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i64 / zero::<i64>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i64 / i64::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<isize>() % -1; }).join().is_err());
|
assert!(thread::spawn(move|| { isize::min_value() % -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i8>() % -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i8::min_value() % -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i16>() % -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i16::min_value() % -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i32>() % -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i32::min_value() % -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { min_val::<i64>() % -1; }).join().is_err());
|
assert!(thread::spawn(move|| { i64::min_value() % -1; }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1isize % zero::<isize>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1isize % isize::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i8 % zero::<i8>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i8 % i8::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i16 % zero::<i16>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i16 % i16::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i32 % zero::<i32>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i32 % i32::zero(); }).join().is_err());
|
||||||
assert!(thread::spawn(move|| { 1i64 % zero::<i64>(); }).join().is_err());
|
assert!(thread::spawn(move|| { 1i64 % i64::zero(); }).join().is_err());
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,7 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
trait Serializer {
|
||||||
|
|
||||||
use std::marker::MarkerTrait;
|
|
||||||
|
|
||||||
trait Serializer : MarkerTrait {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
trait Serializable {
|
trait Serializable {
|
||||||
|
|
|
@ -15,11 +15,7 @@
|
||||||
// necessary. Testing the methods of the impls is done within the source
|
// necessary. Testing the methods of the impls is done within the source
|
||||||
// file for each numeric type.
|
// file for each numeric type.
|
||||||
|
|
||||||
|
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
use std::ops::Add;
|
use std::ops::Add;
|
||||||
use std::num::ToPrimitive;
|
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
// ints
|
// ints
|
||||||
|
@ -37,9 +33,4 @@ pub fn main() {
|
||||||
assert_eq!(15_u16.add(6u16), 21_u16);
|
assert_eq!(15_u16.add(6u16), 21_u16);
|
||||||
assert_eq!(15_u32.add(6u32), 21_u32);
|
assert_eq!(15_u32.add(6u32), 21_u32);
|
||||||
assert_eq!(15_u64.add(6u64), 21_u64);
|
assert_eq!(15_u64.add(6u64), 21_u64);
|
||||||
|
|
||||||
// floats
|
|
||||||
// num
|
|
||||||
assert_eq!(10_f32.to_i32().unwrap(), 10);
|
|
||||||
assert_eq!(10_f64.to_i32().unwrap(), 10);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::num::ToPrimitive;
|
|
||||||
|
|
||||||
#[derive(PartialEq, Debug)]
|
#[derive(PartialEq, Debug)]
|
||||||
struct Point {
|
struct Point {
|
||||||
|
@ -23,9 +22,6 @@ struct Point {
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let box_5: Box<_> = box 5_usize;
|
let box_5: Box<_> = box 5_usize;
|
||||||
assert_eq!(Rc::new(5_usize).to_uint(), Some(5));
|
|
||||||
// FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
|
|
||||||
assert_eq!((Box::new(&Box::new(&Rc::new(Box::new(Box::new(&box_5)))))).to_uint(), Some(5));
|
|
||||||
let point = Rc::new(Point {x: 2, y: 4});
|
let point = Rc::new(Point {x: 2, y: 4});
|
||||||
assert_eq!(point.x, 2);
|
assert_eq!(point.x, 2);
|
||||||
assert_eq!(point.y, 4);
|
assert_eq!(point.y, 4);
|
||||||
|
|
|
@ -10,15 +10,13 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(optin_builtin_traits, core)]
|
#![feature(optin_builtin_traits)]
|
||||||
|
|
||||||
use std::marker::{MarkerTrait, Send};
|
|
||||||
|
|
||||||
struct TestType;
|
struct TestType;
|
||||||
|
|
||||||
impl TestType {}
|
impl TestType {}
|
||||||
|
|
||||||
trait TestTrait : MarkerTrait {}
|
trait TestTrait {}
|
||||||
|
|
||||||
impl !Send for TestType {}
|
impl !Send for TestType {}
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
trait Foo {
|
||||||
|
|
||||||
trait Foo : ::std::marker::MarkerTrait {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn b(_x: Box<Foo+Send>) {
|
fn b(_x: Box<Foo+Send>) {
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
|
|
||||||
#![feature(core)]
|
#![feature(core)]
|
||||||
|
|
||||||
trait U : ::std::marker::MarkerTrait {}
|
trait U {}
|
||||||
trait T<X: U> { fn get(self) -> X; }
|
trait T<X: U> { fn get(self) -> X; }
|
||||||
|
|
||||||
trait S2<Y: U> : ::std::marker::MarkerTrait {
|
trait S2<Y: U> {
|
||||||
fn m(x: Box<T<Y>+'static>) {}
|
fn m(x: Box<T<Y>+'static>) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,21 +10,19 @@
|
||||||
|
|
||||||
// pretty-expanded FIXME #23616
|
// pretty-expanded FIXME #23616
|
||||||
|
|
||||||
#![feature(core)]
|
|
||||||
|
|
||||||
trait I { fn i(&self) -> Self; }
|
trait I { fn i(&self) -> Self; }
|
||||||
|
|
||||||
trait A<T:I> : ::std::marker::MarkerTrait {
|
trait A<T:I> {
|
||||||
fn id(x:T) -> T { x.i() }
|
fn id(x:T) -> T { x.i() }
|
||||||
}
|
}
|
||||||
|
|
||||||
trait J<T> { fn j(&self) -> T; }
|
trait J<T> { fn j(&self) -> T; }
|
||||||
|
|
||||||
trait B<T:J<T>> : ::std::marker::MarkerTrait {
|
trait B<T:J<T>> {
|
||||||
fn id(x:T) -> T { x.j() }
|
fn id(x:T) -> T { x.j() }
|
||||||
}
|
}
|
||||||
|
|
||||||
trait C : ::std::marker::MarkerTrait {
|
trait C {
|
||||||
fn id<T:J<T>>(x:T) -> T { x.j() }
|
fn id<T:J<T>>(x:T) -> T { x.j() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue