Rollup merge of #88159 - spastorino:fix-unused-generic-param-test, r=oli-obk

Use a trait instead of the now disallowed missing trait there

To properly test the unused generic parameter and just that we need to use a trait in the tait. Missing the trait there is already tested and is not what we meant to test here.

r? `@oli-obk`
This commit is contained in:
Guillaume Gomez 2021-08-19 19:30:12 +02:00 committed by GitHub
commit 1095bb1eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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