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 a "diagnostic item" scheme for lints referring to libstd items #60966

Open
wants to merge 11 commits into
base: master
from

Conversation

@oli-obk
Copy link
Contributor

commented May 19, 2019

src/liballoc/vec.rs Outdated Show resolved Hide resolved

@petrochenkov petrochenkov self-assigned this May 19, 2019

@oli-obk oli-obk changed the title WIP: Add a "diagnostic item" scheme for lints referring to libstd items Add a "diagnostic item" scheme for lints referring to libstd items May 21, 2019

@oli-obk oli-obk marked this pull request as ready for review May 21, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 21, 2019

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:1d52570c:start=1558453116087804491,finish=1558453202089290512,duration=86001486021
$ 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
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:17:31] 
[01:17:31] running 143 tests
[01:17:33] i..iii.....iii..iiii.....i......................i..i.................i.....i..........ii.i..i..i.ii. 100/143
[01:17:35] test result: ok. 113 passed; 0 failed; 30 ignored; 0 measured; 0 filtered out
[01:17:35] 
[01:17:35]  finished in 4.492
[01:17:35] travis_fold:end:test_codegen
---
travis_time:start:test_assembly
Check compiletest suite=assembly mode=assembly (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:17:37] 
[01:17:37] running 9 tests
[01:17:37] iiiiiiiii
[01:17:37] 
[01:17:37]  finished in 0.149
[01:17:37] travis_fold:end:test_assembly

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:17:52] 
[01:17:52] running 122 tests
[01:18:17] .iiiii...i.....i..i...i..i.i.i..i.ii..i.i.....i..i....i..........iiii..........i...ii...i.......ii.i 100/122
[01:18:22] .i.i......iii.i.....ii
[01:18:22] 
[01:18:22]  finished in 29.453
[01:18:22] travis_fold:end:test_debuginfo

---
[01:25:53]    Compiling rand_chacha v0.1.0
[01:25:53]    Compiling rand_pcg v0.1.1
[01:25:53]    Compiling rand v0.6.1
[01:25:57]    Compiling alloc v0.0.0 (/checkout/src/liballoc)
[01:26:03] error: duplicate diagnostic item found: `vec_type`.
[01:26:03]     |
[01:26:03] 294 | / pub struct Vec<T> {
[01:26:03] 295 | |     buf: RawVec<T>,
[01:26:03] 296 | |     len: usize,
---
[01:26:03] warning: build failed, waiting for other jobs to finish...
[01:27:14] error: build failed
[01:27:14] 
[01:27:14] 
[01:27:14] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--" "--quiet"
[01:27:14] 
[01:27:14] 
[01:27:14] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:27:14] Build completed unsuccessfully in 0:21:00
[01:27:14] Build completed unsuccessfully in 0:21:00
[01:27:14] Makefile:48: recipe for target 'check' failed
[01:27:14] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0f7f226c
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue May 21 17:07:26 UTC 2019
---
travis_time:end:1ab1bf7e:start=1558458447795139596,finish=1558458447800308954,duration=5169358
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:05bb7f7c
$ 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:0e0acf40
travis_time:start:0e0acf40
$ 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:03d35322
$ 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 petrochenkov removed their assignment May 21, 2019

@bors

This comment was marked as resolved.

Copy link
Contributor

commented May 22, 2019

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

@oli-obk oli-obk force-pushed the oli-obk:diagnostic_items branch from ffea401 to 10d161f May 22, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented May 22, 2019

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:0a6747fa:start=1558539228725843776,finish=1558539230930549063,duration=2204705287
$ 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:13:53]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:13:53] error[E0252]: the name `Symbol` is defined multiple times
[00:13:53]   --> src/librustc_metadata/decoder.rs:36:68
[00:13:53]    |
[00:13:53] 33 | use syntax::symbol::{Symbol, sym};
[00:13:53]    |                      ------ previous import of the type `Symbol` here
[00:13:53] ...
[00:13:53] 36 | use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION, Symbol};
[00:13:53]    |                                                                    ^^^^^^ `Symbol` reimported here
[00:13:53]    = note: `Symbol` must be defined only once in the type namespace of this module
[00:13:53] 
[00:13:53] error: unused import: `Symbol`
[00:13:53]   --> src/librustc_metadata/decoder.rs:36:68
[00:13:53]   --> src/librustc_metadata/decoder.rs:36:68
[00:13:53]    |
[00:13:53] 36 | use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION, Symbol};
[00:13:53]    |
[00:13:53]    = note: `-D unused-imports` implied by `-D warnings`
[00:13:53] 
[00:13:55] error: aborting due to 2 previous errors
---
travis_time:end:170f0cdc:start=1558540326056296542,finish=1558540326060685918,duration=4389376
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0420c318
$ 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:0074763a
travis_time:start:0074763a
$ 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:058b1a28
$ 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)

@oli-obk oli-obk force-pushed the oli-obk:diagnostic_items branch from 10d161f to e735e21 May 22, 2019

@bors

This comment has been minimized.

Copy link
Contributor

commented May 23, 2019

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

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2019

@rust-lang/compiler Are you alright with adding this scheme (similar to lang items) for diagnostic items, allowing rustc lints and clippy lints to ask the compiler whether a specific DefId is a specific diagnostic item. It will place these into metadata (should have no effect beyond the single u32 offset value for crates without diagnostic items) and clippy will be able to overwrite the query to add its own clippy::diagnostic_item entries to it (so e.g. serde can use it, since we also lint serde specific things).

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

Is there an overview somewhere of what "diagnostic items" are and why the concept is needed?

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

commented May 27, 2019

The list of things that we want to make diagnostic items include (but are not limited to) https://github.com/rust-lang/rust-clippy/blob/abe139c7ac7d5a33a6edb60ba0d4eb4dfaf11103/clippy_lints/src/utils/paths.rs#L4-L115

Now our scheme (of using &[&str] to declare paths to items that we want to lint about) does work, but it has several flaws:

  • If an item is a core reexport, we need to check both the std path and the core path to ensure we can lint on no_core platforms, too.
  • If we want to fetch the DefId of a path (e.g. of a trait in order to check whether something implements said trait), we need to use this fun piece of code which walks the module tree to find the item and then get the DefId.
  • If libstd/libcore move a type into a private module and reexport it, the paths break and we need to fix them

Furthermore, some rustc diagnostics have to go through pretty printing types and matching on the result like in

let orig_path_ty = format!(
"{:?}",
original_path.ty(self.mir, self.infcx.tcx).ty,
);
let snippet = self.infcx.tcx.sess.source_map().span_to_snippet(span).unwrap();
let is_option = orig_path_ty.starts_with("std::option::Option");
in order to be able to report targeted diagnostics.

This PR will allow making all of these libcore/libstd specific errors and lints much simpler and reduce the complexity needed around them.

@bors

This comment has been minimized.

Copy link
Contributor

commented May 27, 2019

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

@oli-obk oli-obk force-pushed the oli-obk:diagnostic_items branch from 66df46f to 90f9684 May 27, 2019

@eddyb

This comment has been minimized.

Copy link
Member

commented May 28, 2019

@oli-obk You can always look up the core/alloc path, it will have the DefId as its std reexport.
Also, the other flaws can be solved by just exposing a bit more of the name resolution machinery.
IMO, that's a better direction to go into, for non-language-mandated definitions.

But I am not strongly in favor of either, sometimes I'd rather clippy pattern-matched the definition, so if I made my own weird Option-like, I'd get similar warnings, but that's a bit far-fetched.

@Manishearth

This comment has been minimized.

Copy link
Member

commented May 28, 2019

Note that lookups are pretty slow compared to this scheme.

I would like to expose name resolution machinery, though, we need that anyway for rustdoc.

But I am not strongly in favor of either, sometimes I'd rather clippy pattern-matched the definition, so if I made my own weird Option-like, I'd get similar warnings, but that's a bit far-fetched.

It would need to behave exactly the same way Option does in the contexts any given lint cares about, so pattern matching that ("does it have a function named X?" etc) gets much more expensive

@eddyb

This comment has been minimized.

Copy link
Member

commented May 28, 2019

@Manishearth I agree about pattern-matching requiring custom logic, which has a time/effort cost to write in the first place - however, the cost to run a lookup/pattern-match is easily amortized by caching.

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

commented May 29, 2019

I'd rather clippy pattern-matched the definition, so if I made my own weird Option-like, I'd get similar warnings, but that's a bit far-fetched.

I want to add a scheme like #[clippy::diagnostic_item = "foo], and I'm very open to allowing multiple definitions of foo. I want opt-in for such lints for new types, because our lints are super handcrafted to the specific types they target and I don't see pattern-matching definitions coming any time soon or ever (as I foresee super many false positives that can't be eliminated in general).

