summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfc-1937-termination-trait/issue-103052-1.rs
blob: a75c91cc90df7355ff06cd92cc0e46f1b6f0e558 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Check that we don't blindly emit a diagnostic claiming that "`main` has an invalid return type"
// if we encounter a type that doesn't implement `std::process::Termination` and is not actually
// the return type of the program entry `main`.

fn receive(_: impl std::process::Termination) {}

struct Something;

fn main() {
    receive(Something); //~ ERROR the trait bound `Something: Termination` is not satisfied
}