2024-02-16 20:02:50 +00:00
|
|
|
//@ edition:2021
|
2021-03-16 20:47:06 +00:00
|
|
|
|
|
|
|
fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
2024-10-04 14:10:28 +00:00
|
|
|
//~^ ERROR expected a type, found a trait
|
|
|
|
//~| ERROR expected a type, found a trait
|
2021-03-16 20:47:06 +00:00
|
|
|
let _x: &SomeTrait = todo!();
|
2024-10-04 14:10:28 +00:00
|
|
|
//~^ ERROR expected a type, found a trait
|
2021-03-16 20:47:06 +00:00
|
|
|
}
|
|
|
|
|
2025-03-08 19:44:43 +00:00
|
|
|
// Regression test for <https://github.com/rust-lang/rust/issues/138211>.
|
|
|
|
extern "C" {
|
|
|
|
fn foo() -> *const SomeTrait;
|
|
|
|
//~^ ERROR expected a type, found a trait
|
|
|
|
}
|
|
|
|
|
2021-03-16 20:47:06 +00:00
|
|
|
trait SomeTrait {}
|
|
|
|
|
|
|
|
fn main() {}
|