mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Resolve todos about refs and empty statements
This commit is contained in:
parent
f5e2e02aa9
commit
8a298eed7a
2 changed files with 8 additions and 9 deletions
|
@ -1515,9 +1515,9 @@ impl ParenPat {
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let ❰ &mut foo ❱ = bar;
|
/// let ❰ &mut foo ❱ = bar;
|
||||||
|
///
|
||||||
|
/// let ❰ & ❰ &mut ❰ &_ ❱ ❱ ❱ = baz;
|
||||||
/// ```
|
/// ```
|
||||||
/// // TODO: clarify on the special case of double reference pattern
|
|
||||||
/// // described in the link bellow
|
|
||||||
///
|
///
|
||||||
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#reference-patterns)
|
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#reference-patterns)
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
|
@ -2069,14 +2069,12 @@ pub struct Abi {
|
||||||
}
|
}
|
||||||
impl Abi {}
|
impl Abi {}
|
||||||
/// Expression statement.
|
/// Expression statement.
|
||||||
/// Note: may be empty (i.e. only semicolon).
|
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// ❰ 42; ❱
|
/// ❰ 42; ❱
|
||||||
/// ❰ foo(); ❱
|
/// ❰ foo(); ❱
|
||||||
/// ❰ (); ❱
|
/// ❰ (); ❱
|
||||||
/// ❰ {}; ❱
|
/// ❰ {}; ❱
|
||||||
/// ❰ /* empty */; ❱
|
|
||||||
///
|
///
|
||||||
/// // constructions with trailing curly brace can omit the semicolon // TODO: clarify
|
/// // constructions with trailing curly brace can omit the semicolon // TODO: clarify
|
||||||
/// ❰ if bool_cond { } ❱
|
/// ❰ if bool_cond { } ❱
|
||||||
|
@ -2707,6 +2705,8 @@ pub enum AttrInput {
|
||||||
TokenTree(TokenTree),
|
TokenTree(TokenTree),
|
||||||
}
|
}
|
||||||
/// Any kind of statement
|
/// Any kind of statement
|
||||||
|
/// Note: there are no empty statements, these are just represented as
|
||||||
|
/// bare semicolons without a dedicated statement ast node.
|
||||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||||
pub enum Stmt {
|
pub enum Stmt {
|
||||||
LetStmt(LetStmt),
|
LetStmt(LetStmt),
|
||||||
|
|
|
@ -1349,9 +1349,9 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// let ❰ &mut foo ❱ = bar;
|
/// let ❰ &mut foo ❱ = bar;
|
||||||
|
///
|
||||||
|
/// let ❰ & ❰ &mut ❰ &_ ❱ ❱ ❱ = baz;
|
||||||
/// ```
|
/// ```
|
||||||
/// // TODO: clarify on the special case of double reference pattern
|
|
||||||
/// // described in the link bellow
|
|
||||||
///
|
///
|
||||||
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#reference-patterns)
|
/// [Reference](https://doc.rust-lang.org/reference/patterns.html#reference-patterns)
|
||||||
struct RefPat { T![&], T![mut], Pat }
|
struct RefPat { T![&], T![mut], Pat }
|
||||||
|
@ -1714,16 +1714,13 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
|
||||||
/// - [FFI function pointers reference](https://doc.rust-lang.org/reference/items/functions.html#functions)
|
/// - [FFI function pointers reference](https://doc.rust-lang.org/reference/items/functions.html#functions)
|
||||||
struct Abi { /*String*/ }
|
struct Abi { /*String*/ }
|
||||||
|
|
||||||
// TODO: clarify how empty statements are handled
|
|
||||||
/// Expression statement.
|
/// Expression statement.
|
||||||
/// Note: may be empty (i.e. only semicolon).
|
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// ❰ 42; ❱
|
/// ❰ 42; ❱
|
||||||
/// ❰ foo(); ❱
|
/// ❰ foo(); ❱
|
||||||
/// ❰ (); ❱
|
/// ❰ (); ❱
|
||||||
/// ❰ {}; ❱
|
/// ❰ {}; ❱
|
||||||
/// ❰ /* empty */; ❱
|
|
||||||
///
|
///
|
||||||
/// // constructions with trailing curly brace can omit the semicolon // TODO: clarify
|
/// // constructions with trailing curly brace can omit the semicolon // TODO: clarify
|
||||||
/// ❰ if bool_cond { } ❱
|
/// ❰ if bool_cond { } ❱
|
||||||
|
@ -2201,6 +2198,8 @@ pub(crate) const AST_SRC: AstSrc = AstSrc {
|
||||||
enum AttrInput { Literal, TokenTree }
|
enum AttrInput { Literal, TokenTree }
|
||||||
|
|
||||||
/// Any kind of statement
|
/// Any kind of statement
|
||||||
|
/// Note: there are no empty statements, these are just represented as
|
||||||
|
/// bare semicolons without a dedicated statement ast node.
|
||||||
enum Stmt {
|
enum Stmt {
|
||||||
LetStmt,
|
LetStmt,
|
||||||
ExprStmt,
|
ExprStmt,
|
||||||
|
|
Loading…
Reference in a new issue