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

unstable rust features in code? #158

Closed
felixhekhorn opened this issue Jul 21, 2022 · 6 comments
Closed

unstable rust features in code? #158

felixhekhorn opened this issue Jul 21, 2022 · 6 comments
Assignees

Comments

@felixhekhorn
Copy link
Contributor

In f4f47f6 I changed some string outputs - and so I had to also adjust the tests, which I hope I did - but I cannot test it because I get

$ cargo test
   Compiling pineappl v0.5.4 (/home/felix/Physik/N3PDF/PineAPPL/pineappl/pineappl)
error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
   --> pineappl/src/sparse_array3.rs:244:6
    |
244 | impl<T: Clone + Default + PartialEq> SparseArray3<T> {
    |      ^
...
322 |     pub const fn dimensions(&self) -> (usize, usize, usize) {
    |     ------------------------------------------------------- function declared as const here
    |
    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `pineappl` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

the mentioned command says something that I have to activate nightly to use unstable features - which is not what I want and moreover PineAPPL is supposed to work with 1.56.1

just for reference

$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/felix/.rustup

stable-x86_64-unknown-linux-gnu (default)
rustc 1.60.0 (7737e0b5c 2022-04-04)

however, I was able to install the CLI (whose installation instructions I updated as well by the way)

@alecandido
Copy link
Member

I guess it has been solved in Rust 1.61.0:

const fn signatures can now use impl Trait in argument and return position

And since now Rust 1.62 is stable, I guess there is no problem.

@felixhekhorn
Copy link
Contributor Author

no problem - as long as we change https://github.com/N3PDF/pineappl/blob/f4f47f63e7118eb43479be8b3eec8fa5b53fc1fa/docs/installation.md#L122

@alecandido
Copy link
Member

no problem - as long as we change

Perfectly fine by me, I'd simply replace 1.56.1 by stable, and we'll always make sure it is going to work on stable. What do you think @cschwan?

@cschwan
Copy link
Contributor

cschwan commented Jul 21, 2022

I'd like to avoid changing the MSRV since I know a few people like to use Rust from their Linux distribution. Commit 6c2b1ac should fix the problem. Please re-open if that isn't the case!

@felixhekhorn
Copy link
Contributor Author

cargo test passed 👍 (after I remembered to run cargo build first - it is quite strange test is not running it on it's own ... )

@cschwan
Copy link
Contributor

cschwan commented Jul 22, 2022

cargo test can take quite long to finish which is why it doesn't run by default.

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

No branches or pull requests

3 participants