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

Fix build error on latest nightly #186

Merged
merged 2 commits into from
Sep 29, 2020
Merged

Conversation

toku-sa-n
Copy link
Member

error[E0658]: function pointers cannot appear in constant functions
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/x86_64-0.12.1/src/structures/idt.rs:378:31
    |
378 |                 divide_error: Entry::missing(),
    |                               ^^^^^^^^^^^^^^^^
    |
    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
    = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable

bisect: https://gist.github.com/50b4d25cbcd7f712a2253316ca76f1d9

I wonder why we have to add this crate attribute...

@toku-sa-n
Copy link
Member Author

Maybe the same situation as #182?

Signed-off-by: Joe Richey <joerichey@google.com>
@josephlr
Copy link
Contributor

Maybe the same situation as #182?

Essentially yes. However, this isn't a major breaking change, so my commit (ce4afba) can make sure we override the crate correctly for indirect deps.

@josephlr
Copy link
Contributor

I wonder why we have to add this crate attribute...

The const_fn feature (is finally) being split up into multiple sub-features rust-lang/rust#76618, so as they get added, we will have to update our attributes.

@josephlr josephlr self-requested a review September 29, 2020 06:56
@josephlr
Copy link
Contributor

Maybe the same situation as #182?

Essentially yes. However, this isn't a major breaking change, so my commit (ce4afba) can make sure we override the crate correctly for indirect deps.

Crap, this didn't work, because Cargo.toml overrides don't work for bootimage runner which builds bootloader without the overrides.

Looks like this has to be force pulled (and we will have to push a new release).

@phil-opp
Copy link
Member

The const_fn feature (is finally) being split up into multiple sub-features rust-lang/rust#76618, so as they get added, we will have to update our attributes.

It seems like there is only one remaining const_fn feature that we're using that requires the general feature(const_fn): Trait bounds other than Sized (error message is "trait bounds other than Sized on const fn parameters are unstable"). I'm not aware of any proposed sub-feature for this though.

@josephlr
Copy link
Contributor

I'm not aware of any proposed sub-feature for this though.

One is probably going to be split out soonish. The interesting thing is that we only need the Trait bounds, but we don't need to actually call const fn trait methods. It looks like we could even remove some of our generic use-cases right now.

@josephlr
Copy link
Contributor

I'm not aware of any proposed sub-feature for this though.

const_trait_bound_opt_out (see rust-lang/rust#67794) might end up being what we need, as we don't (currently) relay on any const fn trait methods.

@phil-opp
Copy link
Member

Interesting, thanks for the info!

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.

3 participants