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

Internal lints: usage_of_qualified_ty & ty_pass_by_reference #60317

Merged
merged 10 commits into from
Apr 28, 2019

Conversation

flip1995
Copy link
Member

Closes #59952

Implements internal lints:

  • USAGE_OF_QUALIFIED_TY
  • TY_PASS_BY_REFERENCE

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.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.
travis_time:end:09da5e99:start=1556298194956616060,finish=1556298197186123155,duration=2229507095
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:53:34]    Compiling rustdoc v0.0.0 (/checkout/src/librustdoc)
[00:53:44] error: passing `TyCtxt<'_, '_, '_>` by reference
[00:53:44]    --> src/librustdoc/clean/auto_trait.rs:853:29
[00:53:44]     |
[00:53:44] 853 |     fn is_fn_ty(&self, tcx: &TyCtxt<'_, '_, '_>, ty: &Type) -> bool {
[00:53:44]     |                             ^^^^^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_, '_, '_>`
[00:53:44] note: lint level defined here
[00:53:44]    --> src/librustdoc/lib.rs:2:9
[00:53:44]     |
[00:53:44] 2   | #![deny(internal)]
[00:53:44] 2   | #![deny(internal)]
[00:53:44]     |         ^^^^^^^^
[00:53:44]     = note: #[deny(ty_pass_by_reference)] implied by #[deny(internal)]
[00:53:44] error: passing `TyCtxt<'_, '_, '_>` by reference
[00:53:44]     --> src/librustdoc/clean/mod.rs:4400:31
[00:53:44]      |
[00:53:44]      |
[00:53:44] 4400 | pub fn path_to_def_local(tcx: &TyCtxt<'_, '_, '_>, path: &[&str]) -> Option<DefId> {
[00:53:44]      |                               ^^^^^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_, '_, '_>`
[00:53:44] error: passing `TyCtxt<'_, '_, '_>` by reference
[00:53:44]     --> src/librustdoc/clean/mod.rs:4425:25
[00:53:44]      |
[00:53:44]      |
[00:53:44] 4425 | pub fn path_to_def(tcx: &TyCtxt<'_, '_, '_>, path: &[&str]) -> Option<DefId> {
[00:53:44]      |                         ^^^^^^^^^^^^^^^^^^^ help: try passing by value: `TyCtxt<'_, '_, '_>`
[00:53:45] error: aborting due to 3 previous errors
[00:53:45] 
[00:53:45] error: Could not compile `rustdoc`.
[00:53:45] 
---
travis_time:end:0c88f092:start=1556301434970716526,finish=1556301434976965554,duration=6249028
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0106019e
$ 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:0120959c
travis_time:start:0120959c
$ 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:09d21b63
$ 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)

@bors
Copy link
Contributor

bors commented Apr 27, 2019

☔ The latest upstream changes (presumably #60329) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor

oli-obk commented Apr 28, 2019

needs a rebase, r=me with that

@bors delegate+

@bors
Copy link
Contributor

bors commented Apr 28, 2019

✌️ @flip1995 can now approve this pull request

@bors
Copy link
Contributor

bors commented Apr 28, 2019

☔ The latest upstream changes (presumably #60351) made this pull request unmergeable. Please resolve the merge conflicts.

@oli-obk
Copy link
Contributor

oli-obk commented Apr 28, 2019

@bors p=1 super bitrotty apparently

@flip1995
Copy link
Member Author

Also removed the unused argument from the allow_two_phase_borrow function. cc #60347

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Apr 28, 2019

📌 Commit 2e5f0b3 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 Apr 28, 2019
bors added a commit that referenced this pull request Apr 28, 2019
Internal lints: usage_of_qualified_ty & ty_pass_by_reference

Closes #59952

Implements internal lints:

- `USAGE_OF_QUALIFIED_TY`
- `TY_PASS_BY_REFERENCE`

r? @oli-obk
@bors
Copy link
Contributor

bors commented Apr 28, 2019

⌛ Testing commit 2e5f0b3 with merge 272000c...

@bors
Copy link
Contributor

bors commented Apr 28, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 272000c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 28, 2019
@bors bors merged commit 2e5f0b3 into rust-lang:master Apr 28, 2019
@flip1995 flip1995 deleted the internal_lints branch April 28, 2019 23:46
Manishearth added a commit to rust-lang/rust-clippy that referenced this pull request Apr 29, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Apr 29, 2019
Rustup to rustc 1.36.0-nightly (c7fcbfb 2019-04-29)

Updates to pass the lint introduced in rust-lang/rust#60317

r? @oli-obk @mikerite
Manishearth added a commit to rust-lang/rust-clippy that referenced this pull request Apr 29, 2019
bors added a commit to rust-lang/rust-clippy that referenced this pull request Apr 29, 2019
Rustup to rustc 1.36.0-nightly (c7fcbfb 2019-04-29)

Updates to pass the lint introduced in rust-lang/rust#60317

r? @oli-obk @mikerite
@@ -198,7 +198,7 @@ macro_rules! make_mir_visitor {
}

fn visit_ty(&mut self,
ty: & $($mutability)? Ty<'tcx>,
ty: $(& $mutability)? Ty<'tcx>,
Copy link
Member

Choose a reason for hiding this comment

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

Wow, that's a neat trick! cc @nikomatsakis how did we not think of this?

Copy link
Member

Choose a reason for hiding this comment

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

{visit,super}_{local,region,const} (and maybe a few others?) should probably get the same treatment.

Copy link
Contributor

Choose a reason for hiding this comment

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

heh, a good question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

Enforce import / type code styles throughout the compiler.
6 participants