Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #81355

Merged
merged 46 commits into from
Jan 25, 2021
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
39466bc
implement Error for &(impl Error)
KodrAus Aug 5, 2020
573ec31
update stabilization to 1.49.0
KodrAus Oct 31, 2020
517d462
Make std::future a re-export of core::future
taiki-e Nov 18, 2020
c387e29
Replace magic numbers with existing constants
Digital-Chaos Dec 10, 2020
bbf5001
bump stabilization to 1.51.0
KodrAus Dec 21, 2020
a1c41e9
Expand assert!(expr, args..) to include $crate for hygiene on 2021.
m-ou-se Jan 9, 2021
8098ac1
Add test for assert!() hygiene in edition 2021.
m-ou-se Jan 9, 2021
7378676
Fix sysroot option not being honored across rustc
rcvalle Jan 20, 2021
3e9f27d
Remove unnecessary closure
bugadani Jan 22, 2021
58a90de
No peeking
bugadani Jan 22, 2021
9988821
Move missing_item check inside condition
bugadani Jan 22, 2021
d63b278
Only scan through assoc items once in check_impl_items_against_trait
bugadani Jan 22, 2021
ee639de
Only guess span if absolutely necessary
bugadani Jan 22, 2021
aa4f583
Only query associated_items once
bugadani Jan 22, 2021
f29b329
Fix formatting
bugadani Jan 22, 2021
99a1dea
Do not mark unit variants as used when in path pattern
tmiasko Jan 23, 2021
794880c
Don't provide backend_optimization_level query for extern crates
bjorn3 Jan 23, 2021
d118021
Permit mutable references in all const contexts
oli-obk Jan 3, 2021
b217fab
Rename tests to what their code actually does
oli-obk Jan 16, 2021
3cd0b46
Fix a comment that only made sense in the context of a dataflow based…
oli-obk Jan 16, 2021
00e62fa
Adjust wording of a diagnostic
oli-obk Jan 16, 2021
14f39aa
Do not allow arbitrary mutable references in `static mut`, just keep …
oli-obk Jan 16, 2021
cd09871
Cover more cases in the test suite
oli-obk Jan 23, 2021
819b008
Put dynamic check tests into their own file
oli-obk Jan 23, 2021
1129e86
Cleanup `render_stability_since_raw` to remove code duplication
LeSeulArtichaut Jan 23, 2021
9b1d27d
Add option to control doctest run directory
Swatinem Jan 22, 2021
20a460e
Fix rendering of stabilization version for trait implementors
LeSeulArtichaut Jan 23, 2021
14aa12f
Replace version_check dependency with own version parsing code
est31 Jan 22, 2021
351b2ac
Make bad shlex parsing a pretty error
CraftSpider Jan 24, 2021
c37c421
fmt
CraftSpider Jan 24, 2021
f8416fa
Clean up dominators_given_rpo
bugadani Jan 24, 2021
a730970
Only call span.rust_2021() when necessary.
m-ou-se Jan 24, 2021
5a1f2ec
Rollup merge of #75180 - KodrAus:feat/error-by-ref, r=m-ou-se
jonas-schievink Jan 24, 2021
d9c177f
Rollup merge of #78578 - oli-obk:const_mut_refs, r=RalfJung
jonas-schievink Jan 24, 2021
13b88c2
Rollup merge of #79174 - taiki-e:std-future, r=Mark-Simulacrum
jonas-schievink Jan 24, 2021
3ed8a37
Rollup merge of #79884 - Digital-Chaos:replace-magic, r=m-ou-se
jonas-schievink Jan 24, 2021
e8ef15d
Rollup merge of #80855 - m-ou-se:assert-2021, r=petrochenkov
jonas-schievink Jan 24, 2021
27abbc2
Rollup merge of #80933 - rcvalle:fix-sysroot-option, r=nagisa
jonas-schievink Jan 24, 2021
22dc82f
Rollup merge of #81259 - est31:cfg_version, r=petrochenkov
jonas-schievink Jan 24, 2021
504d6de
Rollup merge of #81264 - Swatinem:doctest-run-directory, r=jyn514
jonas-schievink Jan 24, 2021
70be327
Rollup merge of #81279 - bugadani:iter, r=davidtwco
jonas-schievink Jan 24, 2021
9089dd2
Rollup merge of #81297 - bjorn3:no_extern_backend_optimization_level_…
jonas-schievink Jan 24, 2021
ee4461a
Rollup merge of #81302 - LeSeulArtichaut:80777-trait-render, r=jyn514
jonas-schievink Jan 24, 2021
04ddf42
Rollup merge of #81310 - tmiasko:in-pattern, r=petrochenkov
jonas-schievink Jan 24, 2021
558b878
Rollup merge of #81320 - CraftSpider:jsondoc-errors, r=jyn514
jonas-schievink Jan 24, 2021
529f15f
Rollup merge of #81338 - bugadani:dominator-cleanup, r=davidtwco
jonas-schievink Jan 24, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Cleanup render_stability_since_raw to remove code duplication
  • Loading branch information
LeSeulArtichaut committed Jan 23, 2021
commit 1129e8678038cfc938559b90b4155dde8b84edf3
43 changes: 17 additions & 26 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2934,34 +2934,25 @@ fn render_stability_since_raw(
containing_ver: Option<&str>,
containing_const_ver: Option<&str>,
) {
let ver = ver.and_then(|inner| if !inner.is_empty() { Some(inner) } else { None });
let ver = ver.filter(|inner| !inner.is_empty());
let const_ver = const_ver.filter(|inner| !inner.is_empty());

let const_ver = const_ver.and_then(|inner| if !inner.is_empty() { Some(inner) } else { None });

if let Some(v) = ver {
if let Some(cv) = const_ver {
if const_ver != containing_const_ver {
write!(
w,
"<span class=\"since\" title=\"Stable since Rust version {0}, const since {1}\">{0} (const: {1})</span>",
v, cv
);
} else if ver != containing_ver {
write!(
w,
"<span class=\"since\" title=\"Stable since Rust version {0}\">{0}</span>",
v
);
}
} else {
if ver != containing_ver {
write!(
w,
"<span class=\"since\" title=\"Stable since Rust version {0}\">{0}</span>",
v
);
}
match (ver, const_ver) {
(Some(v), Some(cv)) if const_ver != containing_const_ver => {
write!(
w,
"<span class=\"since\" title=\"Stable since Rust version {0}, const since {1}\">{0} (const: {1})</span>",
v, cv
);
}
(Some(v), _) if ver != containing_ver => {
write!(
w,
"<span class=\"since\" title=\"Stable since Rust version {0}\">{0}</span>",
v
);
}
_ => {}
}
}

Expand Down