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

Update flex-array implementation to work with Rust 1.80 #2875

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Jul 30, 2024

The signature of core::ptr::from_raw_parts is different between Rust 1.79 and Rust 1.80, causing an ambiguity in the code previously produced by bindgen.

- pub fn from_raw_parts<T: ?Sized>(
+ pub const fn from_raw_parts<T: ?Sized>(
-     data_pointer: *const (),
+     data_pointer: *const impl Thin,
      metadata: <T as Pointee>::Metadata,
  ) -> *const T
error[E0283]: type annotations needed
   --> lib.rs:317:62
    |
317 |             let p: *const Self = ::core::ptr::from_raw_parts(::core::ptr::null(), len);
    |                                  --------------------------- ^^^^^^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `null`
    |                                  |
    |                                  required by a bound introduced by this call
    |
    = note: cannot satisfy `_: Thin`
help: consider specifying the generic argument
    |
317 |             let p: *const Self = ::core::ptr::from_raw_parts(::core::ptr::null::<T>(), len);
    |                                                                               +++++

@pvdrz pvdrz added this pull request to the merge queue Aug 8, 2024
Merged via the queue into rust-lang:main with commit bd67942 Aug 8, 2024
33 checks passed
@dtolnay dtolnay deleted the fromrawparts branch August 8, 2024 17:41
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