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

nightly-2023-05-24 doesn't compile #1457

Closed
meowjesty opened this issue May 24, 2023 · 2 comments · Fixed by #1927
Closed

nightly-2023-05-24 doesn't compile #1457

meowjesty opened this issue May 24, 2023 · 2 comments · Fixed by #1927
Labels
enhancement New feature or request

Comments

@meowjesty
Copy link
Member

Bug Description

Something changed between nightly-2023-03-29 (our current version) and nightly-2023-05-23 that breaks some of our const trait implementations.

If you try to cargo check with a newer version (the latest working I've tested was nightly-04-15, but I'm not sure if this is the last working one or something more recent also works) you'll get a #[const_trait] error.

Steps to Reproduce

  1. Update rust-toolchain.toml to nightly-2023-05-23;
  2. Run cargo check;
  3. sadness;

Backtrace

error: const `impl` for trait `Default` which is not marked with `#[const_trait]`
   --> mirrord/layer/src/detour.rs:114:15
    |
114 | impl<T> const Default for HookFn<T> {
    |               ^^^^^^^
    |
    = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const`
    = note: adding a non-const method body in the future would be a breaking change

Relevant Logs

No response

Your operating system and version

linux

Local process

NA

Local process version

No response

Additional Info

P.S. You'll probably get an error in the protocol/file.rs and not on the layer crate. In protocol the issue is easy to solve, we could just drop the const trait implementation, but in layer it requires bigger changes, due to HookFn expecting const stuff.

@meowjesty meowjesty added the bug Something isn't working label May 24, 2023
@meowjesty
Copy link
Member Author

This broke our Default const implementations.

Workaround would be to have our own Default-like trait and implement it (and call the right function in the macros for HookFn).

@aviramha aviramha added enhancement New feature or request and removed bug Something isn't working labels May 28, 2023
@aviramha
Copy link
Member

aviramha commented Jun 4, 2023

mm the default breakage makes me desiring of ?const idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants