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

Add lint for items deprecated in future #56203

Merged
merged 2 commits into from
Dec 15, 2018
Merged

Add lint for items deprecated in future #56203

merged 2 commits into from
Dec 15, 2018

Conversation

aheart
Copy link
Contributor

@aheart aheart commented Nov 24, 2018

Resolves #55892

@rust-highfive
Copy link
Collaborator

r? @matthewjasper

(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 Nov 24, 2018
@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.
travis_time:end:1acdc76e:start=1543093652701300229,finish=1543093706191465782,duration=53490165553
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---

[00:03:03] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:03] tidy error: /checkout/src/test/ui/deprecation/deprecation-in-future.rs:17: line longer than 100 chars
[00:03:03] tidy error: /checkout/src/test/ui/deprecation/deprecation-in-future.rs: missing trailing newline
[00:03:04] tidy error: /checkout/src/librustc/middle/stability.rs:593: line longer than 100 chars
[00:03:05] some tidy checks failed
[00:03:05] 
[00:03:05] 
[00:03:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:05] 
[00:03:05] 
[00:03:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:05] Build completed unsuccessfully in 0:00:54
[00:03:05] Build completed unsuccessfully in 0:00:54
[00:03:05] make: *** [tidy] Error 1
[00:03:05] Makefile:79: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0a99e314
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Nov 24 21:11:40 UTC 2018
---
travis_time:end:00b31408:start=1543093900847106177,finish=1543093900851158506,duration=4052329
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0bd8265c
$ 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:16c80988
travis_time:start:16c80988
$ 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:03b4dc97
$ 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)

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

This looks good! Just a couple of minor comments and then it'll be good to go!

src/librustc/lint/builtin.rs Outdated Show resolved Hide resolved
src/librustc/middle/stability.rs Outdated Show resolved Hide resolved
src/test/ui/deprecation/deprecation-in-future.rs Outdated Show resolved Hide resolved
src/test/ui/deprecation/deprecation-in-future.rs Outdated Show resolved Hide resolved
src/librustc/middle/stability.rs Outdated Show resolved Hide resolved
@varkor
Copy link
Member

varkor commented Nov 24, 2018

r? @varkor

@@ -0,0 +1,16 @@
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@varkor, should I rename this file to deprecation_in_future-lint.rs or something similar?

@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.
travis_time:end:0ae6e514:start=1543177170638669348,finish=1543177224162988327,duration=53524318979
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---

[00:03:31] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:31] tidy error: /checkout/src/test/ui/deprecation/deprecation-in-future.rs:13: line longer than 100 chars
[00:03:32] tidy error: /checkout/src/librustc/middle/stability.rs:567: line longer than 100 chars
[00:03:32] tidy error: /checkout/src/librustc/middle/stability.rs:600: line longer than 100 chars
[00:03:33] some tidy checks failed
[00:03:33] 
[00:03:33] 
[00:03:33] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:33] 
[00:03:33] 
[00:03:33] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:33] Build completed unsuccessfully in 0:01:03
[00:03:33] Build completed unsuccessfully in 0:01:03
[00:03:33] make: *** [tidy] Error 1
[00:03:33] Makefile:79: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05bb385c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Nov 25 20:24:07 UTC 2018
---
travis_time:end:0ba0e3ee:start=1543177447430241162,finish=1543177447435223790,duration=4982628
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0807f89d
$ 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:0c22f1ce
travis_time:start:0c22f1ce
$ 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:04e2d13e
$ 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)

@aheart
Copy link
Contributor Author

aheart commented Nov 25, 2018

@varkor, @RalfJung,
I've addressed your comments, but I'm struggling with the failing travis job.
I can see examples of lines longer than 100 symbols in other files.

@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.
travis_time:end:069dc23f:start=1543223611490194686,finish=1543223664968026947,duration=53477832261
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---

[00:03:27] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:28] tidy error: /checkout/src/test/ui/deprecation/deprecation-in-future.rs:13: line longer than 100 chars
[00:03:28] tidy error: /checkout/src/librustc/middle/stability.rs:567: line longer than 100 chars
[00:03:28] tidy error: /checkout/src/librustc/middle/stability.rs:600: line longer than 100 chars
[00:03:29] some tidy checks failed
[00:03:29] 
[00:03:29] 
[00:03:29] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:03:29] 
[00:03:29] 
[00:03:29] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:29] Build completed unsuccessfully in 0:01:01
[00:03:29] Build completed unsuccessfully in 0:01:01
[00:03:29] Makefile:79: recipe for target 'tidy' failed
[00:03:29] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2403070d
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Mon Nov 26 09:18:03 UTC 2018
---
travis_time:end:1e0f57e1:start=1543223884078234459,finish=1543223884083883515,duration=5649056
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:337dfdec
$ 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:0bc29864
travis_time:start:0bc29864
$ 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:08eb91b2
$ 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)

@RalfJung
Copy link
Member

RalfJung commented Dec 2, 2018

I can see examples of lines longer than 100 symbols in other files.

You probably have to add // ignore-tidy-linelength to your test. However, the middle/stability.rs should get fixed by adding linebreaks.

@aheart
Copy link
Contributor Author

aheart commented Dec 2, 2018

You probably have to add // ignore-tidy-linelength to your test.

That explains it. Thank you!

@varkor
Copy link
Member

varkor commented Dec 5, 2018

Sorry for taking a while to get back on this. If you could get rid of the unwrap by adding the since information to deprecated_in_future_version (#56203 (comment)) and squash your commits, then everything looks great to me! Thanks!

@bors
Copy link
Contributor

bors commented Dec 7, 2018

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

@aheart
Copy link
Contributor Author

aheart commented Dec 9, 2018

@varkor, no problem. Unwrap is gone. I've also rebased unto master and squashed my commits.
I appreciate your and @RalfJung's help. 😃

@@ -614,8 +639,14 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
if let Some(&Stability{rustc_depr: Some(attr::RustcDeprecation { reason, since }), ..})
= stability {
if let Some(id) = id {
let path = self.item_path_str(def_id);
let message = format!("use of deprecated item '{}'", path);
if deprecation_in_effect(&since.as_str()) {
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I didn't notice before, but we need to make the same changes here. This warning is for deprecated items inside the standard library, etc. It should be affected by DEPRECATED_IN_FUTURE as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem. Done in 5c79eab88e6e71134175a7dce9795c8f8f3f4949
If this is acceptable I'll squash the commits 😃

@varkor
Copy link
Member

varkor commented Dec 9, 2018

Thanks! Just one final comment (which is particularly important for addressing #55892).

Copy link
Member

@varkor varkor left a comment

Choose a reason for hiding this comment

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

Great! r=me after the extra blank line is removed (it can be amended on to the previous commit).

src/librustc/middle/stability.rs Outdated Show resolved Hide resolved
kennytm added a commit to kennytm/rust that referenced this pull request Dec 12, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 12, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 13, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this pull request Dec 13, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this pull request Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
kennytm added a commit to kennytm/rust that referenced this pull request Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Dec 14, 2018
Add lint for items deprecated in future

Resolves rust-lang#55892
@pietroalbini
Copy link
Member

@bors rollup-

@bors
Copy link
Contributor

bors commented Dec 15, 2018

⌛ Testing commit f8c03b6 with merge 93c2f05...

bors added a commit that referenced this pull request Dec 15, 2018
Add lint for items deprecated in future

Resolves #55892
@bors
Copy link
Contributor

bors commented Dec 15, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: varkor
Pushing 93c2f05 to master...

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.

7 participants