mirror of
https://git.proxmox.com/git/rustc
synced 2025-10-14 23:51:51 +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() {}
|