Auto merge of #94706 - matthiaskrgr:rollup-l5erynr, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #93350 (libunwind: readd link attrs to _Unwind_Backtrace) - #93827 (Stabilize const_fn_fn_ptr_basics, const_fn_trait_bound, and const_impl_trait) - #94696 (Remove whitespaces and use CSS to align line numbers to the right instead) - #94700 (rustdoc: Update minifier version) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
03918badd3
110 changed files with 170 additions and 1012 deletions
|
@ -272,22 +272,16 @@ crate fn print_src(
|
|||
) {
|
||||
let lines = s.lines().count();
|
||||
let mut line_numbers = Buffer::empty_from(buf);
|
||||
let mut cols = 0;
|
||||
let mut tmp = lines;
|
||||
while tmp > 0 {
|
||||
cols += 1;
|
||||
tmp /= 10;
|
||||
}
|
||||
line_numbers.write_str("<pre class=\"line-numbers\">");
|
||||
match source_context {
|
||||
SourceContext::Standalone => {
|
||||
for line in 1..=lines {
|
||||
writeln!(line_numbers, "<span id=\"{0}\">{0:1$}</span>", line, cols)
|
||||
writeln!(line_numbers, "<span id=\"{0}\">{0}</span>", line)
|
||||
}
|
||||
}
|
||||
SourceContext::Embedded { offset } => {
|
||||
for line in 1..=lines {
|
||||
writeln!(line_numbers, "<span>{0:1$}</span>", line + offset, cols)
|
||||
writeln!(line_numbers, "<span>{0}</span>", line + offset)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -541,6 +541,9 @@ h2.location a {
|
|||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.line-numbers {
|
||||
text-align: right;
|
||||
}
|
||||
.rustdoc:not(.source) .example-wrap > pre:not(.line-number) {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue