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

Add page to list all crate's items #49504

Merged
merged 3 commits into from
Apr 10, 2018
Merged

Conversation

GuillaumeGomez
Copy link
Member

@TimNN
Copy link
Contributor

TimNN commented Mar 30, 2018

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:48] configure: rust.quiet-tests     := True
---
[00:04:26] tidy error: /checkout/src/librustdoc/html/render.rs:1463: line longer than 100 chars
[00:04:28] some tidy checks failed
[00:04:28]
[00:04:28]
[00:04:28] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:28] expected success, got: exit code: 1
[00:04:28]
[00:04:28]
[00:04:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:28] Build completed unsuccessfully in 0:01:52
[00:04:28] make: *** [tidy] Error 1
[00:04:28] Makefile:79: recipe for target 'tidy' failed

If this was not helpful or you have suggestes for improvements, please ping or otherwise contact @TimNN.

@TimNN
Copy link
Contributor

TimNN commented Mar 30, 2018

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:00:47] configure: rust.quiet-tests     := True
---
[00:38:45] .........................................................................i..........................
[00:38:51] ................i...................................................................................
---
[00:39:26] ............................................................................................i.......
[00:39:33] ................................................................i...................................
---
[00:40:25] ..............................................i.....................................................
---
[00:44:04] .............................i......................................................................
[00:44:18] ..............................................................i.....................................
[00:44:33] ...............................................i....................................................
[00:44:52] ....................................................................................................
[00:45:13] ....................................................................................................
[00:45:33] ....................................................................................................
[00:45:57] .i................................................................................................i.
[00:46:26] ......................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:46:32] ..............
[00:47:01] ....................................................................................................
[00:47:35] ...............................................................ii...................................
[00:48:22] ..........................i....................................................i.ii.................
[00:49:00] .......................................................................................iiiiiii......
---
[00:50:54] ....................................i...............................................................
[00:51:02] ....................................................................................................
[00:51:09] ..................i............................................................ii.iii...............
[00:51:16] ....................................................................................................
[00:51:24] ........i..............................i............................................................
[00:51:31] ....................................................................................................
[00:51:38] .....................i..............................................................................
[00:51:46] ....................................................................................................
[00:51:55] ....................................................................................................
[00:52:05] ....................................................................................................
[00:52:16] ....................................................................................................
[00:52:28] ....................................................................................................
[00:52:36] ..............i.....................................................................................
[00:52:46] .................i..ii..............................................................................
[00:52:55] ....................................................................................................
[00:53:05] ....................................................................................................
[00:53:15] ....................................................................................i...............
[00:53:25] ..............................i.....................................................................
---
[00:54:01] ...........................i........................................................................
[00:54:03] ....................................................................i...............................
[00:54:04] ................i.......................................................
---
[00:54:18] ...........i........................
---
[00:54:48] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:54:51] i.......i......................i......
---
[00:55:27] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:55:29] ....ii...
---
[01:03:42] ...i................................................................................................
---
[01:05:29] ......................................i.............................................................
[01:05:48] ....................................................................................................
[01:06:07] .............................................i......................................................
---
[01:07:35] ........................................................ii..........................................
---
[01:08:39] .............................................................i......................................
---
[01:13:28] ii..................................................................................................
[01:13:47] ....................................................................................................
[01:14:03] ...................iii......i......i...i......i.....................................................
[01:14:13] ....................................................................................................
[01:14:28] ........................................iiii........ii..............................................
[01:14:39] ....................................................................................................
[01:14:57] .................................................................................i..................
[01:15:21] ....................................................................................................
[01:15:32] ...........................................................................................iiii.....
---
[01:21:36] std_unicode/all.html:12: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/normalize.css
[01:21:36] std_unicode/all.html:13: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/rustdoc.css
[01:21:36] std_unicode/all.html:16: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/dark.css
[01:21:36] std_unicode/all.html:17: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/light.css
[01:21:36] std_unicode/all.html:36: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/std_unicode/index.html
[01:21:36] std/all.html:12: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/normalize.css
[01:21:36] std/all.html:13: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/rustdoc.css
[01:21:36] std/all.html:16: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/dark.css
[01:21:36] std/all.html:17: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/light.css
[01:21:36] std/all.html:36: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/std/index.html
[01:21:36] std/all.html:60: absolute path - /primitive.array.html
[01:21:36] std/all.html:60: absolute path - /primitive.bool.html
[01:21:36] std/all.html:60: absolute path - /primitive.char.html
[01:21:36] std/all.html:60: absolute path - /primitive.f32.html
[01:21:36] std/all.html:60: absolute path - /primitive.f64.html
[01:21:36] std/all.html:60: absolute path - /primitive.fn.html
[01:21:36] std/all.html:60: absolute path - /primitive.i128.html
[01:21:36] std/all.html:60: absolute path - /primitive.i16.html
[01:21:36] std/all.html:60: absolute path - /primitive.i32.html
[01:21:36] std/all.html:60: absolute path - /primitive.i64.html
[01:21:36] std/all.html:60: absolute path - /primitive.i8.html
[01:21:36] std/all.html:60: absolute path - /primitive.isize.html
[01:21:36] std/all.html:60: absolute path - /primitive.never.html
[01:21:36] std/all.html:60: absolute path - /primitive.pointer.html
[01:21:36] std/all.html:60: absolute path - /primitive.reference.html
[01:21:36] std/all.html:60: absolute path - /primitive.slice.html
[01:21:36] std/all.html:60: absolute path - /primitive.str.html
[01:21:36] std/all.html:60: absolute path - /primitive.tuple.html
[01:21:36] std/all.html:60: absolute path - /primitive.u128.html
[01:21:36] std/all.html:60: absolute path - /primitive.u16.html
[01:21:36] std/all.html:60: absolute path - /primitive.u32.html
[01:21:36] std/all.html:60: absolute path - /primitive.u64.html
[01:21:36] std/all.html:60: absolute path - /primitive.u8.html
[01:21:36] std/all.html:60: absolute path - /primitive.unit.html
[01:21:36] std/all.html:60: absolute path - /primitive.usize.html
[01:21:36] std/all.html:60: absolute path - /macro.assert.html
[01:21:36] std/all.html:60: absolute path - /macro.assert_eq.html
[01:21:36] std/all.html:60: absolute path - /macro.assert_ne.html
[01:21:36] std/all.html:60: absolute path - /macro.cfg.html
[01:21:36] std/all.html:60: absolute path - /macro.column.html
[01:21:36] std/all.html:60: absolute path - /macro.compile_error.html
[01:21:36] std/all.html:60: absolute path - /macro.concat.html
[01:21:36] std/all.html:60: absolute path - /macro.concat_idents.html
[01:21:36] std/all.html:60: absolute path - /macro.debug_assert.html
[01:21:36] std/all.html:60: absolute path - /macro.debug_assert_eq.html
[01:21:36] std/all.html:60: absolute path - /macro.debug_assert_ne.html
[01:21:36] std/all.html:60: absolute path - /macro.env.html
[01:21:36] std/all.html:60: absolute path - /macro.eprint.html
[01:21:36] std/all.html:60: absolute path - /macro.eprintln.html
[01:21:36] std/all.html:60: absolute path - /macro.file.html
[01:21:36] std/all.html:60: absolute path - /macro.format.html
[01:21:36] std/all.html:60: absolute path - /macro.format_args.html
[01:21:36] std/all.html:60: absolute path - /macro.include.html
[01:21:36] std/all.html:60: absolute path - /macro.include_bytes.html
[01:21:36] std/all.html:60: absolute path - /macro.include_str.html
[01:21:36] std/all.html:60: absolute path - /macro.is_aarch64_feature_detected.html
[01:21:36] std/all.html:60: absolute path - /macro.is_arm_feature_detected.html
[01:21:36] std/all.html:60: absolute path - /macro.is_powerpc64_feature_detected.html
[01:21:36] std/all.html:60: absolute path - /macro.is_x86_feature_detected.html
[01:21:36] std/all.html:60: absolute path - /macro.line.html
[01:21:36] std/all.html:60: absolute path - /macro.module_path.html
[01:21:36] std/all.html:60: absolute path - /macro.option_env.html
[01:21:36] std/all.html:60: absolute path - /macro.panic.html
[01:21:36] std/all.html:60: absolute path - /macro.print.html
[01:21:36] std/all.html:60: absolute path - /macro.println.html
[01:21:36] std/all.html:60: absolute path - /macro.select.html
[01:21:36] std/all.html:60: absolute path - /macro.stringify.html
[01:21:36] std/all.html:60: absolute path - /macro.thread_local.html
[01:21:36] std/all.html:60: absolute path - /macro.try.html
[01:21:36] std/all.html:60: absolute path - /macro.unimplemented.html
[01:21:36] std/all.html:60: absolute path - /macro.unreachable.html
[01:21:36] std/all.html:60: absolute path - /macro.vec.html
[01:21:36] std/all.html:60: absolute path - /macro.write.html
[01:21:36] std/all.html:60: absolute path - /macro.writeln.html
[01:21:45] proc_macro/all.html:12: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc/normalize.css
[01:21:45] proc_macro/all.html:13: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc/rustdoc.css
[01:21:45] proc_macro/all.html:16: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc/dark.css
[01:21:45] proc_macro/all.html:17: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc/light.css
[01:21:45] proc_macro/all.html:36: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc/proc_macro/index.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.Diagnostic.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.LexError.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.LineColumn.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.Literal.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.SourceFile.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.Span.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.Term.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.TokenStream.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.TokenTree.html
[01:21:45] proc_macro/all.html:60: absolute path - /struct.TokenTreeIter.html
[01:21:45] proc_macro/all.html:60: absolute path - /enum.Delimiter.html
[01:21:45] proc_macro/all.html:60: absolute path - /enum.Level.html
[01:21:45] proc_macro/all.html:60: absolute path - /enum.Spacing.html
[01:21:45] proc_macro/all.html:60: absolute path - /enum.TokenNode.html
[01:21:45] proc_macro/all.html:60: absolute path - /macro.quote.html
[01:21:45] proc_macro/all.html:60: absolute path - /fn.quote_span.html
[01:21:45] core/all.html:12: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/normalize.css
[01:21:45] core/all.html:13: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/rustdoc.css
[01:21:45] core/all.html:16: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/dark.css
[01:21:45] core/all.html:17: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/light.css
[01:21:45] core/all.html:36: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/core/index.html
[01:21:45] core/all.html:60: absolute path - /macro.assert.html
[01:21:45] core/all.html:60: absolute path - /macro.assert_eq.html
[01:21:45] core/all.html:60: absolute path - /macro.assert_ne.html
[01:21:45] core/all.html:60: absolute path - /macro.cfg.html
[01:21:45] core/all.html:60: absolute path - /macro.column.html
[01:21:45] core/all.html:60: absolute path - /macro.compile_error.html
[01:21:45] core/all.html:60: absolute path - /macro.concat.html
[01:21:45] core/all.html:60: absolute path - /macro.concat_idents.html
[01:21:45] core/all.html:60: absolute path - /macro.debug_assert.html
[01:21:45] core/all.html:60: absolute path - /macro.debug_assert_eq.html
[01:21:45] core/all.html:60: absolute path - /macro.debug_assert_ne.html
[01:21:45] core/all.html:60: absolute path - /macro.env.html
[01:21:45] core/all.html:60: absolute path - /macro.file.html
[01:21:45] core/all.html:60: absolute path - /macro.format_args.html
[01:21:45] core/all.html:60: absolute path - /macro.include.html
[01:21:45] core/all.html:60: absolute path - /macro.include_bytes.html
[01:21:45] core/all.html:60: absolute path - /macro.include_str.html
[01:21:45] core/all.html:60: absolute path - /macro.line.html
[01:21:45] core/all.html:60: absolute path - /macro.module_path.html
[01:21:45] core/all.html:60: absolute path - /macro.option_env.html
[01:21:45] core/all.html:60: absolute path - /macro.panic.html
[01:21:45] core/all.html:60: absolute path - /macro.stringify.html
[01:21:45] core/all.html:60: absolute path - /macro.try.html
[01:21:45] core/all.html:60: absolute path - /macro.unimplemented.html
[01:21:45] core/all.html:60: absolute path - /macro.unreachable.html
[01:21:45] core/all.html:60: absolute path - /macro.write.html
[01:21:45] core/all.html:60: absolute path - /macro.writeln.html
[01:21:50] alloc/all.html:12: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/normalize.css
[01:21:50] alloc/all.html:13: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/rustdoc.css
[01:21:50] alloc/all.html:16: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/dark.css
[01:21:50] alloc/all.html:17: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/light.css
[01:21:50] alloc/all.html:36: absolute path - /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/doc/alloc/index.html
[01:21:50] alloc/all.html:60: absolute path - /macro.format.html
[01:21:50] alloc/all.html:60: absolute path - /macro.vec.html
[01:21:51] thread 'main' panicked at 'found some broken links', tools/linkchecker/main.rs:49:9
---
[01:21:51] make: *** [check] Error 1
[01:21:51] Makefile:58: recipe for target 'check' failed
---
$ cat obj/tmp/sccache.log
---
$ ls -lat $HOME/Library/Logs/DiagnosticReports/
ls: cannot access /home/travis/Library/Logs/DiagnosticReports/: No such file or directory
travis_time:end:0b19e136:start=1522417498497292164,finish=1522417498513025426,duration=15733262
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:13019c58
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true
find: `/home/travis/Library/Logs/DiagnosticReports': No such file or directory
travis_time:end:13019c58:start=1522417498523223826,finish=1522417498534542240,duration=11318414
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1ffec71f
$ dmesg | grep -i kill
[   10.924552] init: failsafe main process (1091) killed by TERM signal

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

@shepmaster shepmaster added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Mar 30, 2018
@ollie27
Copy link
Member

ollie27 commented Mar 30, 2018

cache().paths should contain the paths for every item documented in the current crate. Could that be used instead of AllTypes?

@GuillaumeGomez
Copy link
Member Author

AllTypes is just a wrapper which makes the output simpler. In addition, only visible items are put into it.

@TimNN
Copy link
Contributor

TimNN commented Mar 31, 2018

Your PR failed on Travis. Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
Resolving deltas: 100% (613377/613377), completed with 4857 local objects.
---
[00:00:50] configure: rust.quiet-tests     := True
---
[00:39:30] .........................................................................i..........................
[00:39:36] ................i...................................................................................
---
[00:40:12] ............................................................................................i.......
[00:40:19] ................................................................i...................................
---
[00:41:12] .............................................i......................................................
---
[00:44:57] .............................i......................................................................
[00:45:12] ..............................................................i.....................................
[00:45:27] ...............................................i....................................................
[00:45:47] ....................................................................................................
[00:46:08] ....................................................................................................
[00:46:28] ....................................................................................................
[00:46:51] .i................................................................................................i.
[00:47:20] ..........................................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:47:26] ..........
[00:47:54] ....................................................................................................
[00:48:28] ...............................................................ii...................................
[00:49:15] ..........................i....................................................i.ii.................
[00:49:54] .......................................................................................iiiiiii......
---
[00:51:50] ....................................i...............................................................
[00:51:57] ....................................................................................................
[00:52:05] ..................i............................................................ii.iii...............
[00:52:12] ....................................................................................................
[00:52:20] ........i..............................i............................................................
[00:52:28] ....................................................................................................
[00:52:34] .....................i..............................................................................
[00:52:42] ....................................................................................................
[00:52:52] ....................................................................................................
[00:53:03] ....................................................................................................
[00:53:14] ....................................................................................................
[00:53:26] ....................................................................................................
[00:53:34] ..............i.....................................................................................
[00:53:44] .................i..ii..............................................................................
[00:53:54] ....................................................................................................
[00:54:04] ....................................................................................................
[00:54:13] ....................................................................................i...............
[00:54:23] ..............................i.....................................................................
---
[00:55:00] ...........................i........................................................................
[00:55:01] ....................................................................i...............................
[00:55:03] ................i.......................................................
---
[00:55:17] ...........i........................
---
[00:55:48] i...i..ii....i.............ii........iii......i..i...i...ii..i..i..ii.....
---
[00:55:51] i.......i......................i......
---
[00:56:29] iiii.......i..i........i..i.i.............i..........iiii...........i...i..........ii.i.i.......ii..
[00:56:30] ....ii...
---
[01:04:49] ...i................................................................................................
---
[01:06:44] ......................................i.............................................................
[01:07:04] ....................................................................................................
[01:07:26] .............................................i......................................................
---
[01:09:01] ........................................................ii..........................................
---
[01:10:11] .............................................................i......................................
---
[01:15:01] ii..................................................................................................
[01:15:21] ....................................................................................................
[01:15:37] ...................iii......i......i...i......i.....................................................
[01:15:47] ....................................................................................................
[01:16:02] ........................................iiii........ii..............................................
[01:16:13] ....................................................................................................
[01:16:32] .................................................................................i..................
[01:16:56] ....................................................................................................
[01:17:07] ...........................................................................................iiii.....

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN.

Copy link
Member

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a src/test/rustdoc test to ensure that all.html gets links from a crate and any re-exported items as well.

Speaking of re-exports, what happens when an item is re-exported within the same crate, and both paths are public (think a prelude)? Do both paths appear in the listing? Reading over the source, it seems like if an item isn't inlined at its re-export path, it wouldn't generate a page, and thus wouldn't have a chance to insert itself into the AllTypes directory, but what about exports decorated with #[doc(inline)]? Should we care that both paths get links?

functions: HashSet<ItemEntry>,
typedefs: HashSet<ItemEntry>,
statics: HashSet<ItemEntry>,
constants: HashSet<ItemEntry>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for the future: these could all get replaced with FxHashSets later on, if this becomes a performance problem.

functions: HashSet::with_capacity(100),
typedefs: HashSet::with_capacity(100),
statics: HashSet::with_capacity(100),
constants: HashSet::with_capacity(100),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initializing everything here with 100 items (except the primitives, since there's not an unbounded number of those) seems like way overkill, but i don't know how the average crate measures up here. Is there a way to measure crates.io for this? >_>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just picked a random number. But at least with this, it's done.

"fn" => self.functions.insert(ItemEntry::new(new_url, name)),
"typedef" => self.typedefs.insert(ItemEntry::new(new_url, name)),
"static" => self.statics.insert(ItemEntry::new(new_url, name)),
"constant" => self.constants.insert(ItemEntry::new(new_url, name)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be worth turning into an enum?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so sure it'd be useful. It's the only place where it's used. Maybe if we extend it in the future it might be worth it but for now, I think the current solution seems the best one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at how this was populated, and it looks like this is sourced from html::item_type::ItemType anyway. It's not using all the variants of it, but it's at least better than matching on strings, IMO.

@@ -1414,16 +1544,52 @@ impl Context {
Some(i) => i,
None => return Ok(()),
};
let final_file = self.dst.join(&krate.name)
.join(&format!("all{}.html", self.shared.resource_suffix));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does all.html really need the resource suffix? It doesn't like something that would benefit from it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for docs.rs. I suppose they'll have use for it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onur Can you confirm whether this new page would require a resource suffix? It would be different per-crate, a new page linked from the crate-root sidebar.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GuillaumeGomez only common javascript and css files requires suffix, crate specific html files don't need one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll remove it then.

@@ -389,3 +389,8 @@ kbd {
background: #f0f0f0;
}
}

#all-types {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ID gets a background-color in the light theme; is it valid to leave it blank here? That seems like it will cause some problems at some point. >_>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't need to overload the rule at the opposite of light.css so I left it empty. But I can update it, as you wish.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wary of relying on the rules combining properly if we ever add more themes. I'd rather see each theme define its own color set, even if some colors are the same as some other themes.

@GuillaumeGomez
Copy link
Member Author

Added test.

@GuillaumeGomez
Copy link
Member Author

Updated.

</div>
<a id='all-types' href='all{}.html'><p>See all {}'s items</p></a>",
version,
cx.shared.resource_suffix,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't need the resource-suffix any more either.

"fn" => self.functions.insert(ItemEntry::new(new_url, name)),
"typedef" => self.typedefs.insert(ItemEntry::new(new_url, name)),
"static" => self.statics.insert(ItemEntry::new(new_url, name)),
"constant" => self.constants.insert(ItemEntry::new(new_url, name)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked at how this was populated, and it looks like this is sourced from html::item_type::ItemType anyway. It's not using all the variants of it, but it's at least better than matching on strings, IMO.

}

let mut w = BufWriter::new(File::create(&final_file)
.expect("failed to create all.html"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we usually use try_err! to wrap errors from file operations? This function even returns a Result already.

layout::render(&mut w, &self.shared.layout,
&page, &sidebar, &all,
self.shared.css_file_extension.is_some(),
&self.shared.themes).expect("layout rendering failed");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar try_err! comment here as well, this returns an io::Result that we can handle with that macro.

@GuillaumeGomez
Copy link
Member Author

Updated.

@QuietMisdreavus
Copy link
Member

@bors r+

Thanks so much! I'm really glad to see this happen.

@bors
Copy link
Contributor

bors commented Apr 9, 2018

📌 Commit 1292e51 has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2018
@bors
Copy link
Contributor

bors commented Apr 10, 2018

⌛ Testing commit 1292e51 with merge a1c21ed...

bors added a commit that referenced this pull request Apr 10, 2018
@bors
Copy link
Contributor

bors commented Apr 10, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing a1c21ed to master...

@bors bors merged commit 1292e51 into rust-lang:master Apr 10, 2018
@GuillaumeGomez GuillaumeGomez deleted the doc-all-types branch April 10, 2018 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants