sapling icon indicating copy to clipboard operation
sapling copied to clipboard

can't build with local rust version

Open mimoo opened this issue 3 years ago • 2 comments

I get this when compiling:

error[E0658]: use of unstable library feature 'nonzero_ops'
   --> lib/repolock/src/lib.rs:147:41
    |
147 |             store_lock.1 = store_lock.1.checked_add(1).unwrap();
    |                                         ^^^^^^^^^^^
    |
    = note: see issue #84186 <https://github.com/rust-lang/rust/issues/84186> for more information

error[E0658]: use of unstable library feature 'nonzero_ops'
   --> lib/repolock/src/lib.rs:167:35
    |
167 |             wc_lock.1 = wc_lock.1.checked_add(1).unwrap();
    |                                   ^^^^^^^^^^^
    |
    = note: see issue #84186 <https://github.com/rust-lang/rust/issues/84186> for more information

For more information about this error, try `rustc --explain E0658`.
error: could not compile `repolock` due to 2 previous errors

it looks like there's a missing rust-toolchain.toml to fix the rust version used in this project

mimoo avatar Nov 24 '22 04:11 mimoo

Is your local rust toolchain old? Looks like that was stabilized in 1.64 which is somewhat recent but not that ridiculously so.

lf- avatar Nov 25 '22 22:11 lf-

yeah, I fixed it doing a rustup update, but I have a PR adding a rust-toolchain.toml which should fix it for everyone (https://github.com/facebook/sapling/pull/259)

mimoo avatar Nov 28 '22 18:11 mimoo