Skip to content
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

[Merged by Bors] - fix: use explicit Result type from std on generated code #3393

Closed

Conversation

morenol
Copy link
Contributor

@morenol morenol commented Jul 12, 2023

this is done in order to avoid issues that could happen if a different Result type is on scope

@morenol morenol force-pushed the lmm/explicit-result-in-protocol-derive branch from f3e2985 to a411806 Compare July 12, 2023 23:15
@morenol
Copy link
Contributor Author

morenol commented Jul 12, 2023

First commit fails with

test ui-tests/pass_derive_decode_encode_with_custom_results.rs ... error
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0107]: type alias takes 0 generic arguments but 2 generic arguments were supplied
 --> ui-tests/pass_derive_decode_encode_with_custom_results.rs:7:19
  |
7 | #[derive(Default, Decoder, Encoder)]
  |                   ^^^^^^^- help: remove these generics
  |                   |
  |                   expected 0 generic arguments
  |
note: type alias defined here, with 0 generic parameters
 --> ui-tests/pass_derive_decode_encode_with_custom_results.rs:3:10
  |
3 | pub type Result = std::result::Result<(), ()>;
  |          ^^^^^^
  = note: this error originates in the derive macro `Decoder` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0107]: type alias takes 0 generic arguments but 2 generic arguments were supplied
 --> ui-tests/pass_derive_decode_encode_with_custom_results.rs:7:28
  |
7 | #[derive(Default, Decoder, Encoder)]
  |                            ^^^^^^^- help: remove these generics
  |                            |
  |                            expected 0 generic arguments
  |
note: type alias defined here, with 0 generic parameters
 --> ui-tests/pass_derive_decode_encode_with_custom_results.rs:3:10
  |
3 | pub type Result = std::result::Result<(), ()>;
  |          ^^^^^^
  = note: this error originates in the derive macro `Encoder` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

@morenol morenol changed the title fix: use explicit Result type from std on generated code in order t… fix: use explicit Result type from std on generated code Jul 13, 2023
@morenol morenol marked this pull request as ready for review July 13, 2023 01:25
Copy link
Contributor

@sehz sehz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@morenol
Copy link
Contributor Author

morenol commented Jul 13, 2023

bors r+

bors bot pushed a commit that referenced this pull request Jul 13, 2023
this is done in order to avoid issues that could happen if a different Result type is on scope
@bors
Copy link

bors bot commented Jul 13, 2023

Build failed:

@morenol
Copy link
Contributor Author

morenol commented Jul 13, 2023

bors r+

bors bot pushed a commit that referenced this pull request Jul 13, 2023
this is done in order to avoid issues that could happen if a different Result type is on scope
@bors
Copy link

bors bot commented Jul 13, 2023

Build failed:

@morenol
Copy link
Contributor Author

morenol commented Jul 13, 2023

ohh clippy issues from new version

@morenol
Copy link
Contributor Author

morenol commented Jul 13, 2023

bors retry

bors bot pushed a commit that referenced this pull request Jul 13, 2023
this is done in order to avoid issues that could happen if a different Result type is on scope
@bors
Copy link

bors bot commented Jul 13, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title fix: use explicit Result type from std on generated code [Merged by Bors] - fix: use explicit Result type from std on generated code Jul 13, 2023
@bors bors bot closed this Jul 13, 2023
@morenol morenol deleted the lmm/explicit-result-in-protocol-derive branch July 13, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants