Commit graph

49 commits

Author SHA1 Message Date
Manish Goregaokar
e003c3ea05 Add test for proc macro resolution in intra doc links 2020-06-09 16:35:59 -07:00
Mark Rousskov
a1f81ff0ad rustdoc supports const re-exports 2020-04-29 11:52:02 -04:00
Oliver Middleton
6f96dc221c rustdoc: Don't try to load source files from external crates
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
2020-04-08 18:35:17 +01:00
Oliver Middleton
bbc2ae7590 rustdoc: Fix re-exporting primitive types
* Generate links to the primitive type docs for re-exports.
* Don't ICE on cross crate primitive type re-exports.
* Make primitive type re-exports show up cross crate.
2020-01-26 21:32:43 +00:00
Daniel Silverstone
33ded3ec7f
rustdoc: Deliberately load extern crates before processing docs
In order that we can successfully later resolve paths in crates
which weren't loaded as a result of merely parsing the crate
we're documenting, we force the resolution of the path to each
crate before cloning the resolver to use later.  Closes #66159

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-11-08 07:41:40 +00:00
bors
a37fe2de69 Auto merge of #63937 - Nashenas88:rustdoc_57180, r=GuillaumeGomez
Fix ICE in rustdoc when merging generic and where bounds of an Fn with an output

Fixes #57180
2019-09-27 13:51:25 +00:00
Paul Daniel Faria
143b83a3c1 Add regression test for issue, apply suggestion to convert to assert_eq 2019-08-28 00:21:30 -04:00
Esteban Küber
7ed542da78 add regression test 2019-08-26 21:35:22 -07:00
varkor
7f0f0e31ec Remove double trailing newlines 2019-04-22 16:57:01 +01:00
bors
ee1474acc4 Auto merge of #58972 - QuietMisdreavus:intra-doc-link-imports, r=GuillaumeGomez
rustdoc: don't process `Crate::external_traits` when collecting intra-doc links

Part of https://github.com/rust-lang/rust/issues/58745, closes https://github.com/rust-lang/rust/pull/58917

The `collect-intra-doc-links` pass keeps track of the modules it recurses through as it processes items. This is used to know what module to give the resolver when looking up links. When looking through the regular items of the crate, this works fine, but the `DocFolder` trait as written doesn't just process the main crate hierarchy - it also processes the trait items in the `external_traits` map. This is useful for other passes (so they can strip out `#[doc(hidden)]` items, for example), but here it creates a situation where we're processing items "outside" the regular module hierarchy. Since everything in `external_traits` is defined outside the current crate, we can't fall back to finding its module scope like we do with local items.

Skipping this collection saves us from emitting some spurious warnings. We don't even lose anything by skipping it, either - the docs loaded from here are only ever rendered through `html::render::document_short` which strips any links out, so the fact that the links haven't been loaded doesn't matter. Hopefully this removes most of the remaining spurious resolution warnings from intra-doc links.

r? @GuillaumeGomez
2019-04-11 08:48:26 +00:00
Alexander Regueiro
fe30743c79 Moved issue tests to subdirs and normalised names. 2019-03-14 01:00:49 +00:00
QuietMisdreavus
49cde40412 add test for spurious intra-doc link warning 2019-03-06 10:57:38 -06:00
Alexander Regueiro
b87363e763 tests: doc comments 2019-02-10 23:42:32 +00:00
Alexander Regueiro
88336ea4c3 Cosmetic improvements 2019-01-13 19:47:02 +00:00
DebugSteven
ca47808479 add test for pub extern crate 2019-01-10 21:18:46 -05:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Alex Burka
273930e59f test that rustdoc doesn't overflow on a big enum 2018-11-01 04:02:43 +00:00
Oliver Schneider
ec74d3533a Stabilize min_const_fn 2018-10-05 10:36:14 +02:00
Oliver Middleton
d3e56854e1 rustdoc: Remove generated blanket impls from trait pages 2018-09-09 18:27:05 +01:00
Oliver Schneider
d125e904b5 Restrict most uses of const_fn to min_const_fn 2018-08-31 08:40:00 +02:00
bors
b239743753 Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.
2018-08-06 16:58:27 +00:00
varkor
f22ccbe315 Fix run-pass-fulldeps tests 2018-08-05 15:54:49 +01:00
QuietMisdreavus
001445b235 add tests for new intra-doc-link behavior 2018-08-04 22:20:45 -05:00
bors
715d6a98aa Auto merge of #50305 - GuillaumeGomez:fix-mod-stackoverflow, r=QuietMisdreavus
Prevent infinite recursion of modules

Fixes #50196.

