Stabilize universal_impl_trait
This commit is contained in:
parent
445fafaa4b
commit
c393db67ba
31 changed files with 15 additions and 108 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
//[nll] compile-flags: -Znll -Zborrowck=mir
|
||||
|
||||
#![feature(conservative_impl_trait,
|
||||
universal_impl_trait,
|
||||
fn_traits,
|
||||
step_trait,
|
||||
unboxed_closures,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>) {
|
||||
|
|
|
|||
|
|
@ -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>) {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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)]
|
||||
|
||||
|
|
|
|||
|
|
@ -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()) {}
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
@ -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`.
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue