Commit graph

768 commits

Author SHA1 Message Date
Jake Degen
b805f2c4dc Added tooltip for should_panic code examples.
Previously, compile_fail and ignore code examples displayed a tooltip
indicating this in the documentation. This tooltip has now also been
added to should_panic examples.
2020-06-18 11:12:36 -04:00
bors
ce6d3a73b5 Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakis
Clean up type alias impl trait implementation

- Removes special case for top-level impl trait
- Removes associated opaque types
- Forbid lifetime elision in let position impl trait. This is consistent with the behavior for inferred types.
- Handle lifetimes in type alias impl trait more uniformly with other parameters

cc #69323
cc #63063
Closes #57188
Closes #62988
Closes #69136
Closes #73061
2020-06-15 04:10:24 +00:00
Dylan DPC
c06799e4c4
Rollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay
Migrate to numeric associated consts

The deprecation PR is #72885

cc #68490
cc rust-lang/rfcs#2700
2020-06-12 12:28:23 +02:00
Matthew Jasper
09546692ff Add more tests for type alias impl Trait 2020-06-11 16:24:01 +01:00
Manish Goregaokar
34c6b38e68 Add tests for macro@ and derive@ 2020-06-10 09:11:17 -07:00
Manish Goregaokar
27dcb4aab5 Avoid collisions between traits and their derive macros 2020-06-10 01:04:38 -07:00
Lzu Tao
fff822fead Migrate to numeric associated consts 2020-06-10 01:35:47 +00:00
Manish Goregaokar
e003c3ea05 Add test for proc macro resolution in intra doc links 2020-06-09 16:35:59 -07:00
Tymoteusz Jankowski
fc0675bf75
Allow using Self:: in doc 2020-05-22 13:57:05 +02:00
Tymoteusz Jankowski
fc4c9a6c7f
Make intra-link resolve links for both trait and impl items 2020-05-19 14:32:17 +02:00
Tymoteusz Jankowski
617c7cd9fa Make intra links work inside trait impl block 2020-05-13 20:24:14 +02:00
Dylan DPC
5fe77e5997
Rollup merge of #71928 - mibac138:strikethrough, r=GuillaumeGomez
Add strikethrough support to rustdoc

Implements uncontroversial part of #71183.
r? @GuillaumeGomez
2020-05-12 11:41:10 +02:00
mibac138
bbda107436 Add test for strikethrough in rustdoc 2020-05-08 18:14:57 +02:00
Guillaume Gomez
9d8310856b Add test for deprecated emoji 2020-05-08 15:27:08 +02:00
Dylan DPC
d33180e1d7
Rollup merge of #71918 - GuillaumeGomez:rename-methods-section, r=Dylan-DPC
Rename methods section

Fixes https://github.com/rust-lang/rust/issues/70475.

