Skip to content

RA shows E0308 error rustc doesn't #21552

@PAStheLoD

Description

@PAStheLoD

rust-analyzer version: 0.3.2769-standalone (2532c48 2026-01-25)

rustc version: 1.93.0 (254b59607 2026-01-19)

editor or extension: VSCode 0.3.2769 (Windows 11)

relevant settings: N/A

repository link (if public, optional): https://github.com/tauri-apps/muda/ 0.17.1

code snippet to reproduce:

use muda::{Menu, Submenu};

fn main() {
let menu_bar = Menu::new();
let file_m = Submenu::new("&File", true);

menu_bar.append_items(&[&file_m]).ok();
//                    ^^^^^^^^^^
// expected &[&(dyn IsMenuItem + 'static)], found &[{unknown}; 1]
// expected &(dyn IsMenuItem + 'static), found &Submenu
// rust-analyzer E0308
}

Hello,

I tried to understand where this warning might be coming from (to get some sensible minimal reproduction), but cargo check doesn't show any warnings, and programs with all kinds of these strange coercion errors run without runtime errors.

The same (or something similar) happens with using Dioxus 0.7.3 desktop feature,

use dioxus::prelude::*;

// but Element is Result<VNode, RenderError>
// VNode is a struct with an Rc


// rsx!  is a proc macro

fn popup() -> Element {
    rsx! {
        div { "This is a popup window!" }
        // ^
        // expected &[TemplateNode], found &[TemplateNode; 1]
        // rust-analyzer E0308
    }
}
Image

I tried searching for similar issues on the library repositories too, and via Google. (Only found closed issues like #13864, but that's supposed to be fixed, and here is also a missing 'static bound.)

Thanks for considering!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions