mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
question_mark
This commit is contained in:
parent
6738edc259
commit
3cf1358eb8
@ -159,8 +159,6 @@ suspicious = { level = "warn", priority = -1 }
|
|||||||
result_unit_err = "allow"
|
result_unit_err = "allow"
|
||||||
# We don't expose public APIs that matter like this
|
# We don't expose public APIs that matter like this
|
||||||
len_without_is_empty = "allow"
|
len_without_is_empty = "allow"
|
||||||
# We currently prefer explicit control flow return over `...?;` statements whose result is unused
|
|
||||||
question_mark = "allow"
|
|
||||||
# We have macros that rely on this currently
|
# We have macros that rely on this currently
|
||||||
enum_variant_names = "allow"
|
enum_variant_names = "allow"
|
||||||
# Builder pattern disagrees
|
# Builder pattern disagrees
|
||||||
|
@ -2081,9 +2081,7 @@ impl Function {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn method_params(self, db: &dyn HirDatabase) -> Option<Vec<Param>> {
|
pub fn method_params(self, db: &dyn HirDatabase) -> Option<Vec<Param>> {
|
||||||
if self.self_param(db).is_none() {
|
self.self_param(db)?;
|
||||||
return None;
|
|
||||||
}
|
|
||||||
Some(self.params_without_self(db))
|
Some(self.params_without_self(db))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -659,10 +659,8 @@ impl<'db> SemanticsImpl<'db> {
|
|||||||
// First expand into attribute invocations
|
// First expand into attribute invocations
|
||||||
let containing_attribute_macro_call = self.with_ctx(|ctx| {
|
let containing_attribute_macro_call = self.with_ctx(|ctx| {
|
||||||
token.parent_ancestors().filter_map(ast::Item::cast).find_map(|item| {
|
token.parent_ancestors().filter_map(ast::Item::cast).find_map(|item| {
|
||||||
if item.attrs().next().is_none() {
|
|
||||||
// Don't force populate the dyn cache for items that don't have an attribute anyways
|
// Don't force populate the dyn cache for items that don't have an attribute anyways
|
||||||
return None;
|
item.attrs().next()?;
|
||||||
}
|
|
||||||
Some((
|
Some((
|
||||||
ctx.item_to_macro_call(InFile::new(file_id, item.clone()))?,
|
ctx.item_to_macro_call(InFile::new(file_id, item.clone()))?,
|
||||||
item,
|
item,
|
||||||
|
@ -38,7 +38,7 @@ pub(crate) fn convert_match_to_let_else(acc: &mut Assists, ctx: &AssistContext<'
|
|||||||
let Some(ast::Expr::MatchExpr(initializer)) = let_stmt.initializer() else { return None };
|
let Some(ast::Expr::MatchExpr(initializer)) = let_stmt.initializer() else { return None };
|
||||||
let initializer_expr = initializer.expr()?;
|
let initializer_expr = initializer.expr()?;
|
||||||
|
|
||||||
let Some((extracting_arm, diverging_arm)) = find_arms(ctx, &initializer) else { return None };
|
let (extracting_arm, diverging_arm) = find_arms(ctx, &initializer)?;
|
||||||
if extracting_arm.guard().is_some() {
|
if extracting_arm.guard().is_some() {
|
||||||
cov_mark::hit!(extracting_arm_has_guard);
|
cov_mark::hit!(extracting_arm_has_guard);
|
||||||
return None;
|
return None;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user