Skip to content

Commit

Permalink
Remove unneeded rustdoc content and add copyright for the rest (rus…
Browse files Browse the repository at this point in the history
…t-lang#1038)

* Remove some assets

* Remove `rust-doc` files and submodules

* Remove static files and references to them

* Remove `highlight` tests and fixtures

* Remove templates and code that used them with warnings (now hidden)

* Add copyright modifications for TOML files

* Add copyright modifications to Rust files

* Remove asset formats not present anymore from exclude list

* Keep original scope for non-used attributes

* Remove html tests from `mod.rs`

* Fix format issues
  • Loading branch information
adpaco-aws authored and tedinski committed Apr 13, 2022
1 parent 783a848 commit 1d9485e
Show file tree
Hide file tree
Showing 220 changed files with 330 additions and 17,440 deletions.
12 changes: 0 additions & 12 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,9 @@
[submodule "src/doc/reference"]
path = tools/bookrunner/rust-doc/reference
url = https://github.com/rust-lang/reference.git
[submodule "src/doc/book"]
path = tools/bookrunner/rust-doc/book
url = https://github.com/rust-lang/book.git
[submodule "src/doc/rust-by-example"]
path = tools/bookrunner/rust-doc/rust-by-example
url = https://github.com/rust-lang/rust-by-example.git
[submodule "src/doc/rustc-dev-guide"]
path = tools/bookrunner/rust-doc/rustc-dev-guide
url = https://github.com/rust-lang/rustc-dev-guide.git
[submodule "src/doc/edition-guide"]
path = tools/bookrunner/rust-doc/edition-guide
url = https://github.com/rust-lang/edition-guide.git
[submodule "src/doc/embedded-book"]
path = tools/bookrunner/rust-doc/embedded-book
url = https://github.com/rust-embedded/book.git
[submodule "firecracker"]
path = firecracker
url = https://github.com/firecracker-microvm/firecracker.git
6 changes: 1 addition & 5 deletions scripts/ci/copyright-exclude
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,5 @@ gitmodules
LICENSE-APACHE
LICENSE-MIT
Cargo.lock
.svg
.png
.woff
scripts/ci/copyright-exclude
tools/bookrunner/librustdoc
tools/bookrunner/rust-doc
scripts/ci/copyright-exclude
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
# Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# See GitHub history for details.
[package]
name = "rustdoc"
version = "0.0.0"
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/auto_trait.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_hir::lang_items::LangItem;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/blanket_impl.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use crate::rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
use rustc_infer::infer::{InferOk, TyCtxtInferExt};
use rustc_infer::traits;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! The representation of a `#[doc(cfg(...))]` attribute.
// FIXME: Once the portability lint RFC is implemented (see tracking issue #41619),
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/cfg/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use super::*;

use rustc_ast::attr;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! Support for inlining external documentation into the current AST.
use std::iter::once;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! This module contains the "cleaned" pieces of the AST, and the functions
//! that clean them.
mod auto_trait;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/simplify.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! Simplification of where-clauses and parameter bounds into a prettier and
//! more canonical form.
//!
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use std::cell::RefCell;
use std::default::Default;
use std::hash::Hash;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/utils.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use crate::clean::auto_trait::AutoTraitFinder;
use crate::clean::blanket_impl::BlanketImplFinder;
use crate::clean::{
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/clean/utils/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use super::*;

#[test]
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/config.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use std::convert::TryFrom;
use std::fmt;
use std::path::PathBuf;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/core.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir::def::Res;
use rustc_hir::def_id::DefId;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/docfs.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! Rustdoc's FileSystem abstraction module.
//!
//! On Windows this indirects IO into threads to work around performance issues
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/doctest.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use rustc_ast as ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/doctest/tests.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use super::{make_test, GlobalTestOptions};
use rustc_span::edition::DEFAULT_EDITION;

Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use std::error;
use std::fmt::{self, Formatter};
use std::path::{Path, PathBuf};
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/externalfiles.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use serde::Serialize;

#[derive(Clone, Debug, Serialize)]
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/fold.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use crate::clean::*;

crate fn strip_item(mut item: Item) -> Item {
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/formats/cache.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use std::mem;

use rustc_data_structures::fx::{FxHashMap, FxHashSet};
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/formats/item_type.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! Item types.
use std::fmt;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/formats/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
crate mod cache;
crate mod item_type;
crate mod renderer;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/formats/renderer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
use rustc_middle::ty::TyCtxt;

use crate::clean;
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/html/escape.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! HTML escaping.
//!
//! This module contains one unit struct, which can be used to HTML-escape a
Expand Down
4 changes: 4 additions & 0 deletions tools/bookrunner/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! HTML formatting module
//!
//! This module contains a large number of `fmt::Display` implementations for
Expand Down
7 changes: 4 additions & 3 deletions tools/bookrunner/librustdoc/html/highlight.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Modifications Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// See GitHub history for details.
//! Basic syntax highlighting functionality.
//!
//! This module uses librustc_ast's lexer to provide token-based highlighting for
Expand Down Expand Up @@ -754,6 +758,3 @@ fn string<T: Display>(
}
write!(out, "<span class=\"{}\">{}</span>", klass.as_html(), text_s);
}

#[cfg(test)]
mod tests;

This file was deleted.

This file was deleted.

This file was deleted.

37 changes: 0 additions & 37 deletions tools/bookrunner/librustdoc/html/highlight/fixtures/sample.html

This file was deleted.

26 changes: 0 additions & 26 deletions tools/bookrunner/librustdoc/html/highlight/fixtures/sample.rs

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions tools/bookrunner/librustdoc/html/highlight/fixtures/union.rs

This file was deleted.

Loading

0 comments on commit 1d9485e

Please sign in to comment.