Note that this change is done out of three reasons:

  • performance (ok caching could help, but any machinery will end up looking like this machinery at some point, or actually end up less comprehensible)
  • stability (less clippy breakage due to paths changing)
  • usability (we now have canonical names for language defined things and potentially even user defined things via clippy::diagnostic_item)
  • it just seems cleaner to have a clear, unambiguous way to refer to a specific item

tbh, the last three are why I did this

@bors

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2019

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

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

commented Jun 6, 2019

Heh, one idea I just had: We can pattern match definitions and suggest that the user add #[clippy::diagnostic_item = "foo"] if the type is similar enough to foo. This way we don't forget anything and at the same time have opt-in

@Dylan-DPC

This comment has been minimized.

Copy link
Member

commented Jul 1, 2019

ping from triage @Manishearth @oli-obk any updates?

@oli-obk oli-obk force-pushed the oli-obk:diagnostic_items branch from 90f9684 to 6028c1f Jul 18, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Jul 18, 2019

The job mingw-check of your PR failed (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.
2019-07-18T13:06:31.1433632Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-18T13:06:31.1657318Z ##[command]git config gc.auto 0
2019-07-18T13:06:31.1719745Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-18T13:06:31.1782451Z ##[command]git config --get-all http.proxy
2019-07-18T13:06:31.1922716Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/60966/merge:refs/remotes/pull/60966/merge
---
2019-07-18T13:07:06.8762769Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-18T13:07:06.8762833Z 
2019-07-18T13:07:06.8763566Z   git checkout -b <new-branch-name>
2019-07-18T13:07:06.8763629Z 
2019-07-18T13:07:06.8763923Z HEAD is now at 1a970c388 Merge 6028c1f53b19630bfaab29cfd494003b884ba158 into 21d5b8bf0c26e3ee4c270ce5527df66b1af56513
2019-07-18T13:07:06.8921056Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-18T13:07:06.8923691Z ==============================================================================
2019-07-18T13:07:06.8923742Z Task         : Bash
2019-07-18T13:07:06.8923785Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-18T13:12:32.1378224Z Checking rustdoc artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-18T13:12:32.1401290Z Checking std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
2019-07-18T13:12:32.4998073Z    Compiling cc v1.0.35
2019-07-18T13:12:32.4998394Z     Checking core v0.0.0 (/checkout/src/libcore)
2019-07-18T13:12:34.1046647Z error: cannot determine resolution for the derive macro `Debug`
2019-07-18T13:12:34.1048432Z   --> src/libcore/num/dec2flt/rawfp.rs:30:23
2019-07-18T13:12:34.1048987Z    |
2019-07-18T13:12:34.1049569Z 30 | #[derive(Copy, Clone, Debug)]
2019-07-18T13:12:34.1050652Z    |
2019-07-18T13:12:34.1050652Z    |
2019-07-18T13:12:34.1051180Z    = note: import resolution is stuck, try simplifying macro imports
2019-07-18T13:12:41.0075036Z    Compiling libc v0.2.54
2019-07-18T13:12:41.7938394Z    Compiling autocfg v0.1.4
2019-07-18T13:12:43.4679029Z    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
2019-07-18T13:12:45.8463191Z    Compiling unwind v0.0.0 (/checkout/src/libunwind)
2019-07-18T13:12:45.8463191Z    Compiling unwind v0.0.0 (/checkout/src/libunwind)
2019-07-18T13:12:46.1362603Z error: aborting due to previous error
2019-07-18T13:12:46.1366297Z 
2019-07-18T13:12:46.2378484Z error: Could not compile `core`.
2019-07-18T13:12:46.2378902Z warning: build failed, waiting for other jobs to finish...
2019-07-18T13:12:46.3969782Z error: build failed
2019-07-18T13:12:46.3997794Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "check" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
2019-07-18T13:12:46.4010792Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap check
2019-07-18T13:12:46.4010890Z Build completed unsuccessfully in 0:02:27
2019-07-18T13:12:46.4010890Z Build completed unsuccessfully in 0:02:27
2019-07-18T13:12:54.5709964Z ##[error]Bash exited with code '1'.
2019-07-18T13:12:54.5740125Z ##[section]Starting: Checkout
2019-07-18T13:12:54.5742241Z ==============================================================================
2019-07-18T13:12:54.5742282Z Task         : Get sources
2019-07-18T13:12:54.5742332Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Jul 18, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-07-18T13:51:58.5510280Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-18T13:51:58.5684326Z ##[command]git config gc.auto 0
2019-07-18T13:51:58.5757815Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-18T13:51:58.5809117Z ##[command]git config --get-all http.proxy
2019-07-18T13:51:59.1064177Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/60966/merge:refs/remotes/pull/60966/merge
---
2019-07-18T13:52:33.5602694Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-18T13:52:33.5602726Z 
2019-07-18T13:52:33.5602956Z   git checkout -b <new-branch-name>
2019-07-18T13:52:33.5602986Z 
2019-07-18T13:52:33.5603052Z HEAD is now at c32f59ad6 Merge be212df8c899eda5a45da1fdcccff68f65bf38ba into 21d5b8bf0c26e3ee4c270ce5527df66b1af56513
2019-07-18T13:52:33.5747674Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-18T13:52:33.5750885Z ==============================================================================
2019-07-18T13:52:33.5750946Z Task         : Bash
2019-07-18T13:52:33.5750994Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-18T14:22:07.4004626Z    |
2019-07-18T14:22:07.4012420Z 77 | #![cfg_attr(not(bootstrap), feature(const_generics))]
2019-07-18T14:22:07.4019945Z    |                                     ^^^^^^^^^^^^^^
2019-07-18T14:22:07.4057273Z 
2019-07-18T14:22:08.7912428Z error[E0658]: The attribute `rustc_diagnostic_item` is currently unknown to the compiler and may have meaning added to it in the future
2019-07-18T14:22:08.7913625Z    --> src/libcore/fmt/mod.rs:522:28
2019-07-18T14:22:08.7914712Z     |
2019-07-18T14:22:08.7915917Z 522 | #[cfg_attr(not(bootstrap), rustc_diagnostic_item = "debug_trait")]
2019-07-18T14:22:08.7923284Z     |
2019-07-18T14:22:08.7923284Z     |
2019-07-18T14:22:08.7924280Z     = note: for more information, see ***/issues/29642
2019-07-18T14:22:08.7925071Z     = help: add `#![feature(custom_attribute)]` to the crate attributes to enable
2019-07-18T14:22:08.7925362Z 
2019-07-18T14:22:08.9394249Z error: cannot determine resolution for the derive macro `Debug`
2019-07-18T14:22:08.9395358Z   --> src/libcore/num/dec2flt/rawfp.rs:30:23
2019-07-18T14:22:08.9397070Z    |
2019-07-18T14:22:08.9397723Z 30 | #[derive(Copy, Clone, Debug)]
2019-07-18T14:22:08.9398994Z    |
2019-07-18T14:22:08.9398994Z    |
2019-07-18T14:22:08.9399756Z    = note: import resolution is stuck, try simplifying macro imports
2019-07-18T14:22:15.7296095Z    Compiling libc v0.2.54
2019-07-18T14:22:17.0799587Z    Compiling autocfg v0.1.4
2019-07-18T14:22:18.2733567Z    Compiling unwind v0.0.0 (/checkout/src/libunwind)
2019-07-18T14:22:18.8107789Z    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
2019-07-18T14:22:18.8107789Z    Compiling build_helper v0.1.0 (/checkout/src/build_helper)
2019-07-18T14:22:19.7582462Z error: aborting due to 2 previous errors
2019-07-18T14:22:19.7584084Z 
2019-07-18T14:22:19.7587889Z For more information about this error, try `rustc --explain E0658`.
2019-07-18T14:22:19.9188561Z error: Could not compile `core`.
2019-07-18T14:22:19.9188974Z warning: build failed, waiting for other jobs to finish...
2019-07-18T14:22:20.1959901Z error: build failed
2019-07-18T14:22:20.1985865Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace compiler-builtins-c" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "--message-format" "json"
2019-07-18T14:22:20.1998919Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-18T14:22:20.1999003Z Build completed unsuccessfully in 0:23:39
2019-07-18T14:22:20.1999003Z Build completed unsuccessfully in 0:23:39
2019-07-18T14:22:21.0679732Z ##[error]Bash exited with code '1'.
2019-07-18T14:22:21.0721160Z ##[section]Starting: Checkout
2019-07-18T14:22:21.0722907Z ==============================================================================
2019-07-18T14:22:21.0722981Z Task         : Get sources
2019-07-18T14:22:21.0723027Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

@oli-obk

This comment has been minimized.

Copy link
Contributor Author

commented Jul 18, 2019

This is now ready for review

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Jul 18, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-07-18T14:29:13.8444095Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-07-18T14:29:13.8650219Z ##[command]git config gc.auto 0
2019-07-18T14:29:13.8726040Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-07-18T14:29:13.8778390Z ##[command]git config --get-all http.proxy
2019-07-18T14:29:13.8922199Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/60966/merge:refs/remotes/pull/60966/merge
---
2019-07-18T14:29:49.0511956Z do so (now or later) by using -b with the checkout command again. Example:
2019-07-18T14:29:49.0511989Z 
2019-07-18T14:29:49.0512240Z   git checkout -b <new-branch-name>
2019-07-18T14:29:49.0512277Z 
2019-07-18T14:29:49.0512328Z HEAD is now at 8b3deec1a Merge 7a73454b38722095374d00ed17cc9fa865c929cf into 21d5b8bf0c26e3ee4c270ce5527df66b1af56513
2019-07-18T14:29:49.0647310Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-07-18T14:29:49.0650759Z ==============================================================================
2019-07-18T14:29:49.0650832Z Task         : Bash
2019-07-18T14:29:49.0650881Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-07-18T15:03:59.3205523Z    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
2019-07-18T15:04:04.6898527Z    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
2019-07-18T15:04:24.6475061Z    Compiling fmt_macros v0.0.0 (/checkout/src/libfmt_macros)
2019-07-18T15:05:52.4067080Z    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
2019-07-18T15:05:56.1052743Z thread 'rustc' panicked at 'Feature `rustc_diagnostic_items` is not declared anywhere', src/libsyntax/feature_gate.rs:1728:21
2019-07-18T15:05:56.2932001Z 
2019-07-18T15:05:56.2937906Z error: internal compiler error: unexpected panic
2019-07-18T15:05:56.2938430Z 
2019-07-18T15:05:56.2938430Z 
2019-07-18T15:05:56.2955449Z note: the compiler unexpectedly panicked. this is a bug.
2019-07-18T15:05:56.2955539Z 
2019-07-18T15:05:56.2958857Z note: we would appreciate a bug report: ***/blob/master/CONTRIBUTING.md#bug-reports
2019-07-18T15:05:56.2958936Z 
2019-07-18T15:05:56.2976982Z note: rustc 1.38.0-dev running on x86_64-unknown-linux-gnu
2019-07-18T15:05:56.2977051Z 
2019-07-18T15:05:56.2977761Z note: compiler flags: -Z unstable-options -Z external-macro-backtrace -Z force-unstable-if-unmarked -C opt-level=2 -C debuginfo=0 -C prefer-dynamic -C debug-assertions=n -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
2019-07-18T15:05:56.2977845Z 
2019-07-18T15:05:56.2977901Z note: some of the compiler flags provided by cargo are hidden
2019-07-18T15:05:56.3078125Z error: Could not compile `rustc`.
2019-07-18T15:05:56.3078497Z warning: build failed, waiting for other jobs to finish...
2019-07-18T15:06:27.5367882Z error: build failed
2019-07-18T15:06:27.5400399Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
2019-07-18T15:06:27.5400399Z command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "2" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
2019-07-18T15:06:27.5400603Z expected success, got: exit code: 101
2019-07-18T15:06:27.5406425Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
2019-07-18T15:06:27.5406561Z Build completed unsuccessfully in 0:30:13
2019-07-18T15:06:28.4703516Z ##[error]Bash exited with code '1'.
2019-07-18T15:06:28.4742760Z ##[section]Starting: Checkout
2019-07-18T15:06:28.4744827Z ==============================================================================
2019-07-18T15:06:28.4744891Z Task         : Get sources
2019-07-18T15:06:28.4744961Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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

This comment has been minimized.

Copy link
Contributor

commented Jul 26, 2019

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

@ProgrammaticNajel

This comment has been minimized.

Copy link

commented Aug 2, 2019

Ping from triage. @Manishearth @eddyb any updates on this?

@JohnTitor

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

Ping from triage: @eddyb do you have time to review this?

@eddyb

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

Wait, why is this assigned to me? @oli-obk can you explain the situation here on IRC?

/// Returns the diagnostic items defined in this crate as well as a separate set of all
/// diagnostic items.
// FIXME: It is illegal to pass a `CrateNum` other than `LOCAL_CRATE` here, just get rid
// of that argument?

This comment has been minimized.

Copy link
@eddyb

eddyb Aug 11, 2019

Member

You shouldn't have multiple queries, but rather distinguish by CrateNum.

src/libcore/fmt/mod.rs Outdated Show resolved Hide resolved
@eddyb

This comment has been minimized.

Copy link
Member

commented Aug 18, 2019

(waiting on @oli-obk for rebase and addressing #60966 (comment))

oli-obk added some commits May 19, 2019

Add a "diagnostic item" scheme
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
Expose both *all* diagnostic items as well as the local ones
This is useful for asking for the `DefId` of a specific diagnostic item instead of checking whether a `DefId` refers to said item.
Make `Debug` not a lang item anymore
And implement fetching `DefId`s for abitrary diagnostic items

@oli-obk oli-obk force-pushed the oli-obk:diagnostic_items branch from 31084c5 to 38d5f8f Aug 21, 2019

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 21, 2019

The job x86_64-gnu-llvm-6.0 of your PR failed (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.
2019-08-21T00:18:21.4886844Z ##[command]git remote add origin https://github.com/rust-lang/rust
2019-08-21T00:18:21.5068347Z ##[command]git config gc.auto 0
2019-08-21T00:18:21.5134685Z ##[command]git config --get-all http.https://github.com/rust-lang/rust.extraheader
2019-08-21T00:18:21.5178948Z ##[command]git config --get-all http.proxy
2019-08-21T00:18:21.5303035Z ##[command]git -c http.extraheader="AUTHORIZATION: basic ***" fetch --force --tags --prune --progress --no-recurse-submodules --depth=2 origin +refs/heads/*:refs/remotes/origin/* +refs/pull/60966/merge:refs/remotes/pull/60966/merge
---
2019-08-21T00:18:56.0285022Z do so (now or later) by using -b with the checkout command again. Example:
2019-08-21T00:18:56.0285283Z 
2019-08-21T00:18:56.0285745Z   git checkout -b <new-branch-name>
2019-08-21T00:18:56.0285995Z 
2019-08-21T00:18:56.0286251Z HEAD is now at b0d10127b Merge 38d5f8fc12b94281ecdb0d12097278585fa361f2 into bea0372a1a7a31b81f28cc4d9a83a2dc9a79d008
2019-08-21T00:18:56.0458138Z ##[section]Starting: Collect CPU-usage statistics in the background
2019-08-21T00:18:56.0461578Z ==============================================================================
2019-08-21T00:18:56.0461647Z Task         : Bash
2019-08-21T00:18:56.0461686Z Description  : Run a Bash script on macOS, Linux, or Windows
---
2019-08-21T00:24:47.5124391Z     Finished release [optimized] target(s) in 1m 19s
2019-08-21T00:24:47.5190230Z tidy check
2019-08-21T00:24:48.2790527Z * 578 error codes
2019-08-21T00:24:48.2790625Z * highest error code: E0733
2019-08-21T00:24:48.5738841Z tidy error: Found 1 features without a gate test.
2019-08-21T00:24:48.5739504Z Expected a gate test for the feature 'rustc_diagnostic_items'.
2019-08-21T00:24:48.5739755Z Hint: create a failing test file named 'feature-gate-rustc_diagnostic_items.rs'
2019-08-21T00:24:48.5739939Z       in the 'ui' test suite, with its failures due to
2019-08-21T00:24:48.5739982Z       missing usage of `#![feature(rustc_diagnostic_items)]`.
2019-08-21T00:24:48.5740203Z Hint: If you already have such a test and don't want to rename it,
2019-08-21T00:24:48.5740413Z       you can also add a // gate-test-rustc_diagnostic_items line to the test file.
2019-08-21T00:24:49.1315819Z some tidy checks failed
2019-08-21T00:24:49.1316958Z 
2019-08-21T00:24:49.1316958Z 
2019-08-21T00:24:49.1317693Z 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"
2019-08-21T00:24:49.1317804Z 
2019-08-21T00:24:49.1317826Z 
2019-08-21T00:24:49.1322253Z failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
2019-08-21T00:24:49.1322323Z Build completed unsuccessfully in 0:01:22
2019-08-21T00:24:49.1322323Z Build completed unsuccessfully in 0:01:22
2019-08-21T00:24:49.1367109Z == clock drift check ==
2019-08-21T00:24:49.1382596Z   local time: Wed Aug 21 00:24:49 UTC 2019
2019-08-21T00:24:49.2724061Z   network time: Wed, 21 Aug 2019 00:24:49 GMT
2019-08-21T00:24:49.2727462Z == end clock drift check ==
2019-08-21T00:24:50.8079491Z ##[error]Bash exited with code '1'.
2019-08-21T00:24:50.8108558Z ##[section]Starting: Checkout
2019-08-21T00:24:50.8109937Z ==============================================================================
2019-08-21T00:24:50.8110000Z Task         : Get sources
2019-08-21T00:24:50.8110037Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.