]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #103445 - fmease:fix-50291, r=estebank
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Fri, 11 Nov 2022 15:21:38 +0000 (20:51 +0530)
committerGitHub <noreply@github.com>
Fri, 11 Nov 2022 15:21:38 +0000 (20:51 +0530)
`#[test]`: Point at return type if `Termination` bound is unsatisfied

Together with #103142 (already merged) this fully fixes #50291.

I don't consider my current solution of changing a few spans “here and there” very clean since the\rfailed obligation is a `FunctionArgumentObligation` and we point at a type instead of a function argument.

If you agree with me on this point, I can offer to keep the spans of the existing nodes and instead inject\r`let _: AssertRetTyIsTermination<$ret_ty>;` (type to be defined in `libtest`) similar to `AssertParamIsEq` etc.\rused by some built-in derive-macros.

I haven't tried that approach yet though and cannot promise that it would actually work out or\rbe “cleaner” for that matter.

````@rustbot```` label A-libtest A-diagnostics
r? ````@estebank````

1  2 
compiler/rustc_builtin_macros/src/test.rs