Skip to content

[bug] tauri::command breaks the #![deny(missing_docs)] directive #4550

Closed

Description

@will-hart

Describe the bug

I am unable to include the #![deny(missing_docs)] directive in a tauri application that uses tauri commands.

Reproduction

  1. Create a new tauri app
  2. Add #![deny(missing_docs)] at the top of main.rs
  3. Create a command using #[derive(tauri::command)], with or without documentation

Expected behavior

The application compiles without errors.

Platform and versions

Environment
  › OS: Windows 10.0.19044 X64
  › Webview2: 103.0.1264.37
  › MSVC: 
      - Visual Studio Build Tools 2019
  › Node.js: 16.15.1
  › npm: 8.11.0
  › pnpm: Not installed!
  › yarn: 1.22.19       
  › rustup: 1.24.3
  › rustc: 1.61.0
  › cargo: 1.61.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.0.0
  › @tauri-apps/api [NPM]: 1.0.1
  › tauri [RUST]: 1.0.0,
  › tauri-build [RUST]: 1.0.0,
  › tao [RUST]: 0.11.2,
  › wry [RUST]: 0.18.3,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:3000/
  › framework: React

App directory structure
  ├─ .git
  ├─ .github
  ├─ .storybook
  ├─ .vscode
  ├─ dist
  ├─ lib
  ├─ node_modules
  ├─ schema
  ├─ src
  └─ src-tauri

Stack trace

error: missing documentation for a macro                      
  --> src\commands.rs:14:1
   |
14 | #[tauri::command]
   | ^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src\main.rs:5:9
   |
5  | #![deny(missing_docs)] //<- tauri commands break this    
   |         ^^^^^^^^^^^^
   = note: this error originates in the attribute macro `tauri::command` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `app` due to previous error

Additional context

This is a known limitation that requires support from the macro to resolve.

Activity

  1. changed the title [-][bug] tauri::command breaks the #![deny(missing_docs)]] directive[/-] [+][bug] tauri::command breaks the #![deny(missing_docs)] directive[/+] on Jul 1, 2022
  2. added a commit that references this issue on Jul 1, 2022
    ff55e5e
  3. lucasfernog commented on Jul 1, 2022

    @lucasfernog
    Member

    Fix will be available in the next release. For now you can add #![allow(missing_docs)] to the src/commands.rs file.

  4. will-hart commented on Jul 2, 2022

    @will-hart
    Author

    Awesome, thanks! I love what you're doing with tauri 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions