Skip to content

Rollup of 11 pull requests #80781

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

Closed
wants to merge 35 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
274e299
Stablize slice::strip_prefix and strip_suffix, with SlicePattern
ijackson Oct 12, 2020
f51b681
Use existing slice_pattern feature for SlicePattern
ijackson Dec 12, 2020
beb293d
Drop pointless as_slice call.
ijackson Dec 27, 2020
03b4ea4
Mark SlicePattern trait uses as ?Sized
ijackson Dec 27, 2020
8b2e79d
Add test for slice as prefix/suffix pattern
ijackson Dec 27, 2020
9a240e4
Edit rustc_ast::tokenstream docs
pierwill Jan 3, 2021
b4a0ef0
fix issue 80559
max-heller Jan 3, 2021
e33a205
primitive disambiguator tests
max-heller Jan 4, 2021
fc3a405
still verify disambiguators for primitives
max-heller Jan 4, 2021
06b0900
half working
max-heller Jan 4, 2021
6f04133
fix incompatible disambiguator test
max-heller Jan 4, 2021
2bdbb0d
Document hackiness around primitive associated item disambiguators
max-heller Jan 5, 2021
aea9a4b
Remove bottom margin from crate version when the sidebar is collapsed.
arusahni Jan 5, 2021
e636805
rustdoc: Turn `next_def_id` comments into docs
camelid Jan 6, 2021
1a2ee0b
Update cargo
ehuss Jan 6, 2021
7428e2d
Apply suggestions from code review
camelid Jan 6, 2021
7bc22e9
Don't use to_string on Symbol
GuillaumeGomez Jan 6, 2021
fa4d8bc
Prefer enum Endian in rustc_target::Target
tesuji Jan 5, 2021
8ee804d
Change related spec files to use the new enum
tesuji Jan 5, 2021
3f74fbd
handle generic trait methods in coverage tests
andjo403 Jan 6, 2021
f03907b
Add pointing const identifier when emitting E0435
sasurau4 Dec 13, 2020
c9e7045
bless tests
sasurau4 Dec 13, 2020
c71348a
Refine E0435 description
sasurau4 Dec 26, 2020
f942c3c
Return EOF_CHAR constant instead of magic char.
Jan 7, 2021
bc751f2
Rollup merge of #77853 - ijackson:slice-strip-stab, r=Amanieu
Dylan-DPC Jan 7, 2021
72dfeff
Rollup merge of #80012 - sasurau4:feature/point-constant-identifier-E…
Dylan-DPC Jan 7, 2021
7a1c817
Rollup merge of #80659 - pierwill:edit-tokenstream, r=davidtwco
Dylan-DPC Jan 7, 2021
208710a
Rollup merge of #80660 - max-heller:issue-80559-fix, r=jyn514
Dylan-DPC Jan 7, 2021
69daa35
Rollup merge of #80709 - lzutao:target-enumerate, r=petrochenkov
Dylan-DPC Jan 7, 2021
9342728
Rollup merge of #80738 - arusahni:master, r=GuillaumeGomez
Dylan-DPC Jan 7, 2021
55c007a
Rollup merge of #80744 - camelid:next_def_id-docs, r=jyn514
Dylan-DPC Jan 7, 2021
cc1238f
Rollup merge of #80746 - ehuss:update-cargo, r=ehuss
Dylan-DPC Jan 7, 2021
9558447
Rollup merge of #80750 - GuillaumeGomez:cleanup-to_string, r=lzutao
Dylan-DPC Jan 7, 2021
38ccca7
Rollup merge of #80761 - andjo403:generic_coverage, r=wesleywiser
Dylan-DPC Jan 7, 2021
e4ecfea
Rollup merge of #80780 - lianghanzhen:master, r=petrochenkov
Dylan-DPC Jan 7, 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
rustdoc: Turn next_def_id comments into docs
  • Loading branch information
camelid committed Jan 6, 2021
commit e636805eee49ff2e8bc30429ab91a8e2508656b3
4 changes: 3 additions & 1 deletion src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
@@ -291,7 +291,9 @@ impl Item {
}
}

/// See comments on next_def_id
/// See the documentation for [`next_def_id()`].
///
/// [`next_def_id()`]: crate::core::DocContext::next_def_id()
crate fn is_fake(&self) -> bool {
MAX_DEF_ID.with(|m| {
m.borrow().get(&self.def_id.krate).map(|id| self.def_id >= *id).unwrap_or(false)
22 changes: 14 additions & 8 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
@@ -120,14 +120,20 @@ impl<'tcx> DocContext<'tcx> {
r
}

// This is an ugly hack, but it's the simplest way to handle synthetic impls without greatly
// refactoring either librustdoc or librustc_middle. In particular, allowing new DefIds to be
// registered after the AST is constructed would require storing the defid mapping in a
// RefCell, decreasing the performance for normal compilation for very little gain.
//
// Instead, we construct 'fake' def ids, which start immediately after the last DefId.
// In the Debug impl for clean::Item, we explicitly check for fake
// def ids, as we'll end up with a panic if we use the DefId Debug impl for fake DefIds
/// Create a new "fake" [`DefId`].
///
/// This is an ugly hack, but it's the simplest way to handle synthetic impls without greatly
/// refactoring either `librustdoc` or [`rustc_middle`]. In particular, allowing new [`DefId`]s
/// to be registered after the AST is constructed would require storing the [`DefId`] mapping
/// in a [`RefCell`], decreasing the performance for normal compilation for very little gain.
///
/// Instead, we construct "fake" [`DefId`]s, which start immediately after the last `DefId`.
/// In the [`Debug`] impl for [`clean::Item`], we explicitly check for fake `DefId`s,
/// as we'll end up with a panic if we use the `DefId` `Debug` impl for fake `DefId`s.
///
/// [`RefCell`]: std::cell::RefCell
/// [`Debug`]: std::fmt::Debug
/// [`clean::Item`]: crate::clean::types::Item
crate fn next_def_id(&self, crate_num: CrateNum) -> DefId {
let start_def_id = {
let num_def_ids = if crate_num == LOCAL_CRATE {