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

Does not compile on recent nightly builds #60

Open
zesterer opened this issue Jun 30, 2024 · 0 comments
Open

Does not compile on recent nightly builds #60

zesterer opened this issue Jun 30, 2024 · 0 comments

Comments

@zesterer
Copy link

Hello, when depending on staticvec with default-features = false, I get:

error: `~const` can only be applied to `#[const_trait]` traits
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1420:26
     |
1420 |   where T: Copy + ~const PartialOrd {
     |                          ^^^^^^^^^^

error: `~const` can only be applied to `#[const_trait]` traits
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1455:26
     |
1455 |   where T: Copy + ~const PartialOrd {
     |                          ^^^^^^^^^^

error: `~const` can only be applied to `#[const_trait]` traits
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/utils.rs:177:57
    |
177 | pub(crate) const fn quicksort_internal<T: Copy + ~const PartialOrd>(
    |                                                         ^^^^^^^^^^

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_utils.rs:179:7
    |
179 |       $str_var.as_ptr().copy_to_nonoverlapping(dest, $str_len_var);
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
   ::: /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/mod.rs:548:5
    |
548 |     push_str_unchecked_internal!(self, string, old_length, string_length);
    |     --------------------------------------------------------------------- in this macro invocation
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable
    = note: this error originates in the macro `push_str_unchecked_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_utils.rs:163:11
    |
163 | /           $crate::string::string_utils::encode_utf8_raw($char_var, $len)
164 | |             .as_ptr()
165 | |             .copy_to_nonoverlapping($self_var.vec.mut_ptr_at_unchecked(old_length), $len);
    | |_________________________________________________________________________________________^
    |
   ::: /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/mod.rs:649:5
    |
649 |       push_char_unchecked_internal!(self, character as u32, char_len);
    |       --------------------------------------------------------------- in this macro invocation
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable
    = note: this error originates in the macro `push_char_unchecked_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_utils.rs:163:11
    |
163 | /           $crate::string::string_utils::encode_utf8_raw($char_var, $len)
164 | |             .as_ptr()
165 | |             .copy_to_nonoverlapping($self_var.vec.mut_ptr_at_unchecked(old_length), $len);
    | |_________________________________________________________________________________________^
    |
   ::: /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/mod.rs:670:5
    |
670 |       push_char_unchecked_internal!(self, character as u32, char_len);
    |       --------------------------------------------------------------- in this macro invocation
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable
    = note: this error originates in the macro `push_char_unchecked_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_utils.rs:163:11
    |
163 | /           $crate::string::string_utils::encode_utf8_raw($char_var, $len)
164 | |             .as_ptr()
165 | |             .copy_to_nonoverlapping($self_var.vec.mut_ptr_at_unchecked(old_length), $len);
    | |_________________________________________________________________________________________^
    |
   ::: /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/mod.rs:693:9
    |
693 |           push_char_unchecked_internal!(self, character as u32, char_len);
    |           --------------------------------------------------------------- in this macro invocation
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable
    = note: this error originates in the macro `push_char_unchecked_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot perform deref coercion on `StaticString<N>` in constant functions
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/mod.rs:720:36
    |
720 |       assert!(str_is_char_boundary(self, new_len));
    |                                    ^^^^
    |
    = note: attempting to deref into `str`
note: deref defined here
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_trait_impls.rs:114:3
    |
114 |   type Target = str;
    |   ^^^^^^^^^^^
note: impl defined here, but it is not `const`
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/string/string_trait_impls.rs:113:1
    |
113 | impl<const N: usize> const Deref for StaticString<N> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: add `#![feature(effects)]` to the crate attributes to enable
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:68:1
    |
68  + #![feature(effects)]
    |

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
  --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/utils.rs:80:7
   |
80 |       src.add(i - 1).copy_to_nonoverlapping(dest, 1);
   |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error[E0015]: cannot call non-const operator in constant functions
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/utils.rs:192:15
    |
192 |         while *values.offset(i) < p {
    |               ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider further restricting this bound
    |
177 | pub(crate) const fn quicksort_internal<T: Copy + ~const PartialOrd + ~const core::cmp::PartialOrd>(
    |                                                                    ++++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:68:1
    |
68  + #![feature(effects)]
    |

error[E0015]: cannot call non-const operator in constant functions
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/utils.rs:195:15
    |
195 |         while *values.offset(j) > p {
    |               ^^^^^^^^^^^^^^^^^^^^^
    |
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider further restricting this bound
    |
177 | pub(crate) const fn quicksort_internal<T: Copy + ~const PartialOrd + ~const core::cmp::PartialOrd>(
    |                                                                    ++++++++++++++++++++++++++++++
help: add `#![feature(effects)]` to the crate attributes to enable
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:68:1
    |
68  + #![feature(effects)]
    |

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:171:11
    |
171 | /           values
172 | |             .as_ptr()
173 | |             .copy_to_nonoverlapping(Self::first_ptr_mut(&mut data), length);
    | |___________________________________________________________________________^
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_to` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:973:7
    |
973 |       self_ptr.offset(1).copy_to(self_ptr, old_length - index - 1);
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_to` is not yet stable as a const fn
   --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:999:7
    |
999 |       self_ptr.offset(1).copy_to(self_ptr, old_length - index - 1);
    |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_to` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1094:7
     |
1094 |       self_ptr.copy_to(self_ptr.offset(1), old_length - index);
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_to` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1182:7
     |
1182 |       self_ptr.copy_to(self_ptr.add(values_length), old_length - index);
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_from_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1183:7
     |
1183 |       self_ptr.copy_from_nonoverlapping(values.as_ptr(), values_length);
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_to` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1241:9
     |
1241 |         self_ptr.copy_to(self_ptr.add(values_length), old_length - index);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_from_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1242:9
     |
1242 |         self_ptr.copy_from_nonoverlapping(values.as_ptr(), values_length);
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error[E0015]: cannot call non-const fn `<StaticVec<T, N> as Clone>::clone` in constant functions
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1424:19
     |
1424 |       return self.clone();
     |                   ^^^^^^^
     |
     = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: add `#![feature(effects)]` to the crate attributes to enable
     |
68   + #![feature(effects)]
     |

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1429:14
     |
1429 |     unsafe { self.as_ptr().copy_to_nonoverlapping(res_ptr, length) };
     |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1563:7
     |
1563 | /       values
1564 | |         .as_ptr()
1565 | |         .copy_to_nonoverlapping(self.mut_ptr_at_unchecked(old_length), added_length);
     | |____________________________________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_from_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1628:7
     |
1628 | /       self
1629 | |         .mut_ptr_at_unchecked(old_length)
1630 | |         .copy_from_nonoverlapping(other.as_ptr(), item_count);
     | |_____________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::mut_ptr::<impl *mut T>::copy_from` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1634:7
     |
1634 | /       other
1635 | |         .as_mut_ptr()
1636 | |         .copy_from(other.ptr_at_unchecked(item_count), other_new_length);
     | |________________________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1674:7
     |
1674 |       self.as_ptr().copy_to_nonoverlapping(res_ptr, length);
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:1677:7
     |
1677 | /       other
1678 | |         .as_ptr()
1679 | |         .copy_to_nonoverlapping(res_ptr.add(length), other_length);
     | |__________________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:2173:9
     |
2173 | /         self
2174 | |           .ptr_at_unchecked(at)
2175 | |           .copy_to_nonoverlapping(Self::first_ptr_mut(&mut split), split_length);
     | |________________________________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:2217:7
     |
2217 |       self_ptr.copy_to_nonoverlapping(left_ptr, M);
     |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

error: `core::ptr::const_ptr::<impl *const T>::copy_to_nonoverlapping` is not yet stable as a const fn
    --> /home/joshua/.cargo/registry/src/index.crates.io-6f17d22bba15001f/staticvec-0.11.9/src/lib.rs:2218:7
     |
2218 | /       self_ptr
2219 | |         .add(M)
2220 | |         .copy_to_nonoverlapping(right_ptr, right_length);
     | |________________________________________________________^
     |
     = help: add `#![feature(const_intrinsic_copy)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0015`.
error: could not compile `staticvec` (lib) due to 29 previous errors
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

1 participant