Stabilize universal_impl_trait

This commit is contained in:
Taylor Cramer 2018-03-21 17:44:21 -07:00
parent 445fafaa4b
commit c393db67ba
31 changed files with 15 additions and 108 deletions

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Debug;
trait Foo {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Debug;
trait Foo {

View file

@ -10,7 +10,7 @@
//! A simple test for testing many permutations of allowedness of
//! impl Trait
#![feature(conservative_impl_trait, universal_impl_trait, dyn_trait)]
#![feature(conservative_impl_trait, dyn_trait)]
use std::fmt::Debug;
// Allowed

View file

@ -12,7 +12,6 @@
//[nll] compile-flags: -Znll -Zborrowck=mir
#![feature(conservative_impl_trait,
universal_impl_trait,
fn_traits,
step_trait,
unboxed_closures,

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(conservative_impl_trait, underscore_lifetimes, universal_impl_trait)]
#![feature(conservative_impl_trait, underscore_lifetimes)]
#![allow(warnings)]
use std::fmt::Debug;

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
fn hrtb(f: impl Fn(&u32) -> u32) -> u32 {
f(&22) + f(&44)
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
fn hrtb(f: impl for<'a> Fn(&'a u32) -> &'a u32) -> u32 {
f(&22) + f(&44)
}

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Display;
fn check_display_eq(iter: &Vec<impl Display>) {

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Display;
fn check_display_eq(iter: impl IntoIterator<Item = impl Display>) {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Debug;
trait InTraitDefnParameters {

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Display;
fn foo(f: impl Display + Clone) -> String {

View file

@ -9,7 +9,7 @@
// except according to those terms.
#![allow(warnings)]
#![feature(in_band_lifetimes, universal_impl_trait, conservative_impl_trait)]
#![feature(in_band_lifetimes, conservative_impl_trait)]
fn foo(x: &'x u8) -> &'x u8 { x }
fn foo2(x: &'a u8, y: &u8) -> &'a u8 { x }

View file

@ -8,7 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
#![feature(conservative_impl_trait)]
#![deny(non_camel_case_types)]

View file

@ -8,5 +8,4 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
pub fn ice(f: impl Fn()) {}

View file

@ -1,16 +0,0 @@
// Copyright 2017 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.
// gate-test-universal_impl_trait
fn foo(x: impl std::fmt::Debug) { print!("{:?}", x); }
//~^ ERROR `impl Trait` in argument position is experimental
fn main() {}

View file

@ -1,11 +0,0 @@
error[E0658]: `impl Trait` in argument position is experimental (see issue #34511)
--> $DIR/feature-gate-universal.rs:13:11
|
LL | fn foo(x: impl std::fmt::Debug) { print!("{:?}", x); }
| ^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(universal_impl_trait)] to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Debug;
fn foo(x: impl Debug) -> String {

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/universal-mismatched-type.rs:16:5
--> $DIR/universal-mismatched-type.rs:14:5
|
LL | fn foo(x: impl Debug) -> String {
| ------ expected `std::string::String` because of return type

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Debug;
fn foo(x: impl Debug, y: impl Debug) -> String {

View file

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/universal-two-impl-traits.rs:17:9
--> $DIR/universal-two-impl-traits.rs:15:9
|
LL | a = y; //~ ERROR mismatched
| ^ expected type parameter, found a different type parameter

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(universal_impl_trait)]
use std::fmt::Display;
fn foo(f: impl Display + Clone) -> String {

View file

@ -1,11 +1,11 @@
error[E0425]: cannot find function `wants_clone` in this scope
--> $DIR/universal_wrong_bounds.rs:18:5
--> $DIR/universal_wrong_bounds.rs:16:5
|
LL | wants_clone(f); //~ ERROR cannot find
| ^^^^^^^^^^^ did you mean `wants_cone`?
error[E0405]: cannot find trait `Debug` in this scope
--> $DIR/universal_wrong_bounds.rs:21:24
--> $DIR/universal_wrong_bounds.rs:19:24
|
LL | fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
| ^^^^^ not found in this scope
@ -15,7 +15,7 @@ LL | use std::fmt::Debug;
|
error[E0405]: cannot find trait `Debug` in this scope
--> $DIR/universal_wrong_bounds.rs:22:26
--> $DIR/universal_wrong_bounds.rs:20:26
|
LL | fn wants_display(g: impl Debug) { } //~ ERROR cannot find
| ^^^^^ not found in this scope

View file

@ -7,7 +7,7 @@
// <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(dyn_trait, conservative_impl_trait, universal_impl_trait)]
#![feature(dyn_trait, conservative_impl_trait)]
use std::fmt::Debug;
use std::option;

View file

@ -9,7 +9,7 @@
// except according to those terms.
#![allow(warnings)]
#![feature(in_band_lifetimes, universal_impl_trait)]
#![feature(in_band_lifetimes)]
fn bar<F>(x: &F) where F: Fn(&'a u32) {} //~ ERROR must be explicitly

View file

@ -7,7 +7,7 @@
// <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(conservative_impl_trait, universal_impl_trait)]
#![feature(conservative_impl_trait)]
use std::fmt::Debug;