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 15 pull requests #81784

Merged
merged 41 commits into from
Feb 5, 2021
Merged
Changes from 3 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a072ecb
Don't build remote-test-server with the stage0 toolchain
Jan 20, 2021
b5482a8
Preserve existing LD_LIBRARY_PATH in remote-test-server
Jan 20, 2021
a2f5c72
Fix has_body for trait methods
CraftSpider Jan 24, 2021
1c60d27
Remove leading newline
CraftSpider Jan 24, 2021
3106de5
Remove struct_type from union output and bump format
CraftSpider Jan 24, 2021
c34faad
rustdoc: Move `display_fn` struct inside `display_fn`
camelid Jan 29, 2021
5882cce
Expose correct symlink API on WASI
RReverser Jan 30, 2021
6e6608d
Add additional benchmarks to bit_set
JulianKnodt Feb 2, 2021
1578f2e
Keep old symlink; expose new symlink_path
RReverser Feb 3, 2021
f4b1bef
Restore comment as it was
RReverser Feb 3, 2021
82914a5
Add more information to the error code for 'crate not found'
jyn514 Feb 2, 2021
3b5d018
Handle `Span`s for byte and raw strings and add more detail
estebank Jan 23, 2021
50e394a
relax adt unsizing requirements
lcnr Jan 5, 2021
031cce8
add `relaxed_struct_unsize` feature gate
lcnr Feb 3, 2021
d06384a
make Allocator object-safe
RustyYato Feb 3, 2021
fdaf603
add generic args to hir::TypeBinding
b-naber Nov 30, 2020
16af7bf
hir pretty printing
b-naber Nov 30, 2020
760a665
lowering of generic args in AssocTyConstraint
b-naber Nov 30, 2020
da2cf9b
substitutions in trait predicates
b-naber Nov 30, 2020
6a68966
use generic arguments of associated item in trait_ref method
b-naber Nov 30, 2020
9e92015
remove subst_supertrait call
b-naber Nov 30, 2020
b080d1c
Cleanup rustdoc pass descriptions a bit
camelid Feb 4, 2021
12d411f
add tests
b-naber Nov 30, 2020
0c3a7d8
Update LayoutError/LayoutErr stability attributes
Feb 5, 2021
4253919
Indicate change in RSS from start to end of pass in time-passes output
tgnottingham Feb 5, 2021
573f1c0
Fix `install-awscli.sh` error in CI.
m-ou-se Feb 5, 2021
deec6a9
Rollup merge of #79554 - b-naber:generic-associated-types-in-trait-pa…
m-ou-se Feb 5, 2021
676ff77
Rollup merge of #80726 - lcnr:unsize-query, r=oli-obk
m-ou-se Feb 5, 2021
8d49ca1
Rollup merge of #81307 - estebank:invalid-byte-str-span, r=petrochenkov
m-ou-se Feb 5, 2021
0493e3a
Rollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514
m-ou-se Feb 5, 2021
b5438e2
Rollup merge of #81456 - Amanieu:remote-test-server, r=Amanieu
m-ou-se Feb 5, 2021
2451bf9
Rollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jy…
m-ou-se Feb 5, 2021
e98e42b
Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514
m-ou-se Feb 5, 2021
ce1020f
Rollup merge of #81542 - RReverser:wasi-symlink, r=alexcrichton
m-ou-se Feb 5, 2021
29371c2
Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obk
m-ou-se Feb 5, 2021
21c276f
Rollup merge of #81682 - JulianKnodt:bit_set_iter_benchmarks, r=oli-obk
m-ou-se Feb 5, 2021
ff3c85f
Rollup merge of #81730 - RustyYato:object-safe-allocator, r=Amanieu
m-ou-se Feb 5, 2021
469d535
Rollup merge of #81763 - camelid:rustdoc-passes-desc-up, r=GuillaumeG…
m-ou-se Feb 5, 2021
e077dff
Rollup merge of #81767 - exrook:layout-error-stability, r=Mark-Simula…
m-ou-se Feb 5, 2021
08d8fc1
Rollup merge of #81771 - tgnottingham:time-passes-rss-delta, r=oli-obk
m-ou-se Feb 5, 2021
2383cd4
Rollup merge of #81781 - m-ou-se:fix-ci, r=pietroalbini
m-ou-se Feb 5, 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
20 changes: 9 additions & 11 deletions src/librustdoc/json/conversions.rs
Original file line number Diff line number Diff line change
@@ -162,8 +162,8 @@ impl From<clean::ItemKind> for ItemEnum {
ForeignFunctionItem(f) => ItemEnum::FunctionItem(f.into()),
TraitItem(t) => ItemEnum::TraitItem(t.into()),
TraitAliasItem(t) => ItemEnum::TraitAliasItem(t.into()),
MethodItem(m, _) => ItemEnum::MethodItem(m.into()),
TyMethodItem(m) => ItemEnum::MethodItem(m.into()),
MethodItem(m, _) => ItemEnum::MethodItem(from_function_method(m, true)),
TyMethodItem(m) => ItemEnum::MethodItem(from_function_method(m, false)),
ImplItem(i) => ItemEnum::ImplItem(i.into()),
StaticItem(s) => ItemEnum::StaticItem(s.into()),
ForeignStaticItem(s) => ItemEnum::StaticItem(s.into()),
@@ -435,15 +435,13 @@ impl From<clean::Impl> for Impl {
}
}

impl From<clean::Function> for Method {
fn from(function: clean::Function) -> Self {
let clean::Function { header, decl, generics, all_types: _, ret_types: _ } = function;
Method {
decl: decl.into(),
generics: generics.into(),
header: stringify_header(&header),
has_body: true,
}
crate fn from_function_method(function: clean::Function, has_body: bool) -> Method {
let clean::Function { header, decl, generics, all_types: _, ret_types: _ } = function;
Method {
decl: decl.into(),
generics: generics.into(),
header: stringify_header(&header),
has_body,
}
}

21 changes: 21 additions & 0 deletions src/test/rustdoc-json/traits/has_body.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// @has has_body.json "$.index[*][?(@.name=='Foo')]"
pub trait Foo {
// @has - "$.index[*][?(@.name=='no_self')].inner.has_body" false
fn no_self();
// @has - "$.index[*][?(@.name=='move_self')].inner.has_body" false
fn move_self(self);
// @has - "$.index[*][?(@.name=='ref_self')].inner.has_body" false
fn ref_self(&self);

// @has - "$.index[*][?(@.name=='no_self_def')].inner.has_body" true
fn no_self_def() {}
// @has - "$.index[*][?(@.name=='move_self_def')].inner.has_body" true
fn move_self_def(self) {}
// @has - "$.index[*][?(@.name=='ref_self_def')].inner.has_body" true
fn ref_self_def(&self) {}
}

pub trait Bar: Clone {
// @has - "$.index[*][?(@.name=='method')].inner.has_body" false
fn method(&self, param: usize);
}