mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
Add a regression test for issue-74244
This commit is contained in:
parent
50ffd6b7cb
commit
d4fdf6e754
20
src/test/ui/type-alias-impl-trait/issue-74244.rs
Normal file
20
src/test/ui/type-alias-impl-trait/issue-74244.rs
Normal file
@ -0,0 +1,20 @@
|
||||
#![feature(type_alias_impl_trait)]
|
||||
|
||||
trait Allocator {
|
||||
type Buffer;
|
||||
}
|
||||
|
||||
struct DefaultAllocator;
|
||||
|
||||
impl<T> Allocator for DefaultAllocator {
|
||||
//~^ ERROR: the type parameter `T` is not constrained
|
||||
type Buffer = ();
|
||||
}
|
||||
|
||||
type A = impl Fn(<DefaultAllocator as Allocator>::Buffer);
|
||||
|
||||
fn foo() -> A {
|
||||
|_| ()
|
||||
}
|
||||
|
||||
fn main() {}
|
9
src/test/ui/type-alias-impl-trait/issue-74244.stderr
Normal file
9
src/test/ui/type-alias-impl-trait/issue-74244.stderr
Normal file
@ -0,0 +1,9 @@
|
||||
error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
|
||||
--> $DIR/issue-74244.rs:9:6
|
||||
|
|
||||
LL | impl<T> Allocator for DefaultAllocator {
|
||||
| ^ unconstrained type parameter
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0207`.
|
Loading…
Reference in New Issue
Block a user