Skip to content

Conversation

@zackmdavis
Copy link
Contributor

  • reword ... expression syntax error to not imply that you should use it in patterns either (rewrite ... to ..= as an idiom lint for Rust 2018 edition #51043) and make it a structured suggestion
  • shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note
  • structured suggestion for pattern-named-the-same-as-variant warning

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 24, 2018
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). 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.
 

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. (Feature Requests)

Copy link
Contributor

Choose a reason for hiding this comment

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

The only difference between the two branches is the lint ID and the word numeric, can you pull those out into variables and only make a single error emitting call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Now that `..=` inclusive ranges are stabilized, people probably shouldn't be using `...` even in patterns, even if it's still legal there (see rust-lang#51043). To avoid drawing attention to `...` being a real thing, let's reword this message to just say "unexpected token" rather "cannot be used in expressions".
The top level message shouldn't be too long; the replaced-by-coercion/temporary-variable advice can live in a note. Also, don't mention type ascription when it's not actually available as a real thing. (The current state of discussion on the type ascription tracking issue rust-lang#23416 makes one rather suspect it will never be a stable thing in its current form, but that's not for us to adjudicate in this commit.) While we're here, yank out the differentiating parts of the numeric/other conditional and only have one codepath emitting the diagnostic.
@rust-highfive
Copy link
Contributor

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). 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:04:21] Downloading itoa v0.4.1 [00:04:21] Downloading num-traits v0.2.2 [00:04:51] warning: spurious network error (2 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds) [00:04:52] Downloading dtoa v0.4.2 [00:05:05] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/dtoa/0.4.2/download`, got 500 [00:05:05] Downloading ordermap v0.3.5 [00:05:05] Downloading ordermap v0.3.5 [00:05:19] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/ordermap/0.3.5/download`, got 500 [00:06:04] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/cfg-if/0.1.2/download`, got 500 [00:06:04] Downloading serde_derive_internals v0.23.1 [00:06:04] Downloading quote v0.5.1 [00:06:29] Downloading proc-macro2 v0.3.6 --- [00:08:19] Downloading markup5ever v0.7.2 [00:08:19] Downloading log v0.3.9 [00:08:32] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/log/0.3.9/download`, got 500 [00:08:32] Downloading quote v0.3.15 [00:08:56] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/quote/0.3.15/download`, got 500 [00:09:22] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/syn/0.11.11/download`, got 500 [00:09:22] Downloading mac v0.1.1 [00:09:42] Downloading string_cache v0.7.1 [00:10:02] Downloading phf v0.7.21 --- [00:12:30] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/lazy_static/1.0.0/download`, got 500 [00:12:30] Downloading rls-analysis v0.13.0 [00:12:43] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/rls-analysis/0.13.0/download`, got 500 [00:12:43] Downloading racer v2.0.14 [00:12:57] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/racer/2.0.14/download`, got 500 [00:13:17] Downloading url v1.7.0 [00:13:17] Downloading walkdir v2.1.4 [00:13:19] Downloading rls-data v0.16.0 [00:13:19] Downloading rayon v1.0.1 --- [00:18:22] Downloading utf8-ranges v1.0.0 [00:18:22] Downloading thread_local v0.3.5 [00:18:22] Downloading memchr v2.0.1 [00:18:22] Downloading aho-corasick v0.6.4 [00:18:48] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/aho-corasick/0.6.4/download`, got 500 [00:19:01] warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/aho-corasick/0.6.4/download`, got 500 [00:19:02] Downloading commoncrypto v0.2.0 [00:19:15] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/commoncrypto/0.2.0/download`, got 500 [00:19:35] Downloading openssl v0.10.6 [00:19:53] Downloading hex v0.3.1 --- [00:23:31] Downloading futures v0.1.20 [00:23:31] Downloading termcolor v0.3.6 [00:23:31] Downloading unicode-width v0.1.4 [00:23:32] Downloading atty v0.2.8 [00:23:49] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/atty/0.2.8/download`, got 500 [00:24:03] warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/atty/0.2.8/download`, got 500 [00:24:25] Downloading same-file v1.0.2 [00:24:25] Downloading fs2 v0.4.3 [00:24:46] Downloading crossbeam v0.3.2 [00:25:00] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/crossbeam/0.3.2/download`, got 500 --- [00:25:57] Downloading serde_ignored v0.0.4 [00:25:57] Downloading shell-escape v0.1.4 [00:25:58] Downloading glob v0.2.11 [00:25:58] Downloading git2 v0.7.1 [00:26:12] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/git2/0.7.1/download`, got 500 [00:26:26] warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/git2/0.7.1/download`, got 500 [00:26:27] Downloading lazycell v0.6.0 [00:26:40] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/lazycell/0.6.0/download`, got 500 [00:26:40] Downloading core-foundation v0.6.0 [00:26:40] Downloading vcpkg v0.2.3 [00:26:40] Downloading vcpkg v0.2.3 [00:26:41] Downloading rustc-ap-arena v164.0.0 [00:27:00] Downloading rustc-ap-serialize v164.0.0 [00:27:13] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/rustc-ap-serialize/164.0.0/download`, got 500 [00:27:27] warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/rustc-ap-serialize/164.0.0/download`, got 500 [00:27:27] Downloading rustc-ap-rustc_data_structures v164.0.0 [00:27:51] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/rustc-ap-rustc_data_structures/164.0.0/download`, got 500 [00:28:10] warning: spurious network error (1 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/rustc-ap-rustc_data_structures/164.0.0/download`, got 500 [00:28:24] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: HttpNot200 { code: 500, url: "https://crates.io/api/v1/crates/rustc-ap-rustc_data_structures/164.0.0/download" } [00:28:24] unable to get packages from source', libcore/result.rs:945:5 [00:28:24] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:28:24] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:28:25] thread 'main' panicked at 'command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "metadata" "--format-version" "1" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" [00:28:25] expected success, got: exit code: 101', build_helper/lib.rs:122:9 [00:28:25] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:28:25] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build nonexistent/path/to/trigger/cargo/metadata [00:28:25] Build completed unsuccessfully in 0:27:36 [00:28:25] Makefile:81: recipe for target 'prepare' failed [00:28:25] make: *** [prepare] Error 1 [00:28:26] Finished dev [unoptimized] target(s) in 0.25s [00:28:26] Downloading rand v0.3.22 [00:28:27] Downloading phf_shared v0.7.21 [00:28:27] Downloading phf_shared v0.7.21 [00:28:40] warning: spurious network error (2 tries remaining): failed to get 200 response from `https://crates.io/api/v1/crates/phf_shared/0.7.21/download`, got 500 [00:28:58] Downloading winapi-build v0.1.1 [00:28:58] Downloading winapi v0.2.8 [00:28:59] Downloading unicode-xid v0.0.3 [00:29:18] Downloading syntex_pos v0.52.0 [00:29:18] Downloading syntex_pos v0.52.0 [00:29:18] Downloading term v0.4.6 [00:29:48] warning: spurious network error (2 tries remaining): [28] Timeout was reached (Operation too slow. Less than 10 bytes/sec transferred the last 30 seconds) [00:30:44] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:31:40] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t resolve host name", code: 6, extra: Some("Couldn\'t resolve host \'crates.io\'") } [00:31:40] unable to get packages from source', libcore/result.rs:945:5 [00:31:40] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:31:40] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:31:40] thread 'main' panicked at 'command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "metadata" "--format-version" "1" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" [00:31:40] expected success, got: exit code: 101', build_helper/lib.rs:122:9 [00:31:40] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:31:40] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build nonexistent/path/to/trigger/cargo/metadata [00:31:40] make: *** [prepare] Error 1 [00:31:40] make: *** [prepare] Error 1 [00:31:40] Makefile:81: recipe for target 'prepare' failed [00:31:42] Finished dev [unoptimized] target(s) in 0.25s [00:31:43] Downloading either v1.5.0 [00:32:39] warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:33:35] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:33:35] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:34:31] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t resolve host name", code: 6, extra: Some("Couldn\'t resolve host \'crates.io\'") } [00:34:31] unable to get packages from source', libcore/result.rs:945:5 [00:34:31] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:34:31] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:34:31] thread 'main' panicked at 'command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "metadata" "--format-version" "1" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" [00:34:31] expected success, got: exit code: 101', build_helper/lib.rs:122:9 [00:34:31] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:34:31] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build nonexistent/path/to/trigger/cargo/metadata [00:34:31] make: *** [prepare] Error 1 [00:34:31] make: *** [prepare] Error 1 [00:34:31] Makefile:81: recipe for target 'prepare' failed [00:34:34] Finished dev [unoptimized] target(s) in 0.26s [00:34:34] Downloading unreachable v0.1.1 [00:35:31] warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:36:27] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:36:27] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:37:23] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { description: "Couldn\'t resolve host name", code: 6, extra: Some("Couldn\'t resolve host \'crates.io\'") } [00:37:23] unable to get packages from source', libcore/result.rs:945:5 [00:37:23] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:37:23] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:37:23] thread 'main' panicked at 'command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "metadata" "--format-version" "1" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" [00:37:23] expected success, got: exit code: 101', build_helper/lib.rs:122:9 [00:37:23] note: Run with `RUST_BACKTRACE=1` for a backtrace. [00:37:23] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build nonexistent/path/to/trigger/cargo/metadata [00:37:23] Build completed unsuccessfully in 0:02:48 [00:37:23] Makefile:81: recipe for target 'prepare' failed [00:37:23] make: *** [prepare] Error 1 [00:37:27] Finished dev [unoptimized] target(s) in 0.28s [00:37:27] Downloading rustc-ap-serialize v149.0.0 [00:38:23] warning: spurious network error (2 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') [00:39:20] warning: spurious network error (1 tries remaining): [6] Couldn't resolve host name (Couldn't resolve host 'crates.io') 

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. (Feature Requests)

@zackmdavis
Copy link
Contributor Author

@bors roll to disbelieve

@zackmdavis zackmdavis closed this Jun 24, 2018
@zackmdavis zackmdavis reopened this Jun 24, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Jun 25, 2018

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 25, 2018

📌 Commit 0b39a82 has been approved by oli-obk

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 25, 2018
@bors
Copy link
Collaborator

bors commented Jun 25, 2018

⌛ Testing commit 0b39a82 with merge 8acec1f...

bors added a commit that referenced this pull request Jun 25, 2018
three diagnostics upgrades * reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion * shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note * structured suggestion for pattern-named-the-same-as-variant warning r? @oli-obk
@bors
Copy link
Collaborator

bors commented Jun 25, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing 8acec1f to master...

@bors bors merged commit 0b39a82 into rust-lang:master Jun 25, 2018
@zackmdavis zackmdavis deleted the superstructure branch June 25, 2018 16:02
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.

4 participants