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

entry_libloading: Do not pass AsRef implementation by reference #389

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

MarijnS95
Copy link
Collaborator

@MarijnS95 MarijnS95 commented Mar 8, 2021

Fixes #388

All type parameters are implicitly bound by Sized; matching the & out of &str implies that str must be bound by Sized which is not true, resulting in:

18 |         let entry = ash::Entry::with_library("foo")?;
   |                                              ^^^^^ doesn't have a size known at compile-time
   |
  ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39
   |
73 |     pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> {
   |                                       ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library`

After all Library::new accepts an impl AsRef<OsStr> without borrow, which is what this function is modeled after to pass the same parameter on directly.

Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (#319)")

All type parameters are implicitly bound by `Sized`; matching the `&`
out of `&str` implies that `str` must be bound by `Sized` which is not
true, resulting in:

    18 |         let entry = ash::Entry::with_library("foo")?;
       |                                              ^^^^^ doesn't have a size known at compile-time
       |
      ::: /home/marijn/Code/TraverseResearch/ash/ash/src/entry_libloading.rs:73:39
       |
    73 |     pub unsafe fn with_library(path: &impl AsRef<OsStr>) -> Result<Entry, LoadingError> {
       |                                       ----------------- required by this bound in `ash::entry_libloading::<impl EntryCustom<Arc<libloading::Library>>>::with_library`

After all `Library::new` accepts an `impl AsRef<OsStr>` without borrow,
which is what this function is modeled after to pass the same parameter
on directly.

Fixes: c6d5d66 ("entry_libloading: Provide Vulkan library loader from custom path (ash-rs#319)")
@MaikKlein MaikKlein merged commit b3a010a into ash-rs:master Mar 8, 2021
@MarijnS95 MarijnS95 deleted the entry-ref branch March 8, 2021 18:37
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.

Entry::with_library: the size for values of type str cannot be known at compilation time
3 participants