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

Rollup of bare_trait_objects PRs #52336

Merged
merged 13 commits into from
Jul 27, 2018
Merged

Conversation

ishitatsuyuki
Copy link
Contributor

@ishitatsuyuki ishitatsuyuki commented Jul 13, 2018

All deny attributes were moved into bootstrap so they can be disabled with a line of config.

Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free.

r? @Mark-Simulacrum
cc @ljedrz @kennytm

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 13, 2018
@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@rust-highfive

This comment has been minimized.

@@ -341,7 +342,8 @@ impl Step for Rustfmt {
Mode::ToolRustc,
host,
"test",
"src/tools/rustfmt");
"src/tools/rustfmt",
false);
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't rustfmt an extended tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, my mistake.

@@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.


Copy link
Member

Choose a reason for hiding this comment

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

Stray additional line.

@@ -14,6 +14,7 @@
//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
//! generated instead.


Copy link
Member

Choose a reason for hiding this comment

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

Please remove these stray lines.

@@ -21,7 +21,7 @@ mod imp {
pub fn read2(
out_pipe: ChildStdout,
err_pipe: ChildStderr,
data: &mut FnMut(bool, &mut Vec<u8>, bool),
mut data: impl FnMut(bool, &mut Vec<u8>, bool),
Copy link
Member

Choose a reason for hiding this comment

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

Please don't make semantic changes in this PR. (Easier to review).

@@ -334,7 +334,7 @@ fn get_and_check_lib_features(base_src_path: &Path,
}

fn map_lib_features(base_src_path: &Path,
mf: &mut FnMut(Result<(&str, Feature), &str>, &Path, usize)) {
mf: &mut impl FnMut(Result<(&str, Feature), &str>, &Path, usize)) {
Copy link
Member

Choose a reason for hiding this comment

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

This is a semantic change.

for path in paths {
walk(path, skip, f);
}
}

fn walk(path: &Path, skip: &mut FnMut(&Path) -> bool, f: &mut FnMut(&Path)) {
fn walk(path: &Path, skip: &mut impl FnMut(&Path) -> bool, f: &mut impl FnMut(&Path)) {
Copy link
Member

Choose a reason for hiding this comment

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

Additional semantic changes.

@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.
Testing alloc stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:01:33]    Compiling libc v0.2.42
[01:01:34]    Compiling rand v0.4.2
[01:01:37]    Compiling alloc v0.0.0 (file:///checkout/src/liballoc)
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/arc.rs:21:21
[01:01:38]    |
[01:01:38] 21 |     let mut a: Weak<Any> = a;  // Unsizing
[01:01:38]    |                     ^^^ help: use `dyn`: `dyn Any`
[01:01:38]    |
[01:01:38]    = note: requested on the command line with `-D bare-trait-objects`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/arc.rs:42:16
[01:01:38]    |
[01:01:38] 42 |     let a: Arc<Any> = a;  // Unsizing
[01:01:38]    |                ^^^ help: use `dyn`: `dyn Any`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/arc.rs:52:21
[01:01:38]    |
[01:01:38] 52 |     let mut b: Weak<Any> = b;  // Unsizing
[01:01:38]    |                     ^^^ help: use `dyn`: `dyn Any`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/btree/set.rs:43:58
[01:01:38]    |
[01:01:38] 43 |     where F: FnOnce(&BTreeSet<i32>, &BTreeSet<i32>, &mut FnMut(&i32) -> bool) -> bool
[01:01:38]    |                                                          ^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn FnMut(&i32) -> bool`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/rc.rs:21:21
[01:01:38]    |
[01:01:38] 21 |     let mut a: Weak<Any> = a;  // Unsizing
[01:01:38]    |                     ^^^ help: use `dyn`: `dyn Any`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/rc.rs:42:15
[01:01:38]    |
[01:01:38] 42 |     let a: Rc<Any> = a;  // Unsizing
[01:01:38]    |               ^^^ help: use `dyn`: `dyn Any`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/rc.rs:52:21
[01:01:38]    |
[01:01:38] 52 |     let mut b: Weak<Any> = b;  // Unsizing
[01:01:38]    |                     ^^^ help: use `dyn`: `dyn Any`
[01:01:38] 
[01:01:38] error: trait objects without an explicit `dyn` are deprecated
[01:01:38]   --> liballoc/../liballoc/tests/lib.rs:66:62
[01:01:38]    |
[01:01:38] 66 |     let mut hasher_2 = Box::new(DefaultHasher::new()) as Box<Hasher>;
[01:01:38]    |                                                              ^^^^^^ help: use `dyn`: `dyn Hasher`
[01:01:44] error: aborting due to 8 previous errors
[01:01:44] 
[01:01:44] error: Could not compile `alloc`.
[01:01:44] warning: build failed, waiting for other jobs to finish...
[01:01:44] warning: build failed, waiting for other jobs to finish...
[01:01:47] error: build failed
[01:01:47] 
[01:01:47] 
[01:01:47] 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 jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "alloc" "--" "--quiet"
[01:01:47] 
[01:01:47] 
[01:01:47] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:47] Build completed unsuccessfully in 0:16:50
[01:01:47] Build completed unsuccessfully in 0:16:50
[01:01:47] make: *** [check] Error 1
[01:01:47] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1cb1cbf0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:1b605448:start=1531484051280120099,finish=1531484051285410859,duration=5290760
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02b46c28
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0a697203
$ 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 Jul 13, 2018

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

@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:59:17] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:59:17]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:20:29
[00:59:20]    |
[00:59:20] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[00:59:20]    |                             ^^^ help: use `dyn`: `dyn Any`
[00:59:20]    |
[00:59:20]    = note: requested on the command line with `-D bare-trait-objects`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:20:44
[00:59:20]    |
[00:59:20] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[00:59:20]    |                                            ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:20:59
[00:59:20]    |
[00:59:20] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[00:59:20]    |                                                           ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:37:41
[00:59:20]    |
[00:59:20] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[00:59:20]    |                                         ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:37:63
[00:59:20]    |
[00:59:20] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[00:59:20]    |                                                               ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:37:85
[00:59:20]    |
[00:59:20] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[00:59:20]    |                                                                                     ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:54:26
[00:59:20]    |
[00:59:20] 54 |     let a = &5_usize as &Any;
[00:59:20]    |                          ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:72:30
[00:59:20]    |
[00:59:20] 72 |     let a_r = &mut a as &mut Any;
[00:59:20]    |                              ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/any.rs:74:27
[00:59:20]    |
[00:59:20] 74 |     let b_r = tmp as &mut Any;
[00:59:20]    |                           ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/any.rs:116:26
[00:59:20]     |
[00:59:20] 116 |     let test = &test as &Any;
[00:59:20]     |                          ^^^ help: use `dyn`: `dyn Any`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]     |
[00:59:20]     |
[00:59:20] 131 |         let mut indirect_hasher: &mut Hasher = &mut hasher;
[00:59:20]     |                                       ^^^^^^ help: use `dyn`: `dyn Hasher`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    |
[00:59:20]    |
[00:59:20] 25 |     struct X(str); struct Y(Z + 'static);
[00:59:20]    |                             ^^^^^^^^^^^ help: use `dyn`: `dyn Z + 'static`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/mem.rs:112:33
[00:59:20]     |
[00:59:20] 112 |     let a = box 100isize as Box<Foo>;
[00:59:20]     |                                 ^^^ help: use `dyn`: `dyn Foo`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/mem.rs:116:21
[00:59:20]     |
[00:59:20] 116 |         let _x: Box<Foo> = transmute(x);
[00:59:20]     |                     ^^^ help: use `dyn`: `dyn Foo`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]     |
[00:59:20]     |
[00:59:20] 243 |     let mut functions: [Box<Fn() -> Option<()>>; 3] =
[00:59:20]     |                             ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> Option<()>`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/ptr.rs:87:20
[00:59:20]    |
[00:59:20] 87 |     let ci: *const ToString = &3;
[00:59:20]    |                    ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/ptr.rs:90:18
[00:59:20]    |
[00:59:20] 90 |     let mi: *mut ToString = &mut 3;
[00:59:20]    |                  ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/ptr.rs:93:21
[00:59:20]    |
[00:59:20] 93 |     let nci: *const ToString = null::<isize>();
[00:59:20]    |                     ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]   --> libcore/../libcore/tests/ptr.rs:96:19
[00:59:20]    |
[00:59:20] 96 |     let nmi: *mut ToString = null_mut::<isize>();
[00:59:20]    |                   ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:143:24
[00:59:20]     |
[00:59:20] 143 |         let ci: *const ToString = &3;
[00:59:20]     |                        ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:146:22
[00:59:20]     |
[00:59:20] 146 |         let mi: *mut ToString = &mut 3;
[00:59:20]     |                      ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:149:25
[00:59:20]     |
[00:59:20] 149 |         let nci: *const ToString = null::<isize>();
[00:59:20]     |                         ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:152:23
[00:59:20]     |
[00:59:20] 152 |         let nmi: *mut ToString = null_mut::<isize>();
[00:59:20]     |                       ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:185:22
[00:59:20]     |
[00:59:20] 185 |         let mi: *mut ToString = &mut 3;
[00:59:20]     |                      ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    --> libcore/../libcore/tests/ptr.rs:188:23
[00:59:20]     |
[00:59:20] 188 |         let nmi: *mut ToString = null_mut::<isize>();
[00:59:20]     |                       ^^^^^^^^ help: use `dyn`: `dyn ToString`
[00:59:20] 
[00:59:20] error: trait objects without an explicit `dyn` are deprecated
[00:59:20]    |
[00:59:20]    |
[00:59:20] 84 |     let mut functions: [Box<Fn() -> Result<(), isize>>; 3] =
[00:59:20]    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> Result<(), isize>`
[00:59:30] error: aborting due to 26 previous errors
[00:59:30] 
[00:59:30] error: Could not compile `core`.
[00:59:30] 
[00:59:30] 
[00:59:30] To learn more, run the command again with --verbose.
[00:59:30] 
[00:59:30] 
[00:59:30] 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 jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[00:59:30] 
[00:59:30] 
[00:59:30] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:59:30] Build completed unsuccessfully in 0:17:15
[00:59:30] Build completed unsuccessfully in 0:17:15
[00:59:30] Makefile:58: recipe for target 'check' failed
[00:59:30] make: *** [check] Error 1
129508 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release
123072 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps
122496 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/x86_64-unknown-linux-gnu/release/deps
116144 ./obj/build/x86_64-unknown-linux-gnu/test/mir-opt
---
travis_time:end:2f166500:start=1531543090945426092,finish=1531543091067797839,duration=122371747
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:273cebf2
$ 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:2e552984
$ 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)

@kennytm kennytm 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 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.
[01:03:50] travis_fold:start:test_stage1-core
travis_time:start:test_stage1-core
Testing core stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:03:50]    Compiling core v0.0.0 (file:///checkout/src/libcore)
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:20:29
[01:03:53]    |
[01:03:53] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[01:03:53]    |                             ^^^ help: use `dyn`: `dyn Any`
[01:03:53]    |
[01:03:53]    = note: `-D bare-trait-objects` implied by `-D warnings`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:20:44
[01:03:53]    |
[01:03:53] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[01:03:53]    |                                            ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:20:59
[01:03:53]    |
[01:03:53] 20 |     let (a, b, c) = (&5 as &Any, &TEST as &Any, &Test as &Any);
[01:03:53]    |                                                           ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:37:41
[01:03:53]    |
[01:03:53] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[01:03:53]    |                                         ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:37:63
[01:03:53]    |
[01:03:53] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[01:03:53]    |                                                               ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:37:85
[01:03:53]    |
[01:03:53] 37 |     let (a, b, c) = (box 5_usize as Box<Any>, box TEST as Box<Any>, box Test as Box<Any>);
[01:03:53]    |                                                                                     ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:54:26
[01:03:53]    |
[01:03:53] 54 |     let a = &5_usize as &Any;
[01:03:53]    |                          ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:72:30
[01:03:53]    |
[01:03:53] 72 |     let a_r = &mut a as &mut Any;
[01:03:53]    |                              ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/any.rs:74:27
[01:03:53]    |
[01:03:53] 74 |     let b_r = tmp as &mut Any;
[01:03:53]    |                           ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/any.rs:116:26
[01:03:53]     |
[01:03:53] 116 |     let test = &test as &Any;
[01:03:53]     |                          ^^^ help: use `dyn`: `dyn Any`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]     |
[01:03:53]     |
[01:03:53] 131 |         let mut indirect_hasher: &mut Hasher = &mut hasher;
[01:03:53]     |                                       ^^^^^^ help: use `dyn`: `dyn Hasher`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    |
[01:03:53]    |
[01:03:53] 25 |     struct X(str); struct Y(Z + 'static);
[01:03:53]    |                             ^^^^^^^^^^^ help: use `dyn`: `dyn Z + 'static`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/mem.rs:112:33
[01:03:53]     |
[01:03:53] 112 |     let a = box 100isize as Box<Foo>;
[01:03:53]     |                                 ^^^ help: use `dyn`: `dyn Foo`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/mem.rs:116:21
[01:03:53]     |
[01:03:53] 116 |         let _x: Box<Foo> = transmute(x);
[01:03:53]     |                     ^^^ help: use `dyn`: `dyn Foo`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]     |
[01:03:53]     |
[01:03:53] 243 |     let mut functions: [Box<Fn() -> Option<()>>; 3] =
[01:03:53]     |                             ^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> Option<()>`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/ptr.rs:87:20
[01:03:53]    |
[01:03:53] 87 |     let ci: *const ToString = &3;
[01:03:53]    |                    ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/ptr.rs:90:18
[01:03:53]    |
[01:03:53] 90 |     let mi: *mut ToString = &mut 3;
[01:03:53]    |                  ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/ptr.rs:93:21
[01:03:53]    |
[01:03:53] 93 |     let nci: *const ToString = null::<isize>();
[01:03:53]    |                     ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]   --> libcore/../libcore/tests/ptr.rs:96:19
[01:03:53]    |
[01:03:53] 96 |     let nmi: *mut ToString = null_mut::<isize>();
[01:03:53]    |                   ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:143:24
[01:03:53]     |
[01:03:53] 143 |         let ci: *const ToString = &3;
[01:03:53]     |                        ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:146:22
[01:03:53]     |
[01:03:53] 146 |         let mi: *mut ToString = &mut 3;
[01:03:53]     |                      ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:149:25
[01:03:53]     |
[01:03:53] 149 |         let nci: *const ToString = null::<isize>();
[01:03:53]     |                         ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:152:23
[01:03:53]     |
[01:03:53] 152 |         let nmi: *mut ToString = null_mut::<isize>();
[01:03:53]     |                       ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:185:22
[01:03:53]     |
[01:03:53] 185 |         let mi: *mut ToString = &mut 3;
[01:03:53]     |                      ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    --> libcore/../libcore/tests/ptr.rs:188:23
[01:03:53]     |
[01:03:53] 188 |         let nmi: *mut ToString = null_mut::<isize>();
[01:03:53]     |                       ^^^^^^^^ help: use `dyn`: `dyn ToString`
[01:03:53] 
[01:03:53] error: trait objects without an explicit `dyn` are deprecated
[01:03:53]    |
[01:03:53]    |
[01:03:53] 84 |     let mut functions: [Box<Fn() -> Result<(), isize>>; 3] =
[01:03:53]    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Fn() -> Result<(), isize>`
[01:04:05] error: aborting due to 26 previous errors
[01:04:05] 
[01:04:05] error: Could not compile `core`.
[01:04:05] 
[01:04:05] 
[01:04:05] To learn more, run the command again with --verbose.
[01:04:05] 
[01:04:05] 
[01:04:05] 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 jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "core" "--" "--quiet"
[01:04:05] 
[01:04:05] 
[01:04:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:04:05] Build completed unsuccessfully in 0:18:32
[01:04:05] Build completed unsuccessfully in 0:18:32
[01:04:05] make: *** [check] Error 1
[01:04:05] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:09483ae0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:06875a14:start=1531559483544392419,finish=1531559483552747059,duration=8354640
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0471dac8
$ 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 -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:0d5be610
travis_time:start:0d5be610
$ 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:0029e4f6
$ 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)

