Add docs to make tidy tests happy :')

This commit is contained in:
Maybe Waffle 2022-12-20 13:30:53 +00:00
parent 1c8bcf0d4e
commit 046a5679e3
9 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,8 @@
//! Implementation of "adjustment" inlay hints:
//! ```no_run
//! let _: u32 = /* <never-to-any> */ loop {};
//! let _: &u32 = /* &* */ &mut 0;
//! ```
use hir::{Adjust, AutoBorrow, Mutability, OverloadedDeref, PointerCast, Safety, Semantics}; use hir::{Adjust, AutoBorrow, Mutability, OverloadedDeref, PointerCast, Safety, Semantics};
use ide_db::RootDatabase; use ide_db::RootDatabase;

View File

@ -1,3 +1,8 @@
//! Implementation of "type" inlay hints:
//! ```no_run
//! fn f(a: i32, b: i32) -> i32 { a + b }
//! let _x /* i32 */= f(4, 4);
//! ```
use hir::{HirDisplay, Semantics, TypeInfo}; use hir::{HirDisplay, Semantics, TypeInfo};
use ide_db::{base_db::FileId, famous_defs::FamousDefs, RootDatabase}; use ide_db::{base_db::FileId, famous_defs::FamousDefs, RootDatabase};

View File

@ -1,3 +1,7 @@
//! Implementation of "binding mode" inlay hints:
//! ```no_run
//! let /* & */ (/* ref */ x,) = &(0,);
//! ```
use hir::{Mutability, Semantics}; use hir::{Mutability, Semantics};
use ide_db::RootDatabase; use ide_db::RootDatabase;

View File

@ -1,3 +1,4 @@
//! Implementation of "chaining" inlay hints.
use hir::{HirDisplay, Semantics}; use hir::{HirDisplay, Semantics};
use ide_db::{famous_defs::FamousDefs, RootDatabase}; use ide_db::{famous_defs::FamousDefs, RootDatabase};
use syntax::{ use syntax::{

View File

@ -1,3 +1,8 @@
//! Implementation of "closing brace" inlay hints:
//! ```no_run
//! fn g() {
//! } /* fn g */
//! ```
use hir::{HirDisplay, Semantics}; use hir::{HirDisplay, Semantics};
use ide_db::{base_db::FileRange, RootDatabase}; use ide_db::{base_db::FileRange, RootDatabase};
use syntax::{ use syntax::{

View File

@ -1,3 +1,4 @@
//! Implementation of "closure return type" inlay hints.
use hir::{HirDisplay, Semantics}; use hir::{HirDisplay, Semantics};
use ide_db::{base_db::FileId, famous_defs::FamousDefs, RootDatabase}; use ide_db::{base_db::FileId, famous_defs::FamousDefs, RootDatabase};
use syntax::ast::{self, AstNode}; use syntax::ast::{self, AstNode};

View File

@ -1,3 +1,7 @@
//! Implementation of "lifetime elision" inlay hints:
//! ```no_run
//! fn example/* <'0> */(a: &/* '0 */()) {}
//! ```
use ide_db::{syntax_helpers::node_ext::walk_ty, FxHashMap}; use ide_db::{syntax_helpers::node_ext::walk_ty, FxHashMap};
use itertools::Itertools; use itertools::Itertools;
use syntax::SmolStr; use syntax::SmolStr;

View File

@ -1,3 +1,7 @@
//! Implementation of "implicit static" inlay hints:
//! ```no_run
//! static S: &/* 'static */str = "";
//! ```
use either::Either; use either::Either;
use syntax::{ use syntax::{
ast::{self, AstNode}, ast::{self, AstNode},

View File

@ -1,3 +1,8 @@
//! Implementation of "param name" inlay hints:
//! ```no_run
//! fn max(x: i32, y: i32) -> i32 { x + y }
//! _ = max(/*x*/4, /*y*/4);
//! ```
use either::Either; use either::Either;
use hir::{Callable, Semantics}; use hir::{Callable, Semantics};
use ide_db::{base_db::FileRange, RootDatabase}; use ide_db::{base_db::FileRange, RootDatabase};