]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / rfc-1937-termination-trait / issue-103052-1.rs
1 // Check that we don't blindly emit a diagnostic claiming that "`main` has an invalid return type"
2 // if we encounter a type that doesn't implement `std::process::Termination` and is not actually
3 // the return type of the program entry `main`.
4
5 fn receive(_: impl std::process::Termination) {}
6
7 struct Something;
8
9 fn main() {
10     receive(Something); //~ ERROR the trait bound `Something: Termination` is not satisfied
11 }