It renames the section [methods](https://doc.rust-lang.org/nightly/std/string/struct.String.html#methods) into "Implementations". However, I didn't not update the title in the sidebar considering that it only lists methods under (even though I updated the link of the "methods" to make it point to the "implementations" section.

r? @kinnison

cc @rust-lang/rustdoc
2020-05-06 22:36:51 +02:00
Guillaume Gomez
4ade6eb2a2 Add test for new implementations section title 2020-05-05 22:56:23 +02:00
Guillaume Gomez
cf184823d1 Update tests 2020-05-05 22:56:23 +02:00
Mark Rousskov
a1f81ff0ad rustdoc supports const re-exports 2020-04-29 11:52:02 -04:00
Linus Färnstrand
9af047ff74 Fix show-const-contents rustdoc test 2020-04-20 23:38:07 +02: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
Niko Matsakis
fda3378e3f introduce negative_impls feature gate and document
They used to be covered by `optin_builtin_traits` but negative impls
are now applicable to all traits, not just auto traits.

This also adds docs in the unstable book for the current state of auto traits.
2020-03-26 06:52:55 -04:00
Mazdak Farrokhzad
e37e81cad5
Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, r=ehuss,aleksator,ollie27
Stabilize --crate-version option in rustdoc

I don't see any reason to not stabilize it anymore, so let's go!

cc @kinnison @ehuss

r? @ollie27
2020-03-23 19:04:45 +01:00
Guillaume Gomez
9a017da459 Update rustdoc test and remove TODO comment 2020-03-17 20:58:31 +01:00
varkor
621c42c163 Render full attributes in rustdoc 2020-03-15 15:11:29 +00:00
bors
1581278534 Auto merge of #66364 - Centril:cleanup-macro-def, r=petrochenkov,eddyb
Cleanup `rmeta::MacroDef`

Avoid using rountrip parsing in the encoder and in `fn load_macro_untracked`.

The main reason I was interested in this was to remove `rustc_parse` as a dependency of `rustc_metadata` but it seems like this had other benefits as well.

Fixes #49511.

r? @eddyb
cc @matthewjasper @estebank @petrochenkov
2020-03-10 17:12:48 +00:00
Mazdak Farrokhzad
192d134e80 pacify rustdoc by using better url 2020-03-10 07:26:27 +01:00
Mazdak Farrokhzad
61150353bf
Rollup merge of #69514 - GuillaumeGomez:remove-spotlight, r=kinnison
Remove spotlight

I had a few comments saying that this feature was at best misunderstood or not even used so I decided to organize a poll about on [twitter](https://twitter.com/imperioworld_/status/1232769353503956994). After 87 votes, the result is very clear: it's not useful. Considering the amount of code we have just to run it, I think it's definitely worth it to remove it.

r? @kinnison

cc @ollie27
2020-03-10 06:47:47 +01:00
Dylan DPC
22a03913f4
Rollup merge of #69598 - ollie27:rustdoc_crate-version_escape, r=GuillaumeGomez
rustdoc: HTML escape crate version

As `--crate-version` accepts arbitrary strings they need to be escaped.

r? @GuillaumeGomez
2020-03-01 17:23:34 +01:00
Oliver Middleton
3c97f8ad12 rustdoc: HTML escape crate version
As `--crate-version` accepts arbitrary strings they need to be escaped.
2020-03-01 00:15:44 +00:00
Vadim Petrochenkov
6054a30370 Make it build again 2020-02-29 20:47:10 +03:00
Guillaume Gomez
1244ced958 Remove "important traits" feature 2020-02-27 14:51:22 +01:00
Guillaume Gomez
c57de34e8f Stabilize --crate-version option in rustdoc 2020-02-26 22:08:59 +01:00
Aaron Hill
51a16e574a
Record proc macro harness order for use during metadata deserialization
Fixes #68690

When we generate the proc macro harness, we now explicitly recorder the
order in which we generate entries. We then use this ordering data to
deserialize the correct proc-macro-data from the crate metadata.
2020-02-15 15:48:36 -05:00
bors
c4071d0919 Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, r=LukasKalbertodt
Move numeric consts to associated consts step1

A subset of #67913. Implements the first step of RFC https://github.com/rust-lang/rfcs/pull/2700

This PR adds the new constants as unstable constants and defines the old ones in terms of the new ones. Then fix a tiny bit of code that started having naming collisions because of the new assoc consts.

Removed a test that did not seem relevant any longer. Since doing just `u8::MIN` should now indeed be valid.
2020-01-30 08:55:07 +00: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
Linus Färnstrand
9fcbaa4158 Fix broken show-const-contents test 2020-01-23 20:55:06 +01:00
bors
d1e594f402 Auto merge of #68192 - GuillaumeGomez:remove-inlined-types, r=kinnison
Remove usage of global variable "inlined_types"

r? @pietroalbini
2020-01-22 18:04:56 +00:00
Guillaume Gomez
871e82b7d0 Add aliases attribute check 2020-01-20 20:42:52 +01:00
Oliver Middleton
3e0bfe1238 rustdoc: Correct order of async and unsafe in async unsafe fns 2020-01-20 18:14:51 +00:00
Dylan DPC
0dc2557c12
Rollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, r=GuillaumeGomez
rustdoc: Catch fatal errors when syntax highlighting

For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.

Fixes #56885

r? @GuillaumeGomez
2020-01-20 11:14:42 +05:30
Mazdak Farrokhzad
36e58ea6bf
Rollup merge of #68224 - GuillaumeGomez:prevent-urls-in-headings, r=ollie27
Prevent urls in headings

Fixes #68215.

cc @pietroalbini @ollie27

r? @kinnison
2020-01-18 19:36:03 +01:00
Tyler Mandry
bafe089d1f
Rollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli-obk
Fix deref impl typedef

Fixes #35295.

r? @kinnison
2020-01-17 17:28:12 -08:00
Oliver Middleton
79061d0e02 rustdoc: Catch fatal errors when syntax highlighting
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-17 23:44:44 +00:00
Guillaume Gomez
298e8ad5dc Extend url in heading test a bit 2020-01-17 19:49:03 +01:00
Dylan DPC
6e797ff8d9
Rollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, r=GuillaumeGomez
rustdoc: HTML escape codeblocks which fail syntax highlighting

r? @GuillaumeGomez
2020-01-16 20:53:30 +05:30
Guillaume Gomez
5022dd3b85 Extend url in titles test 2020-01-16 14:26:43 +01:00
Oliver Middleton
baf2921ebc rustdoc: HTML escape codeblocks which fail syntax highlighting 2020-01-15 22:42:04 +00:00
Guillaume Gomez
8a9b951f57 Fix rendering on sidebar and update tests 2020-01-15 21:34:15 +01:00
Guillaume Gomez
fd4a88f309 Add test for typedef deref 2020-01-15 13:43:09 +01:00
Guillaume Gomez
1bf9f69579 Prevent urls in headings 2020-01-14 19:21:10 +01:00