Change:
Kind of related to and the  attribute. The behaviour would be the same as the latter but wouldn't require any source code changes. My use-case here is to generate docs on the CI and reduce the size (400MB just for docs for each version is a bit much), but if people want to generate docs locally they should still be able to get the source code pages if they want. suggested to create an issue for this.
To reduce the global documentation size, I suggested in to group items that don't have impls by kinds. Would require an RFC though. In any case, I think it's a good idea to add an option to have this done in the command line.

Discussion:
pub(crate) call_locations: AllCallLocations, /// If `true`, Context::init will not emit shared files. pub(crate) no_emit_shared: bool, <ins> /// If `true`, HTML source code pages won't be generated. pub(crate) html_no_source: bool, </ins> } #[derive(Copy, Clone, Debug, PartialEq, Eq)]

let generate_link_to_definition = matches.opt_present("generate-link-to-definition"); let extern_html_root_takes_precedence = matches.opt_present("extern-html-root-takes-precedence"); <ins> let html_no_source = matches.opt_present("html-no-source"); </ins> if generate_link_to_definition && (show_coverage || output_format != OutputFormat::Html) { diag.struct_err(

generate_link_to_definition, call_locations, no_emit_shared: false, <ins> html_no_source, </ins> }; Ok((options, render_options)) }

generate_link_to_definition, call_locations, no_emit_shared, <ins> html_no_source, </ins> .. } = options;

scrape_examples_extension: !call_locations.is_empty(), }; let mut issue_tracker_base_url = None; <del> let mut include_sources = true; </del> <ins> let mut include_sources = !html_no_source; </ins> // Crawl the crate attributes looking for attributes which control how we're // going to emit HTML

"[rust]", ) }), <ins> unstable("html-no-source", |o| { o.optflag("", "html-no-source", "Disable HTML source code pages generation") }), </ins> ] }

removed, see issue #44136 <https://github.com/rust-lang/rust/issues/44136> for more information <ins> --html-no-source Disable HTML source code pages generation </ins> @path               Read newline separated options from `path`

<ins> // compile-flags: -Zunstable-options --html-no-source // This test ensures that the `--html-no-source` flag disables // the creation of the `src` folder. #![feature(staged_api)] #![stable(feature = "bar", since = "1.0")] #![crate_name = "foo"] // Ensures that there is no items in the corresponding "src" folder. // @files 'src/foo' '[]' // @has foo/fn.foo.html // @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · ' // @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub fn foo() {} // @has foo/struct.Bar.html // @has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · ' // @!has - '//div[@class="main-heading"]/*[@class="out-of-band"]' '1.0 · source · ' #[stable(feature = "bar", since = "1.0")] pub struct Bar; impl Bar { // @has - '//*[@id="method.bar"]/*[@class="since rightside"]' '2.0' // @!has - '//*[@id="method.bar"]/*[@class="rightside"]' '2.0 ·' #[stable(feature = "foobar", since = "2.0")] pub fn bar() {} } </ins>