mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
22 lines
351 B
Rust
22 lines
351 B
Rust
// Checks that a sibling function (i.e. `foo`) cannot constrain
|
|
// an RPITIT from another function (`bar`).
|
|
|
|
trait Trait {
|
|
fn foo();
|
|
|
|
fn bar() -> impl Sized;
|
|
}
|
|
|
|
impl Trait for () {
|
|
fn foo() {
|
|
let _: String = Self::bar();
|
|
//~^ ERROR mismatched types
|
|
}
|
|
|
|
fn bar() -> impl Sized {
|
|
loop {}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|