Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
WaffleLapkin committed Jan 31, 2023
1 parent f1d273c commit 340414e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingDoc {

fn check_impl_item(&mut self, cx: &LateContext<'_>, impl_item: &hir::ImplItem<'_>) {
let context = method_context(cx, impl_item.owner_id.def_id);

match context {
// If the method is an impl for a trait, don't doc.
MethodLateContext::TraitImpl => return,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ impl<'tcx> Body<'tcx> {
(self.arg_count + 1..self.local_decls.len()).filter_map(move |index| {
let local = Local::new(index);
let decl = &self.local_decls[local];
if decl.is_user_variable() && decl.mutability.is_mut() { Some(local) } else { None }
(decl.is_user_variable() && decl.mutability.is_mut()).then(|| local)
})
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ fn write_scope_tree(
continue;
}

let mut_str = if local_decl.mutability.is_mut() { "mut " } else { "" };
let mut_str = local_decl.mutability.prefix_str();

let mut indented_decl =
format!("{0:1$}let {2}{3:?}: {4:?}", INDENT, indent, mut_str, local, local_decl.ty);
Expand Down
5 changes: 2 additions & 3 deletions compiler/rustc_save_analysis/src/sig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,9 +768,8 @@ impl<'hir> Sig for hir::ForeignItem<'hir> {
}
hir::ForeignItemKind::Static(ref ty, m) => {
let mut text = "static ".to_owned();
if m.is_mut() {
text.push_str("mut ");
}
text.push_str(m.prefix_str());

let name = self.ident.to_string();
let defs = vec![SigElement {
id: id_from_def_id(self.owner_id.to_def_id()),
Expand Down

0 comments on commit 340414e

Please sign in to comment.