mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-03 02:23:20 +00:00
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:
commit
1095bb1eb2
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user