From 1cfbadb0298f8acf2162b97177f54c654ac6b945 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Fri, 7 Dec 2018 11:48:06 +0100 Subject: [PATCH 1/3] Fix doc_markdown off by one issue --- clippy_lints/src/doc.rs | 2 +- tests/ui/doc.rs | 4 ++++ tests/ui/doc.stderr | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index a3278159ef57..d6c96fa62a90 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -238,7 +238,7 @@ fn check_doc<'a, Events: Iterator)>>( } fn check_text(cx: &EarlyContext<'_>, valid_idents: &[String], text: &str, span: Span) { - for word in text.split_whitespace() { + for word in text.split(|c: char| c.is_whitespace() || c == '\'') { // Trim punctuation as in `some comment (see foo::bar).` // ^^ // Or even as in `_foo bar_` which is emphasized. diff --git a/tests/ui/doc.rs b/tests/ui/doc.rs index 8935e3f01d5f..c09cacd6be01 100644 --- a/tests/ui/doc.rs +++ b/tests/ui/doc.rs @@ -177,3 +177,7 @@ fn issue_1832() {} /// Ok: CamelCase (It should not be surrounded by backticks) fn issue_2395() {} + +/// An iterator over mycrate::Collection's values. +/// It should not lint a `'static` lifetime in ticks. +fn issue_2210() {} diff --git a/tests/ui/doc.stderr b/tests/ui/doc.stderr index 85c0fd898c7d..26ac81035582 100644 --- a/tests/ui/doc.stderr +++ b/tests/ui/doc.stderr @@ -180,5 +180,11 @@ error: you should put bare URLs between `<`/`>` or make a proper Markdown link 175 | /// Not ok: http://www.unicode.org/reports/tr9/#Reordering_Resolved_Levels | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 30 previous errors +error: you should put `mycrate::Collection` between ticks in the documentation + --> $DIR/doc.rs:181:22 + | +181 | /// An iterator over mycrate::Collection's values. + | ^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 31 previous errors From 5527edd9569ffcf49236ea031626e39cbb75c52c Mon Sep 17 00:00:00 2001 From: flip1995 Date: Wed, 12 Dec 2018 15:37:31 +0100 Subject: [PATCH 2/3] Fix rvm/gpg bug in travis osx build --- .travis.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5014a66a79c3..eb66112213b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,15 +18,6 @@ env: global: - RUST_BACKTRACE=1 -before_install: - - | - # work-around for issue https://github.com/travis-ci/travis-ci/issues/6307 - # might not be necessary in the future - if [ "$TRAVIS_OS_NAME" == "osx" ]; then - command curl -sSL https://rvm.io/mpapis.asc | gpg --import - - rvm get stable - fi - install: - | if [ -z ${INTEGRATION} ]; then From 016c996e1610eaed2f47fd9a9396498b8adce047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Wed, 12 Dec 2018 17:17:01 +0100 Subject: [PATCH 3/3] rustup https://github.com/rust-lang/rust/pull/56092 fix ui test cast_alignment failure by adding #![feature(rustc_private)] --- tests/ui/cast_alignment.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/cast_alignment.rs b/tests/ui/cast_alignment.rs index efc56ea2bbc1..77f50b3add29 100644 --- a/tests/ui/cast_alignment.rs +++ b/tests/ui/cast_alignment.rs @@ -9,8 +9,8 @@ //! Test casts for alignment issues -#![feature(libc)] +#![feature(rustc_private)] extern crate libc; #[warn(clippy::cast_ptr_alignment)]