diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-09-29 17:16:06 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-10-09 16:47:14 +0200 |
| commit | 2def81a5f1d48625f74ed401329fd9af4e8668f2 (patch) | |
| tree | efd62f16b2f864626eb368ab7acd3b4f3454c85a /src | |
| parent | d6385631f4d8d911039287bc4ca5ff2f1f2f0cec (diff) | |
| download | rust-2def81a5f1d48625f74ed401329fd9af4e8668f2.tar.gz rust-2def81a5f1d48625f74ed401329fd9af4e8668f2.zip | |
Store nightly build instead of checking env var every time
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/lint/builtin.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/core.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/passes/collect_intra_doc_links.rs | 6 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs index 66cb6f2b52a..202a4284f4c 100644 --- a/src/librustc/lint/builtin.rs +++ b/src/librustc/lint/builtin.rs @@ -313,7 +313,7 @@ declare_lint! { } declare_lint! { - pub MISSING_DOC_ITEM_CODE_EXAMPLE, + pub MISSING_DOC_CODE_EXAMPLES, Allow, "warn about missing code example in an item's documentation" } diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index fdd6929d98a..76ca4083270 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -348,7 +348,7 @@ pub fn run_core(search_paths: SearchPaths, let intra_link_resolution_failure_name = lint::builtin::INTRA_DOC_LINK_RESOLUTION_FAILURE.name; let warnings_lint_name = lint::builtin::WARNINGS.name; let missing_docs = rustc_lint::builtin::MISSING_DOCS.name; - let missing_doc_example = rustc_lint::builtin::MISSING_DOC_ITEM_CODE_EXAMPLE.name; + let missing_doc_example = rustc_lint::builtin::MISSING_DOC_CODE_EXAMPLES.name; // In addition to those specific lints, we also need to whitelist those given through // command line, otherwise they'll get ignored and we don't want that. diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index f9730035715..a780322e85e 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -57,6 +57,7 @@ enum PathKind { struct LinkCollector<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx> { cx: &'a DocContext<'a, 'tcx, 'rcx, 'cstore>, mod_ids: Vec<NodeId>, + is_nightly_build: bool, } impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> { @@ -64,6 +65,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> LinkCollector<'a, 'tcx, 'rcx, 'cstore> { LinkCollector { cx, mod_ids: Vec::new(), + is_nightly_build: UnstableFeatures::from_environment().is_nightly_build(), } } @@ -240,7 +242,7 @@ fn look_for_tests<'a, 'tcx: 'a, 'rcx: 'a, 'cstore: 'rcx>( if find_testable_code(&dox, &mut tests, ErrorCodes::No).is_ok() { if tests.found_tests == 0 { let mut diag = cx.tcx.struct_span_lint_node( - lint::builtin::MISSING_DOC_ITEM_CODE_EXAMPLE, + lint::builtin::MISSING_DOC_CODE_EXAMPLES, NodeId::new(0), span_of_attrs(&item.attrs), "Missing code example in this documentation"); @@ -313,7 +315,7 @@ impl<'a, 'tcx, 'rcx, 'cstore> DocFolder for LinkCollector<'a, 'tcx, 'rcx, 'cstor look_for_tests(&cx, &dox, &item); - if !UnstableFeatures::from_environment().is_nightly_build() { + if !self.is_nightly_build { return None; } |
