Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify some unused lints code #54746

Merged
merged 1 commit into from
Oct 4, 2018
Merged

Conversation

llogiq
Copy link
Contributor

@llogiq llogiq commented Oct 2, 2018

Those are but small simplifications for readability.

@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 2, 2018
@@ -60,14 +60,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedResults {

let t = cx.tables.expr_ty(&expr);
let ty_warned = match t.sty {
ty::Tuple(ref tys) if tys.is_empty() => return,
ty::Tuple(ref tys) if tys.is_empty() |
Copy link
Contributor

Choose a reason for hiding this comment

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

Huh!? since when can we chain match arms with guards and some without?

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 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:16:24]    Compiling rustc_privacy v0.0.0 (/checkout/src/librustc_privacy)
[00:16:33]    Compiling rustc_codegen_utils v0.0.0 (/checkout/src/librustc_codegen_utils)
[00:16:34]    Compiling rustc_passes v0.0.0 (/checkout/src/librustc_passes)
[00:16:35]    Compiling rustc_lint v0.0.0 (/checkout/src/librustc_lint)
[00:16:35] error: expected one of `.`, `;`, `?`, or an operator, found `if`
[00:16:35]     |
[00:16:35] 347 |                 }
[00:16:35] 347 |                 }
[00:16:35]     |                  - expected one of `.`, `;`, `?`, or an operator here
[00:16:35] ...
[00:16:35] 352 |                 if e.span.ctxt().outer().expn_info()
[00:16:35]     |                 ^^ unexpected token
[00:16:36] error[E0277]: no implementation for `bool | rustc::ty::TyKind<'_>`
[00:16:36]   --> librustc_lint/unused.rs:63:50
[00:16:36]    |
[00:16:36]    |
[00:16:36] 63 |             ty::Tuple(ref tys) if tys.is_empty() |
[00:16:36]    |                                                  ^ no implementation for `bool | rustc::ty::TyKind<'_>`
[00:16:36]    |
[00:16:36]    = help: the trait `std::ops::BitOr<rustc::ty::TyKind<'_>>` is not implemented for `bool`
[00:16:37] error: aborting due to 2 previous errors
[00:16:37] 
[00:16:37] For more information about this error, try `rustc --explain E0277`.
[00:16:37] error: Could not compile `rustc_lint`.
[00:16:37] error: Could not compile `rustc_lint`.
[00:16:37] warning: build failed, waiting for other jobs to finish...
[00:16:46] error: build failed
[00:16:46] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:16:46] expected success, got: exit code: 101
[00:16:46] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1112:9
[00:16:46] travis_fold:end:stage0-rustc

[00:16:46] travis_time:end:stage0-rustc:start=1538478357805551875,finish=1538479049469217216,duration=691663665341


[00:16:46] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:16:46] Build completed unsuccessfully in 0:12:25
[00:16:46] make: *** [all] Error 1
[00:16:46] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:025cf29b
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@llogiq llogiq force-pushed the simplify-unused-lints branch from 4eded25 to 6eb144c Compare October 2, 2018 16:27
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 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:17:31]    Compiling rustc_codegen_utils v0.0.0 (/checkout/src/librustc_codegen_utils)
[00:17:31]    Compiling rustc_borrowck v0.0.0 (/checkout/src/librustc_borrowck)
[00:17:31]    Compiling rustc_passes v0.0.0 (/checkout/src/librustc_passes)
[00:17:55]    Compiling rustc_lint v0.0.0 (/checkout/src/librustc_lint)
[00:17:55] error: expected one of `.`, `;`, `?`, or an operator, found `if`
[00:17:55]     |
[00:17:55] 347 |                 }
[00:17:55] 347 |                 }
[00:17:55]     |                  - expected one of `.`, `;`, `?`, or an operator here
[00:17:55] ...
[00:17:55] 352 |                 if e.span.ctxt().outer().expn_info()
[00:17:55]     |                 ^^ unexpected token
[00:17:56]    Compiling rustc_save_analysis v0.0.0 (/checkout/src/librustc_save_analysis)
[00:17:57] error: aborting due to previous error
[00:17:57] 
[00:17:57] error: Could not compile `rustc_lint`.
[00:17:57] error: Could not compile `rustc_lint`.
[00:17:57] warning: build failed, waiting for other jobs to finish...
[00:18:17] error: build failed
[00:18:17] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:18:17] expected success, got: exit code: 101
[00:18:17] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1112:9
[00:18:17] travis_fold:end:stage0-rustc

[00:18:17] travis_time:end:stage0-rustc:start=1538498205618374939,finish=1538498984837921510,duration=779219546571


[00:18:17] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:18:17] Build completed unsuccessfully in 0:13:55
[00:18:17] Makefile:28: recipe for target 'all' failed
[00:18:17] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:091a445c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:04a80a85:start=1538498985674509624,finish=1538498985679749402,duration=5239778
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:251f6a37
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:2c2291dd
travis_time:start:2c2291dd
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
travis_time:end:2c2291dd:start=1538498985700383398,finish=1538498985705587315,duration=5203917
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0c875cc4

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)

@llogiq llogiq force-pushed the simplify-unused-lints branch from 6eb144c to 3f20549 Compare October 2, 2018 17:04
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-5.0 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:16:33] 339 |                 let args_to_check;
[00:16:33]     |                     ^^^^^^^^^^^^^
[00:16:33]     |                     |
[00:16:33]     |                     cannot infer type
[00:16:33]     |                     consider giving `args_to_check` a type
[00:16:33] error: aborting due to previous error
[00:16:33] 
[00:16:33] For more information about this error, try `rustc --explain E0282`.
[00:16:33] error: Could not compile `rustc_lint`.
---
travis_time:end:098aae79:start=1538501030341940661,finish=1538501030346440223,duration=4499562
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:27ef9872
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0f54cea4
travis_time:start:0f54cea4
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:011a87b9
$ dmesg | grep -i kill

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)

@llogiq llogiq force-pushed the simplify-unused-lints branch from 3f20549 to 989f480 Compare October 3, 2018 07:00
@michaelwoerister
Copy link
Member

@bors r+ rollup

Thanks, @llogiq!

@bors
Copy link
Contributor

bors commented Oct 4, 2018

📌 Commit 989f480 has been approved by michaelwoerister

@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 Oct 4, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Oct 4, 2018
…haelwoerister

simplify some unused lints code

Those are but small simplifications for readability.
bors added a commit that referenced this pull request Oct 4, 2018
Rollup of 10 pull requests

Successful merges:

 - #53523 (Add doc for impl From for Std Error)
 - #54746 (simplify some unused lints code)
 - #54761 (Make spec_extend use for_each())
 - #54769 (Fix typo in CONTRIBUTING.md)
 - #54773 (Update a FIXME in memory.rs)
 - #54777 (abolish ICE when pretty-printing async block)
 - #54780 (Remove duplicate predicates in `explicit_predicates_of`)
 - #54788 (A handful of cleanups for rustc/mir)
 - #54789 (Introduce `TyKind::UnnormalizedProjection`)
 - #54795 (remove padding from multiline format string label)

Failed merges:

r? @ghost
@bors bors merged commit 989f480 into rust-lang:master Oct 4, 2018
@llogiq llogiq deleted the simplify-unused-lints branch October 4, 2018 15:16
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants