Use a trait instead of the now disallowed missing trait there

This commit is contained in:
Santiago Pastorino 2021-08-19 10:48:20 -03:00
parent d488de82f3
commit df8a64327c
No known key found for this signature in database
GPG Key ID: 8131A24E0C79EFAF
2 changed files with 5 additions and 18 deletions

View File

@ -1,16 +1,17 @@
// check-pass
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]
fn main() {}
type PartiallyDefined<T> = impl 'static;
//~^ ERROR: at least one trait must be specified
type PartiallyDefined<T> = impl Sized;
fn partially_defined<T: std::fmt::Debug>(_: T) -> PartiallyDefined<T> {
4u32
}
type PartiallyDefined2<T> = impl 'static;
//~^ ERROR: at least one trait must be specified
type PartiallyDefined2<T> = impl Sized;
fn partially_defined2<T: std::fmt::Debug>(_: T) -> PartiallyDefined2<T> {
4u32

View File

@ -1,14 +0,0 @@
error: at least one trait must be specified
--> $DIR/unused_generic_param.rs:5:28
|
LL | type PartiallyDefined<T> = impl 'static;
| ^^^^^^^^^^^^
error: at least one trait must be specified
--> $DIR/unused_generic_param.rs:12:29
|
LL | type PartiallyDefined2<T> = impl 'static;
| ^^^^^^^^^^^^
error: aborting due to 2 previous errors