Files
rust/tests/ui/generics/trait-incorrect-generic-args.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
428 B
Rust
Raw Normal View History

2025-07-01 19:28:38 +05:00
//! Check for compilation errors when a trait is used with an incorrect number of generic arguments.
fn main() {
2025-07-01 19:28:38 +05:00
trait Seq {}
impl<T> Seq<T> for Vec<T> {
//~^ ERROR trait takes 0 generic arguments but 1 generic argument
/* ... */
}
impl Seq<bool> for u32 {
//~^ ERROR trait takes 0 generic arguments but 1 generic argument
/* Treat the integer as a sequence of bits */
}
}