8000 Rollup of 9 pull requests by jonas-schievink · Pull Request #81559 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 9 pull requests #81559

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 30 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
12014d2
Add Box::downcast() for dyn Any + Send + Sync
sdroege Jan 12, 2021
8db2782
refactor: moved new out of ZipImpl
DeveloperC286 Dec 16, 2020
bfb0e4a
refactor: moved next_back out of ZipImpl
DeveloperC286 Dec 16, 2020
0597339
refactor: removed ZipImpl
DeveloperC286 Dec 16, 2020
f2bb202
refactor: updated zip nth() to iterator nth()
DeveloperC286 Dec 16, 2020
a398994
Account for existing `_` field pattern when suggesting `..`
estebank Jan 27, 2021
3f679fe
Fix rustc sysroot in systems using CAS
rcvalle Nov 21, 2020
5d73918
Clone entire `TokenCursor` when collecting tokens
Aaron1011 Jan 28, 2021
ada714d
Optimize udiv_1e19() function
Kogia-sima Jan 28, 2021
152f500
refactor: removing redundant variables
DeveloperC286 Jan 28, 2021
b421cd5
Restrict precision of captures with `capture_disjoint_fields` set
arora-aman Dec 4, 2020
3488082
Compute mutability of closure captures
arora-aman Dec 2, 2020
1373f98
Test cases for handling mutable references
arora-aman Dec 13, 2020
0897db5
Test for restricting capture precision
arora-aman Dec 14, 2020
604cbdc
Fix unused 'mut' warning for capture's root variable
arora-aman Dec 16, 2020
c748f32
Fix incorrect use mut diagnostics
arora-aman Dec 13, 2020
ffd5327
Add fixme for precise path diagnostics
arora-aman Jan 12, 2021
fadf03e
Fix typos
arora-aman Jan 29, 2021
0f4bab2
Fixme for closure origin when reborrow is implemented
arora-aman Jan 29, 2021
56c2736
Replace predecessor with range in collections documentation
LunaBorowska Jan 30, 2021
7e32178
Balance sidebar `Deref` cycle check with main content
jryans Jan 28, 2021
2ad8c2f
Rollup merge of #79173 - DeveloperC286:zip_nth_cleanup, r=kennytm
jonas-schievink Jan 30, 2021
950c10c
Rollup merge of #79253 - rcvalle:fix-rustc-sysroot-cas, r=nagisa
jonas-schievink Jan 30, 2021
93dbd0f
Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakis
jonas-schievink Jan 30, 2021
7a718eb
Rollup merge of #80945 - sdroege:downcast-send-sync, r=m-ou-se
jonas-schievink Jan 30, 2021
3a61c21
Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwco
jonas-schievink Jan 30, 2021
022eada
Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…
jonas-schievink Jan 30, 2021
6f67e2f
Rollup merge of #81484 - Kogia-sima:perf/optimize-udiv_1e19, r=nagisa
jonas-schievink Jan 30, 2021
23643ad
Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…
jonas-schievink Jan 30, 2021
de95341
Rollup merge of #81550 - xfix:replace-mention-of-predecessor, r=jonas…
jonas-schievink Jan 30, 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
Balance sidebar Deref cycle check with main content
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense
that the main content code path checks for cycles _before_ descending, while the
sidebar checks _after_. Checking _before_ is correct, so this changes the
sidebar path to match the main content path.
  • Loading branch information
jryans committed Jan 30, 2021
commit 7e3217845dc5dea331b26efb2bf51b60afae2082
18 changes: 11 additions & 7 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3510,6 +3510,7 @@ fn render_assoc_items(
"deref-methods-{:#}",
type_.print(cx.cache())
)));
debug!("Adding {} to deref id map", type_.print(cx.cache()));
cx.deref_id_map
.borrow_mut()
.insert(type_.def_id_full(cx.cache()).unwrap(), id.clone());
Expand Down Expand Up @@ -3626,6 +3627,7 @@ fn render_deref_methods(
_ => None,
})
.expect("Expected associated type binding");
debug!("Render deref methods for {:#?}, target {:#?}", impl_.inner_impl().for_, target);
let what =
AssocItemRender::DerefFor { trait_: deref_type, type_: real_target, deref_mut_: deref_mut };
if let Some(did) = target.def_id_full(cx.cache()) {
Expand Down Expand Up @@ -4416,6 +4418,15 @@ fn sidebar_deref_methods(cx: &Context<'_>, out: &mut Buffer, impl_: &Impl, v: &V
})
{
debug!("found target, real_target: {:?} {:?}", target, real_target);
if let Some(did) = target.def_id_full(cx.cache()) {
if let Some(type_did) = impl_.inner_impl().for_.def_id_full(cx.cache()) {
// `impl Deref<Target = S> for S`
if did == type_did {
// Avoid infinite cycles
return;
}
}
}
let deref_mut = v
.iter()
.filter(|i| i.inner_impl().trait_.is_some())
Expand Down Expand Up @@ -4464,13 +4475,6 @@ fn sidebar_deref_methods(cx: &Context<'_>, out: &mut Buffer, impl_: &Impl, v: &V
.filter(|i| i.inner_impl().trait_.is_some())
.find(|i| i.inner_impl().trait_.def_id_full(cx.cache()) == c.deref_trait_did)
{
if let Some(type_did) = impl_.inner_impl().for_.def_id_full(cx.cache()) {
// `impl Deref<Target = S> for S`
if target_did == type_did {
// Avoid infinite cycles
return;
}
}
sidebar_deref_methods(cx, out, target_deref_impl, target_impls);
}
}
Expand Down
15 changes: 15 additions & 0 deletions src/test/rustdoc-ui/deref-generic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// check-pass
// #81395: Fix ICE when recursing into Deref target only differing in type args

pub struct Generic<T>(T);

impl<'a> std::ops::Deref for Generic<&'a mut ()> {
type Target = Generic<&'a ()>;
fn deref(&self) -> &Self::Target {
unimplemented!()
}
}

impl<'a> Generic<&'a ()> {
pub fn some_method(&self) {}
}
0