Stream: t-compiler/wg-rls-2.0

Topic: No code-completion when using ash crate

Clemens Wasser (Jan 04 2020 at 21:59, on Zulip):

Here is the Problem:

use ash::version::*;
use ash::*;

fn main() {
  let entry = Entry::new().unwrap(); // rust analyzer deduces the type correctly: ash::EntryCustom<Arc<DynamicLibrary>>
  let instance = entry.create_instance(&vk::InstanceCreateInfo::builder(), None).unwrap(); // rust analyzer does not deduce any type: {unknown}
  // should be: ash::Instance
  // When I remove the ".unwrap()" He deduces it as: Result<{unknown}, InstanceError>

Here is the corresponding source in the ash crate:

pub trait EntryV1_0 {
    type Instance; // Here is Self::Instance, but rust-analyzer fails to identify it as this (I think, ... no idea -> what do you think?)


    unsafe fn create_instance(
        create_info: &vk::InstanceCreateInfo,
        allocation_callbacks: Option<&vk::AllocationCallbacks>,
    ) -> Result<Self::Instance, InstanceError>; // He cannot deduce the Type: Self::Instance, which is up there ^^



Here is the corresponding source in the ash crate:

Last update: Sep 22 2020 at 02:30UTC