@ishitatsuyuki ishitatsuyuki force-pushed the dyn-rollup branch 2 times, most recently from 0c233b0 to 340f524 Compare July 15, 2018 13:45
@ishitatsuyuki ishitatsuyuki added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 15, 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.

[00:03:59] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:00] tidy error: /checkout/src/libcore/tests/any.rs:37: line longer than 100 chars
[00:04:01] some tidy checks failed
[00:04:01] 
[00:04:01] 
[00:04:01] 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:04:01] 
[00:04:01] 
[00:04:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:01] Build completed unsuccessfully in 0:00:50
[00:04:01] Build completed unsuccessfully in 0:00:50
[00:04:01] Makefile:79: recipe for target 'tidy' failed
[00:04:01] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:261e5b30
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:11b20c42:start=1531662733199518595,finish=1531662733209470564,duration=9951969
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:15d56108
$ 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 -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:358bd968
travis_time:start:358bd968
$ 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:03b2ae48
$ 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)

@ishitatsuyuki ishitatsuyuki 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 15, 2018
@ishitatsuyuki
Copy link
Contributor Author

r? @Mark-Simulacrum

@ishitatsuyuki ishitatsuyuki added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 16, 2018
@kennytm
Copy link
Member

kennytm commented Jul 25, 2018

Hmm I'm not familiar with this part of code (a89f8e1). r? @Mark-Simulacrum

