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 18 pull requests #81578

Merged
merged 41 commits into from
Jan 31, 2021
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
fe2880a
stabilise --include-ignored
gilescope Dec 15, 2020
a55039d
Stabilize Arc::{incr,decr}_strong_count
yoshuawuyts Nov 22, 2020
05af421
Implement `AsMut<str>` for `str`
Yaulendil Dec 21, 2020
61c49d4
Stabilize by-value `[T; N]` iterator `core::array::IntoIter`
SimonSapin Dec 29, 2020
12014d2
Add Box::downcast() for dyn Any + Send + Sync
sdroege Jan 12, 2021
b50df6d
Stabilize `core::slice::fill_with`
yoshuawuyts Jan 15, 2021
8758083
Remove requirement that forces symmetric and transitive PartialEq imp…
dtolnay Jan 19, 2021
83d32b0
Add example to array::IntoIter::new’s doc-comment
SimonSapin Jan 21, 2021
a398994
Account for existing `_` field pattern when suggesting `..`
estebank Jan 27, 2021
5d73918
Clone entire `TokenCursor` when collecting tokens
Aaron1011 Jan 28, 2021
ada714d
Optimize udiv_1e19() function
Kogia-sima Jan 28, 2021
81ed4cf
Add a regression test
0yoyoyo Jan 29, 2021
56c2736
Replace predecessor with range in collections documentation
KamilaBorowska Jan 30, 2021
7e32178
Balance sidebar `Deref` cycle check with main content
jryans Jan 28, 2021
4a2a5f0
Fix ascii art text wrapping in mobile
pickfire Jan 30, 2021
55d6247
Clarify that guarantees extend to other advancing iterator methods.
the8472 Jan 30, 2021
d3048ee
Improve docblock readability on small screen
pickfire Jan 30, 2021
6d7ef10
Fix docblock short code missing end whitespaces
pickfire Jan 30, 2021
131ee07
Remove extra trailing spaces
pickfire Jan 30, 2021
adfb04f
Edit rustc_typeck top-level docs
pierwill Jan 30, 2021
fe4ac95
Bump stable version of arc_mutate_strong_count
m-ou-se Jan 30, 2021
bef4ec2
Bump as_mut_str_for_str stable version.
m-ou-se Jan 30, 2021
f1cd179
impl Seek for Empty
oberien Oct 17, 2020
1bf1305
Rollup merge of #78044 - oberien:empty-seek, r=m-ou-se
jonas-schievink Jan 31, 2021
ac37c32
Rollup merge of #79285 - yoshuawuyts:stabilize-arc_mutate_strong_coun…
jonas-schievink Jan 31, 2021
b28a1b2
Rollup merge of #80053 - gilescope:include-ignore, r=m-ou-se
jonas-schievink Jan 31, 2021
054c29d
Rollup merge of #80279 - Yaulendil:str-as-mut, r=m-ou-se
jonas-schievink Jan 31, 2021
1e99f26
Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-se
jonas-schievink Jan 31, 2021
caf2c06
Rollup merge of #80945 - sdroege:downcast-send-sync, r=m-ou-se
jonas-schievink Jan 31, 2021
0793fab
Rollup merge of #81048 - yoshuawuyts:stabilize-core-slice-fill-with, …
jonas-schievink Jan 31, 2021
13b3294
Rollup merge of #81198 - dtolnay:partialeq, r=m-ou-se
jonas-schievink Jan 31, 2021
84b6f46
Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwco
jonas-schievink Jan 31, 2021
3e8ae5d
Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petroch…
jonas-schievink Jan 31, 2021
fd868d0
Rollup merge of #81484 - Kogia-sima:perf/optimize-udiv_1e19, r=nagisa
jonas-schievink Jan 31, 2021
4de3181
Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeG…
jonas-schievink Jan 31, 2021
c74f004
Rollup merge of #81509 - 0yoyoyo:fix-issue-72685-ice-drop-in-place, r…
jonas-schievink Jan 31, 2021
33cd862
Rollup merge of #81547 - pierwill:edit-typeck-mod-docs, r=davidtwco
jonas-schievink Jan 31, 2021
635dbd6
Rollup merge of #81550 - xfix:replace-mention-of-predecessor, r=jonas…
jonas-schievink Jan 31, 2021
45d24c7
Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomez
jonas-schievink Jan 31, 2021
7097105
Rollup merge of #81562 - the8472:improve-inplaceiterable-docs, r=sfac…
jonas-schievink Jan 31, 2021
8b281d9
Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomez
jonas-schievink Jan 31, 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.
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
@@ -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());
@@ -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()) {
@@ -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())
@@ -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);
}
}
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) {}
}