r? @QuietMisdreavus
2018-05-07 23:18:12 +00:00
Guillaume Gomez
3ba7c00f94 Prevent infinite recursion of modules 2018-05-07 12:44:03 +02:00
Oliver Middleton
7232df7d5a rustdoc: Fix links to constants in external crates 2018-04-29 23:28:39 +01:00
Manish Goregaokar
33dceaa244 rustdoc: Add test for foreign impl trait with bounds 2018-03-27 23:57:03 +02:00
QuietMisdreavus
8872e7b593 add test for issue 48414 ICE 2018-02-21 19:58:20 -06:00
Oliver Middleton
528d6b65b6 rustdoc: Hide -> () in cross crate inlined Fn* bounds 2018-02-07 13:14:37 +00:00
Alex Crichton
1dc85768d2 Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollup 2018-01-26 06:51:58 -08:00
Oliver Middleton
2e81ce7dfa rustdoc: Hide methods from #[doc(masked)] crates from the search index 2018-01-23 04:22:20 +00:00
Oliver Middleton
04a884726a rustdoc: Show when traits are auto traits 2018-01-23 01:04:24 +00:00
leonardo.yvens
02b5fee732 Adjust tests for removal of impl Foo for .. {} 2018-01-13 18:48:00 +03:00
bors
304717bd86 Auto merge of #46894 - detrumi:fix-const-eval-trait, r=eddyb
Const-eval array lengths in rustdoc.

Fixes #46727
r? @eddyb

Big thanks to @eddyb for helping me figure this out.
2017-12-24 12:48:57 +00:00
Wilco Kusee
d10d389225 Testcase for const-eval array lengths 2017-12-23 11:16:03 +01:00
QuietMisdreavus
f873c55709 test for missing_doc in the external_doc test 2017-12-19 16:43:46 -06:00
QuietMisdreavus
f9f3611f5c allow loading external files in documentation
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990
(needs error reporting work)

cc #44732
2017-11-21 15:46:49 -06:00
Florian Hartwig
32af136fb0 Make rustdoc not include self-by-value methods from Deref target 2017-11-20 00:15:26 +01:00
leonardo.yvens
8b586e68b5 auto trait future compatibility lint 2017-11-03 16:13:21 -02:00
Sean McArthur
74b2d69358 remove associated_consts feature gate 2017-07-06 11:52:25 -07:00
Aaron Hill
63a291feba
Fix rustdoc infinitely recursing when an external crate reexports itself
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the
child modules of an external crate. If a module re-exported its parent
via 'pub use super::*', rustdoc would re-walk the parent, leading to
infinite recursion.

This commit makes LibEmbargoVisitor store already visited modules in an
FxHashSet, ensuring that each module is only walked once.

Fixes #40936
2017-04-09 12:12:05 -04:00
Austin Bonander
d8fc5b80b6 Rustdoc: test proper representation for pub use macros 2017-03-28 12:39:47 -07:00
bors
ea45edf0ee Auto merge of #35745 - jroesch:soundness-fix-29859, r=nikomatsakis
Fix soundness bug described in #29859

This is an attempt at fixing the problems described in #29859 based on an IRC conversation between @nikomatsakis and I today. I'm waiting on a full build to come back, otherwise both tests trigger the correct error.
2016-09-08 10:40:31 -07:00
Jared Roesch
9510add6a3 Remove illegal bound from doc test 2016-09-02 11:58:02 -07:00
Oliver Middleton
b56d61cfd7 rustdoc: Fix associated consts in search results
Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.
2016-08-29 18:36:57 +01:00
Vadim Petrochenkov
737961b6c6 Make private_in_public compatibility lint deny-by-default 2016-08-11 23:19:04 +03:00
Oliver Middleton
b905464668 rustdoc: Fix methods in seach results
Currently methods from extern crates are sometimes added to the search
index when they shouldn't be or added with the original path rather than
the reexported path. This fixes that by making sure `cache().paths` only
contains local paths like the description for it states. It also fixes a
few minor issues with link rendering and redirect generation which would
point to local crate docs even if the docs for that crate hadn't been
generated.

Also a bug with methods implemented on traits which caused wrong paths and
so dead links in the search results has been fixed.
2016-07-12 12:58:06 +01:00
Oliver Middleton
ebfdd110c3 rustdoc: Fix a couple of issues with src links to external crates
- src links/redirects to extern fn from another crate had an extra '/'.
- src links to `pub use` of a crate module had an extra '/'.
- src links to renamed reexports from another crate used the new name
  for the link but should use the original name.
2016-06-20 22:22:17 +01:00
Niko Matsakis
8b1941a783 s/aux/auxiliary, because windows
For legacy reasons (presumably), Windows does not permit files name aux.
2016-05-06 16:24:48 -04:00