@@ -246,7 +247,7 @@ pub fn prepare_tool_cargo(
target: Interned<String>,
command: &'static str,
path: &'static str,
is_ext_tool: bool,
is_external_tool: bool,
Copy link
Member

Choose a reason for hiding this comment

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

Can you make this bool an enum instead? Every time I've gone to review this PR I've had to look up what the true/false here means; it'd be good to have an enum ExternalTool { Yes, No } with the variants documented as to when to use which.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, having an enum just representing a bool sounds like tautology. Should I just add a doc comment instead?

Copy link
Member

Choose a reason for hiding this comment

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

Enums representing bools are a common an excellent design pattern; the doc comment wouldn't help because the problem is at call sites, not here.

Copy link
Member

Choose a reason for hiding this comment

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

If you dislike Yes, No you could make it enum Tool { Normal, External, OptionalExternal }

@Mark-Simulacrum
Copy link
Member

GH has marked the review as outdated but I did in fact mean to leave that comment on the PR today (#52336 (comment)). a89f8e1 looks reasonable.

@ishitatsuyuki
Copy link
Contributor Author

r? @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

Can you rebase this such as to squash 560d807, b29a6fb, 1915cd1, 7407a78, 72e2c00, 8646a17, 66c4dc9, c6d2844 together? Those are all commits just adding dyn and there's no reason for them to be separate, especially as some of them are just fixes to others.

Also, if you can squash the tool-related fixes to rustbuild together that would be good too.

@Mark-Simulacrum Mark-Simulacrum 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-review Status: Awaiting review from the assignee but also interested parties. labels Jul 26, 2018
@ishitatsuyuki
Copy link
Contributor Author

@Mark-Simulacrum These are commits from the PR that I roll up merged. Squashing them will make it lose track of author and the ability to auto close the corresponding PR. See previous discussion.

I'm on a trip until next Tuesday; will not be able to push until then.

@Mark-Simulacrum
Copy link
Member

@bors r+

Let's just get this landed.

@bors
Copy link
Contributor

bors commented Jul 27, 2018

📌 Commit 62f73dc has been approved by Mark-Simulacrum

@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 Jul 27, 2018
@pietroalbini
Copy link
Member

@bors p=1 (high chance of code rot)

@bors
Copy link
Contributor

bors commented Jul 27, 2018

⌛ Testing commit 62f73dc with merge 4f1e235...

bors added a commit that referenced this pull request Jul 27, 2018
Rollup of bare_trait_objects PRs

All deny attributes were moved into bootstrap so they can be disabled with a line of config.

Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free.

r? @Mark-Simulacrum
cc @ljedrz @kennytm
@bors
Copy link
Contributor

bors commented Jul 27, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: Mark-Simulacrum
Pushing 4f1e235 to master...

@bors bors merged commit 62f73dc into rust-lang:master Jul 27, 2018
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 13, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 13, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 13, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 13, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 14, 2020
…-Simulacrum

Fix caching issue when building tools.

This fixes a problem with tool builds not being cached properly.

rust-lang#73297 changed it so that Clippy will participate in the "deny warnings" setting. Unfortunately this causes a problem because Clippy shares the build directory with other tools which do not participate in "deny warnings".  Because Cargo does not independently cache artifacts based on different RUSTFLAGS settings, it causes all the shared dependencies to get rebuilt if Clippy ever gets built.

The solution here is to stop using RUSTFLAGS, and just sneak the settings in through the rustc wrapper. Cargo won't know about the different settings, so it will not bust the cache. This should be safe since lint settings on dependencies are ignored. This is how things used to work in the past before rust-lang#64316.

Alternate solutions:
* Treat Clippy as a "submodule" and don't enforce warnings on it. This was the behavior before rust-lang#73297. The consequence is that if a warning sneaks into clippy, that the clippy maintainers will need to fix it when they sync clippy back to the clippy repo.
* Just deny warnings on all tools (removing the in-tree/submodule distinction). This is tempting, but with some issues (cc rust-lang#52336):
  * Adding or changing warnings in rustc can be difficult to land because tools have to be updated if they trip the warning. In practice, this isn't too bad.  Cargo (and rustfmt) already runs with `deny(warnings)`, so this has been the de-facto standard already (although they do not use the extra lints like `unused_lifetimes`).
* Teach Cargo to add flags to the workspace members, but not dependencies.
* Teach Cargo to add flags without fingerprinting them?
* Teach Cargo to independently cache different RUSTFLAGS artifacts (this was [reverted](rust-lang/cargo#7417) due to complications). This would also unnecessarily rebuild dependencies, but would avoid cache thrashing.
* Teach Cargo about lint settings.

Closes rust-lang#74016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup 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.

8 participants