Expand description
Rewrite a list some items with overflow.
Re-exportsยง
use std::cmp::min;๐use itertools::Itertools;๐use rustc_ast::ast;๐use rustc_ast::token::Delimiter;๐use rustc_span::Span;๐use tracing::debug;๐use crate::closures;๐use crate::config::StyleEdition;๐use crate::config::Config;๐use crate::expr::can_be_overflowed_expr;๐use crate::expr::is_every_expr_simple;๐use crate::expr::is_method_call;๐use crate::expr::is_nested_call;๐use crate::expr::is_simple_expr;๐use crate::expr::rewrite_cond;๐use crate::lists::ListFormatting;๐use crate::lists::ListItem;๐use crate::lists::Separator;๐use crate::lists::definitive_tactic;๐use crate::lists::itemize_list;๐use crate::lists::write_list;๐use crate::macros::MacroArg;๐use crate::patterns::TuplePatField;๐use crate::patterns::can_be_overflowed_pat;๐use crate::rewrite::Rewrite;๐use crate::rewrite::RewriteContext;๐use crate::rewrite::RewriteError;๐use crate::rewrite::RewriteErrorExt;๐use crate::rewrite::RewriteResult;๐use crate::shape::Shape;๐use crate::source_map::SpanUtils;๐use crate::spanned::Spanned;๐use crate::types::SegmentParam;๐use crate::types::can_be_overflowed_type;๐use crate::utils::count_newlines;๐use crate::utils::extra_offset;๐use crate::utils::first_line_width;๐use crate::utils::last_line_width;๐use crate::utils::mk_sp;๐use crate::config::lists::*;๐
Macrosยง
Structsยง
- Context ๐
Enumsยง
- Overflowable
Item ๐
Constantsยง
- SPECIAL_
CASE_ ๐ATTR - SPECIAL_
CASE_ ๐MACROS - A list of
format!-like macros, that take a long format string and a list of arguments to format. - SPECIAL_
CASE_ ๐MACROS_ V2 - Additional special case macros for version 2; these are separated to avoid breaking changes in version 1.
Traitsยง
- Into
Overflowable ๐Item
Functionsยง
- can_
be_ ๐overflowed - into_
overflowable_ ๐list - last_
item_ ๐shape - Returns a shape for the last argument which is going to be overflowed.
- maybe_
get_ ๐args_ offset - In case special-case style is required, returns an offset from which we start horizontal layout.
- need_
block_ ๐indent - no_
long_ ๐items - rewrite_
with_ ๐angle_ brackets - rewrite_
with_ ๐parens - rewrite_
with_ ๐square_ brackets - shape_
from_ ๐indent_ style