Skip to content

Commit

Permalink
Remove from librustdoc and clippy too
Browse files Browse the repository at this point in the history
  • Loading branch information
scottmcm committed Jan 28, 2023
1 parent 868d099 commit c4fa0d3
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/librustdoc/html/length_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ impl HtmlWithLimit {
/// and returns [`ControlFlow::Break`].
pub(super) fn push(&mut self, text: &str) -> ControlFlow<(), ()> {
if self.len + text.len() > self.limit {
return ControlFlow::BREAK;
return ControlFlow::Break(());
}

self.flush_queue();
write!(self.buf, "{}", Escape(text)).unwrap();
self.len += text.len();

ControlFlow::CONTINUE
ControlFlow::Continue(())
}

/// Open an HTML tag.
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/length_limit/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn past_the_limit() {
buf.push("word#")?;
buf.push(&n.to_string())?;
buf.close_tag();
ControlFlow::CONTINUE
ControlFlow::Continue(())
});
buf.close_tag();
assert_eq!(
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1188,18 +1188,18 @@ fn markdown_summary_with_limit(
Event::Start(tag) => match tag {
Tag::Emphasis => buf.open_tag("em"),
Tag::Strong => buf.open_tag("strong"),
Tag::CodeBlock(..) => return ControlFlow::BREAK,
Tag::CodeBlock(..) => return ControlFlow::Break(()),
_ => {}
},
Event::End(tag) => match tag {
Tag::Emphasis | Tag::Strong => buf.close_tag(),
Tag::Paragraph | Tag::Heading(..) => return ControlFlow::BREAK,
Tag::Paragraph | Tag::Heading(..) => return ControlFlow::Break(()),
_ => {}
},
Event::HardBreak | Event::SoftBreak => buf.push(" ")?,
_ => {}
};
ControlFlow::CONTINUE
ControlFlow::Continue(())
});

(buf.finish(), stopped_early)
Expand Down
1 change: 0 additions & 1 deletion src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#![feature(array_methods)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(control_flow_enum)]
#![feature(drain_filter)]
#![feature(is_terminal)]
#![feature(let_chains)]
Expand Down
1 change: 0 additions & 1 deletion src/tools/clippy/clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![feature(array_windows)]
#![feature(binary_heap_into_iter_sorted)]
#![feature(box_patterns)]
#![feature(control_flow_enum)]
#![feature(drain_filter)]
#![feature(iter_intersperse)]
#![feature(let_chains)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ fn collect_replace_calls<'tcx>(
from_args.push_front(from);
ControlFlow::Continue(())
} else {
ControlFlow::BREAK
ControlFlow::Break(())
}
} else {
ControlFlow::Continue(())
Expand Down
1 change: 0 additions & 1 deletion src/tools/clippy/clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![feature(array_chunks)]
#![feature(box_patterns)]
#![feature(control_flow_enum)]
#![feature(let_chains)]
#![feature(lint_reasons)]
#![feature(never_type)]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_utils/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ fn is_assert_arg(cx: &LateContext<'_>, expr: &Expr<'_>, assert_expn: ExpnId) ->
} else {
match cx.tcx.item_name(macro_call.def_id) {
// `cfg!(debug_assertions)` in `debug_assert!`
sym::cfg => ControlFlow::CONTINUE,
sym::cfg => ControlFlow::Continue(()),
// assert!(other_macro!(..))
_ => ControlFlow::Break(true),
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_utils/src/mir/possible_borrower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl TypeVisitor<'_> for ContainsRegion {
type BreakTy = ();

fn visit_region(&mut self, _: ty::Region<'_>) -> ControlFlow<Self::BreakTy> {
ControlFlow::BREAK
ControlFlow::Break(())
}
}

Expand Down

0 comments on commit c4fa0d3

Please sign in to comment.