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

Upgrade rand to 0.9.0 #1487

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Upgrade rand to 0.9.0 #1487

merged 1 commit into from
Feb 18, 2025

Conversation

KAAtheWiseGit
Copy link
Contributor

Bumps the rand version.

Things of note:

  • new_random_generic in base::construction used thread_rng. This function is now locked under a thread_rng feature, so I added it to nalgebra's rand.

@KAAtheWiseGit
Copy link
Contributor Author

Some tests are failing because macro error output has changed.

I also couldn't build nalgebra-lapack, it throws an error in the C code with a float/double mismatch

@KAAtheWiseGit
Copy link
Contributor Author

I've looked at the errors, and I'm pretty sure they are mostly the same. Angle brackets around types got replaced with backticks in a couple of places and the last method not found in ... message got dropped. Would it be fine to overwrite these tests:

Test output
test tests/macros/trybuild/stack_incompatible_block_dimensions.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `ShapeConstraint: SameNumberOfColumns<Const<2>, Const<3>>` is not satisfied
  --> tests/macros/trybuild/stack_incompatible_block_dimensions.rs:12:12
   |
12 |            a21, a22];
   |            ^^^ the trait `SameNumberOfColumns<Const<2>, Const<3>>` is not implemented for `ShapeConstraint`
   |
   = help: the following other types implement trait `SameNumberOfColumns<D1, D2>`:
             <ShapeConstraint as SameNumberOfColumns<D, D>>
             <ShapeConstraint as SameNumberOfColumns<D, Dyn>>
             <ShapeConstraint as SameNumberOfColumns<Dyn, D>>
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
  --> tests/macros/trybuild/stack_incompatible_block_dimensions.rs:11:5
   |
11 | /     stack![a11, a12;
12 | |            a21, a22];
   | |____________________^ cannot infer type
   |
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `generic_view_mut` found for struct `Matrix<_, Const<3>, _, _>` in the current scope
  --> tests/macros/trybuild/stack_incompatible_block_dimensions.rs:11:5
   |
11 |       stack![a11, a12;
   |  _____^
12 | |            a21, a22];
   | |____________________^ method not found in `Matrix<_, Const<3>, _, _>`
   |
  ::: src/base/matrix_view.rs
   |
   |        generic_slice_mut => generic_view_mut,
   |                             ---------------- the method is available for `Matrix<_, Const<3>, _, _>` here
   |
   = note: the method was found for
           - `Matrix<T, R, C, S>`
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `ShapeConstraint: SameNumberOfColumns<Const<2>, Const<3>>` is not satisfied
  --> tests/macros/trybuild/stack_incompatible_block_dimensions.rs:12:12
   |
12 |            a21, a22];
   |            ^^^ the trait `SameNumberOfColumns<Const<2>, Const<3>>` is not implemented for `ShapeConstraint`
   |
   = help: the following other types implement trait `SameNumberOfColumns<D1, D2>`:
             `ShapeConstraint` implements `SameNumberOfColumns<D, D>`
             `ShapeConstraint` implements `SameNumberOfColumns<D, Dyn>`
             `ShapeConstraint` implements `SameNumberOfColumns<Dyn, D>`
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
  --> tests/macros/trybuild/stack_incompatible_block_dimensions.rs:11:5
   |
11 | /     stack![a11, a12;
12 | |            a21, a22];
   | |____________________^ cannot infer type
   |
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite

test tests/macros/trybuild/stack_incompatible_block_dimensions2.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `ShapeConstraint: SameNumberOfRows<Const<1>, Const<2>>` is not satisfied
  --> tests/macros/trybuild/stack_incompatible_block_dimensions2.rs:13:17
   |
13 |            a21, a22];
   |                 ^^^ the trait `SameNumberOfRows<Const<1>, Const<2>>` is not implemented for `ShapeConstraint`
   |
   = help: the following other types implement trait `SameNumberOfRows<D1, D2>`:
             <ShapeConstraint as SameNumberOfRows<D, D>>
             <ShapeConstraint as SameNumberOfRows<D, Dyn>>
             <ShapeConstraint as SameNumberOfRows<Dyn, D>>
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
  --> tests/macros/trybuild/stack_incompatible_block_dimensions2.rs:12:5
   |
12 | /     stack![a11, a12;
13 | |            a21, a22];
   | |____________________^ cannot infer type
   |
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no method named `generic_view_mut` found for struct `Matrix<_, _, Const<4>, _>` in the current scope
  --> tests/macros/trybuild/stack_incompatible_block_dimensions2.rs:12:5
   |
12 |       stack![a11, a12;
   |  _____^
13 | |            a21, a22];
   | |____________________^ method not found in `Matrix<_, _, Const<4>, _>`
   |
  ::: src/base/matrix_view.rs
   |
   |        generic_slice_mut => generic_view_mut,
   |                             ---------------- the method is available for `Matrix<_, _, Const<4>, _>` here
   |
   = note: the method was found for
           - `Matrix<T, R, C, S>`
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0277]: the trait bound `ShapeConstraint: SameNumberOfRows<Const<1>, Const<2>>` is not satisfied
  --> tests/macros/trybuild/stack_incompatible_block_dimensions2.rs:13:17
   |
13 |            a21, a22];
   |                 ^^^ the trait `SameNumberOfRows<Const<1>, Const<2>>` is not implemented for `ShapeConstraint`
   |
   = help: the following other types implement trait `SameNumberOfRows<D1, D2>`:
             `ShapeConstraint` implements `SameNumberOfRows<D, D>`
             `ShapeConstraint` implements `SameNumberOfRows<D, Dyn>`
             `ShapeConstraint` implements `SameNumberOfRows<Dyn, D>`
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0282]: type annotations needed
  --> tests/macros/trybuild/stack_incompatible_block_dimensions2.rs:12:5
   |
12 | /     stack![a11, a12;
13 | |            a21, a22];
   | |____________________^ cannot infer type
   |
   = note: this error originates in the macro `stack` (in Nightly builds, run with -Z macro-backtrace for more info)
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite



test macros::stack::stack_trybuild_tests ... FAILED

@KAAtheWiseGit KAAtheWiseGit force-pushed the rand-version branch 2 times, most recently from 2a50859 to 30132ec Compare February 16, 2025 13:39
@KAAtheWiseGit KAAtheWiseGit marked this pull request as ready for review February 16, 2025 13:40
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Meat of this looks fine, but a couple nits. Updating unrelated tests should be a separate commit or PR.

@KAAtheWiseGit
Copy link
Contributor Author

I've split the changes into two commits, feat for the upgrade and chore for the tests. I kept them in the same PR so that the tests don't fail with just the upgrade commit

@Ralith
Copy link
Collaborator

Ralith commented Feb 17, 2025

Changes to make the tests build with rand 0.9 should not be separated from the change to update to rand 0.9. What should be separated out are the changes not related to updating rand, i.e. the trybuild stuff.

@KAAtheWiseGit
Copy link
Contributor Author

KAAtheWiseGit commented Feb 18, 2025

Ah, got it! Sorry, I was confused, thought that the trybuild stuff was due to the rand bump, didn't realize it was unrelated. I've squashed the commits and removed the macro test changes

Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Thanks!

@Ralith Ralith merged commit 2da148c into dimforge:main Feb 18, 2025
11 checks passed
@Ralith Ralith mentioned this pull request Feb 20, 2025
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