-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#[test]
: Point at return type if Termination
bound is unsatisfied
#103445
Conversation
#[test]
: Point at return type if Termination
bound is unsatisfied
I'd love to try that out before merging this, particularly to see if this could potentially cause any perf regressions (but I don't think our perf suite will touch tests, though). I'm ok with merging this as is, but as you pointed out it doesn't feel as principled as we could be. Would you mind trying your alternatively proposed method? If you hit a wall or it doesn't pan out, we can merge this. |
Will do. I suspect though that we're gonna end up with two emitted diagnostics in the end, one from the |
Okay, so here is the alternative approach using an |
Re
Should I try seeking something else entirely (whatever that might be) or it is okay-ish to be merged? |
@bors r+ |
`#[test]`: Point at return type if `Termination` bound is unsatisfied Together with rust-lang#103142 (already merged) this fully fixes rust-lang#50291. I don't consider my current solution of changing a few spans “here and there” very clean since the failed 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 `let _: AssertRetTyIsTermination<$ret_ty>;` (type to be defined in `libtest`) similar to `AssertParamIsEq` etc. used by some built-in derive-macros. I haven't tried that approach yet though and cannot promise that it would actually work out or be “cleaner” for that matter. `@rustbot` label A-libtest A-diagnostics r? `@estebank`
`#[test]`: Point at return type if `Termination` bound is unsatisfied Together with rust-lang#103142 (already merged) this fully fixes rust-lang#50291. I don't consider my current solution of changing a few spans “here and there” very clean since the failed 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 `let _: AssertRetTyIsTermination<$ret_ty>;` (type to be defined in `libtest`) similar to `AssertParamIsEq` etc. used by some built-in derive-macros. I haven't tried that approach yet though and cannot promise that it would actually work out or be “cleaner” for that matter. ``@rustbot`` label A-libtest A-diagnostics r? ``@estebank``
`#[test]`: Point at return type if `Termination` bound is unsatisfied Together with rust-lang#103142 (already merged) this fully fixes rust-lang#50291. I don't consider my current solution of changing a few spans “here and there” very clean since the failed 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 `let _: AssertRetTyIsTermination<$ret_ty>;` (type to be defined in `libtest`) similar to `AssertParamIsEq` etc. used by some built-in derive-macros. I haven't tried that approach yet though and cannot promise that it would actually work out or be “cleaner” for that matter. ```@rustbot``` label A-libtest A-diagnostics r? ```@estebank```
Rollup of 9 pull requests Successful merges: - rust-lang#100633 (Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output`) - rust-lang#103445 (`#[test]`: Point at return type if `Termination` bound is unsatisfied) - rust-lang#103924 (Fix broken link in description of error code E0706) - rust-lang#104146 (Retry binding TCP Socket in remote-test-server) - rust-lang#104169 (Migrate `:target` rules to use CSS variables) - rust-lang#104202 (Fix ICE rust-lang#103748) - rust-lang#104216 (Don't ICE on operator trait methods with generic methods) - rust-lang#104217 (Display help message when fluent arg was referenced incorrectly) - rust-lang#104245 (Reduce default configuration's dependency upon static libstdcpp library (rust-lang#103606)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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
failed 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
let _: AssertRetTyIsTermination<$ret_ty>;
(type to be defined inlibtest
) similar toAssertParamIsEq
etc.used by some built-in derive-macros.
I haven't tried that approach yet though and cannot promise that it would actually work out or
be “cleaner” for that matter.
@rustbot label A-libtest A-diagnostics
r? @estebank