#![deny(clippy::missing_docs_in_private_items)]
use crate::utils::{higher, snippet, snippet_opt, snippet_with_macro_callsite};
-use matches::matches;
use rustc_ast::util::parser::AssocOp;
use rustc_ast::{ast, token};
use rustc_ast_pretty::pprust::token_kind_to_string;
use std::convert::TryInto;
use std::fmt::Display;
-pub use crate::literal_representation::format_numeric_literal;
-
/// A helper type to build suggestion correctly handling parenthesis.
pub enum Sugg<'a> {
/// An expression that never needs parenthesis such as `1337` or `[0; 42]`.
| hir::ExprKind::Field(..)
| hir::ExprKind::Index(..)
| hir::ExprKind::InlineAsm(..)
+ | hir::ExprKind::LlvmInlineAsm(..)
| hir::ExprKind::Lit(..)
| hir::ExprKind::Loop(..)
| hir::ExprKind::MethodCall(..)
| ast::ExprKind::ForLoop(..)
| ast::ExprKind::Index(..)
| ast::ExprKind::InlineAsm(..)
+ | ast::ExprKind::LlvmInlineAsm(..)
| ast::ExprKind::Lit(..)
| ast::ExprKind::Loop(..)
- | ast::ExprKind::Mac(..)
+ | ast::ExprKind::MacCall(..)
| ast::ExprKind::MethodCall(..)
| ast::ExprKind::Paren(..)
| ast::ExprKind::Path(..)
/// # Example
///
/// ```rust,ignore
- /// db.suggest_item_with_attr(cx, item, "#[derive(Default)]");
+ /// diag.suggest_item_with_attr(cx, item, "#[derive(Default)]");
/// ```
fn suggest_item_with_attr<D: Display + ?Sized>(
&mut self,
/// # Example
///
/// ```rust,ignore
- /// db.suggest_prepend_item(cx, item,
+ /// diag.suggest_prepend_item(cx, item,
/// "fn foo() {
/// bar();
/// }");
/// # Example
///
/// ```rust,ignore
- /// db.suggest_remove_item(cx, item, "remove this")
+ /// diag.suggest_remove_item(cx, item, "remove this")
/// ```
fn suggest_remove_item(&mut self, cx: &T, item: Span, msg: &str, applicability: Applicability);
}