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

Rename rustc_errors dependency in rust 2018 crates #58273

Merged
merged 3 commits into from
Feb 13, 2019

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Feb 7, 2019

I think this is a better solution than use rustc_errors as errors in lib.rs and use crate::errors in modules.

Related: rust-lang/cargo#5653

cc #58099

r? @Centril

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 7, 2019
@Centril
Copy link
Contributor

Centril commented Feb 8, 2019

r? @matthewjasper

use crate::errors::DiagnosticBuilder;
use crate::errors::Level;
use crate::errors::Diagnostic;
use crate::errors::FatalError;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be moved down to the other external dependencies?

@bors
Copy link
Contributor

bors commented Feb 9, 2019

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

@bors
Copy link
Contributor

bors commented Feb 10, 2019

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

@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:103a7cf0:start=1549778314219868599,finish=1549778316582096125,duration=2362227526
$ 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-6.0
---
[00:19:12]    Compiling rustc_codegen_utils v0.0.0 (/checkout/src/librustc_codegen_utils)
[00:19:12] error[E0432]: unresolved import `crate::errors`
[00:19:12]   --> src/librustc_resolve/error_reporting.rs:12:12
[00:19:12]    |
[00:19:12] 12 | use crate::errors::{Applicability, DiagnosticBuilder, DiagnosticId};
[00:19:12]    |            ^^^^^^ did you mean `syntax::errors`?
[00:19:14] error: aborting due to previous error
[00:19:14] 
[00:19:14] For more information about this error, try `rustc --explain E0432`.
[00:19:14] error: Could not compile `rustc_resolve`.
---
travis_time:end:02f80ad6:start=1549779531477024746,finish=1549779531483289639,duration=6264893
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0d1dcac0
$ 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:15166d90
travis_time:start:15166d90
$ 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:0b9f5878
$ 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)

@petrochenkov
Copy link
Contributor

@taiki-e

I think this is a better solution than use rustc_errors as errors in lib.rs and use crate::errors in modules.

FWIW, you don't need use crate::errors, extern crate rustc_errors as errors + use errors would work as well.
Cargo.toml is still the more idiomatic solution though.

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 10, 2019

📌 Commit 8bb7f5f21c5cf3877ea9b9404b3ba400f113c116 has been approved by matthewjasper

@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 Feb 10, 2019
@taiki-e
Copy link
Member Author

taiki-e commented Feb 10, 2019

@petrochenkov

FWIW, you don't need use crate::errors, extern crate rustc_errors as errors + use errors would work as well.

Yeah, we originally used extern crate rustc_errors as errors + use errors. But changed this to use rustc_errors as errors + use crate::errors based on unused_extern_crates(included in rust_2018_idioms)'s message.
(And I remembered that there was a way not requiring #[allow(unused_extern_crates)] or use crate::errors after they were merged, so I wrote this PR.)

@bors
Copy link
Contributor

bors commented Feb 10, 2019

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

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 10, 2019
@taiki-e
Copy link
Member Author

taiki-e commented Feb 12, 2019

Rebased.

r? @matthewjasper

@bors
Copy link
Contributor

bors commented Feb 12, 2019

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

@taiki-e
Copy link
Member Author

taiki-e commented Feb 12, 2019

Rebased.

@matthewjasper
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Feb 12, 2019

📌 Commit c08b5ca has been approved by matthewjasper

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 12, 2019
Centril added a commit to Centril/rust that referenced this pull request Feb 13, 2019
…wjasper

Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc rust-lang#58099

r? @Centril
Centril added a commit to Centril/rust that referenced this pull request Feb 13, 2019
…wjasper

Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc rust-lang#58099

r? @Centril
bors added a commit that referenced this pull request Feb 13, 2019
Rollup of 13 pull requests

Successful merges:

 - #57693 (Doc rewording)
 - #57815 (Speed up the fast path for assert_eq! and assert_ne!)
 - #58034 (Stabilize the time_checked_add feature)
 - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO))
 - #58137 (Cleanup: rename node_id_to_type(_opt))
 - #58166 (allow shorthand syntax for deprecation reason)
 - #58196 (Add specific feature gate error for const-unstable features)
 - #58200 (fix str mutating through a ptr derived from &self)
 - #58273 (Rename rustc_errors dependency in rust 2018 crates)
 - #58289 (impl iter() for dyn Error)
 - #58387 (Disallow `auto` trait alias syntax)
 - #58404 (use Ubuntu keyserver for CloudABI ports)
 - #58405 (Remove some dead code from libcore)

Failed merges:

r? @ghost
Centril added a commit to Centril/rust that referenced this pull request Feb 13, 2019
…wjasper

Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc rust-lang#58099

r? @Centril
bors added a commit that referenced this pull request Feb 13, 2019
Rollup of 12 pull requests

Successful merges:

 - #57693 (Doc rewording)
 - #57815 (Speed up the fast path for assert_eq! and assert_ne!)
 - #58034 (Stabilize the time_checked_add feature)
 - #58057 (Stabilize linker-plugin based LTO (aka cross-language LTO))
 - #58137 (Cleanup: rename node_id_to_type(_opt))
 - #58166 (allow shorthand syntax for deprecation reason)
 - #58200 (fix str mutating through a ptr derived from &self)
 - #58273 (Rename rustc_errors dependency in rust 2018 crates)
 - #58289 (impl iter() for dyn Error)
 - #58387 (Disallow `auto` trait alias syntax)
 - #58404 (use Ubuntu keyserver for CloudABI ports)
 - #58405 (Remove some dead code from libcore)

Failed merges:

r? @ghost
@bors bors merged commit c08b5ca into rust-lang:master Feb 13, 2019
@taiki-e taiki-e deleted the rename-dependency branch February 13, 2019 07:53
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.

6 participants