Skip to content

chore(tests): Allow compiling examples and tests with stable toolchain #63

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
merged 18 commits into from
Sep 12, 2024

Conversation

ac-freeman
Copy link
Contributor

As in #48, this PR allows the library to work on the stable and beta Rust channels by removing the associated_type_defaults and never_type features.

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.89%. Comparing base (b9660e6) to head (68e054f).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #63   +/-   ##
=======================================
  Coverage   73.89%   73.89%           
=======================================
  Files          12       12           
  Lines         609      609           
=======================================
  Hits          450      450           
  Misses        159      159           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ac-freeman ac-freeman changed the title Remove need for nightly Rust feat: Remove need for nightly Rust Sep 10, 2024
@danieleades
Copy link
Owner

Hi @ac-freeman, thanks for the contribution.

I think this PR goes a little further than the stated goal of removing the dependency on the nightly compiler, so maybe you can talk me through some of the changes.

Much of this hangs on the following question- Is the goal to remove the dependency on the nightly compiler so that downstream users of the crate do not need to use nightly, or so that contributors do not need to use the nightly compiler to run tests and examples?

  • If the former then removing the associated type defaults should be sufficient
    • the 'never' type is only used in doc comments and examples, and not in the library itself. It shouldn't be necessary to remove this in order to allow downstream users to compile with a stable toolchain.
    • a CI job would need to be added to confirm that the crate (sans examples and tests) could be compiled with the stable toolchain
  • you've modified some Errors from generics to boxed traits. What is the reason for this?

@danieleades
Copy link
Owner

see #64

@ac-freeman
Copy link
Contributor Author

Is the goal to remove the dependency on the nightly compiler so that downstream users of the crate do not need to use nightly, or so that contributors do not need to use the nightly compiler to run tests and examples?

Yes, both, although primarily the former.

I think it's useful, however, if the examples can be run without the use of nightly. A user may want to get hands-on time by trying out the example code before integrating the library in their own project. Having to use nightly seems like a roadblock. Is there a reason at this point to prefer ! over Infallible, when we don't know when (or if) ! will be stabilized?

you've modified some Errors from generics to boxed traits. What is the reason for this?

That was chasing down a red herring from a thiserror macro I had added--my apologies. It's been removed.

If you at least agree that the changes in #64 will be helpful, I think that's a great start, and it will make my life easier (updating Rust nightly has a habit of breaking other packages that I depend on).

@danieleades
Copy link
Owner

thanks @ac-freeman
I'm going to merge the other PR which removes the need for a nightly compiler for downstream users of the crate. That will then reduce the scope of this PR to removing the need for contributors or for people making direct use of the examples to use a nightly compiler. Apologies in advance for the rebasing!

@ac-freeman ac-freeman changed the title feat: Remove need for nightly Rust feat!: Allow compiling examples and tests with stable toolchain Sep 11, 2024
@danieleades danieleades changed the title feat!: Allow compiling examples and tests with stable toolchain chore(tests): Allow compiling examples and tests with stable toolchain Sep 12, 2024
Copy link
Owner

@danieleades danieleades left a comment

Choose a reason for hiding this comment

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

minor nits

ac-freeman and others added 2 commits September 12, 2024 11:24
Co-authored-by: danieleades <[email protected]>
@danieleades danieleades merged commit 6233736 into danieleades:main Sep 12, 2024
11 checks passed
@github-actions github-actions bot mentioned this pull request Sep 11, 2024
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.

2 participants