From 04a7fefb20629af52d00018ac7013257eb661273 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sun, 31 Jul 2022 22:00:53 +0300 Subject: [PATCH 01/21] linker: Update some outdated comments --- compiler/rustc_codegen_ssa/src/back/link.rs | 24 +++++++++---------- .../rustc_codegen_ssa/src/back/metadata.rs | 12 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 13a7b6be947ec..8cd2ba548648d 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1947,7 +1947,6 @@ fn linker_with_args<'a>( // Upstream rust libraries are not supposed to depend on our local native // libraries as that would violate the structure of the DAG, in that // scenario they are required to link to them as well in a shared fashion. - // (The current implementation still doesn't prevent it though, see the FIXME below.) // // Note that upstream rust libraries may contain native dependencies as // well, but they also can't depend on what we just started to add to the @@ -1968,15 +1967,16 @@ fn linker_with_args<'a>( // and move this option back to the top. cmd.add_as_needed(); - // FIXME: Move this below to other native libraries - // (or alternatively link all native libraries after their respective crates). - // This change is somewhat breaking in practice due to local static libraries being linked - // as whole-archive (#85144), so removing whole-archive may be a pre-requisite. + // Local native libraries of all kinds. + // + // If `-Zlink-native-libraries=false` is set, then the assumption is that an + // external build system already has the native dependencies defined, and it + // will provide them to the linker itself. if sess.opts.unstable_opts.link_native_libraries { add_local_native_libraries(cmd, sess, codegen_results); } - // Upstream rust libraries and their non-bundled static libraries + // Upstream rust libraries and their (possibly bundled) static native libraries. add_upstream_rust_crates( cmd, sess, @@ -1986,11 +1986,11 @@ fn linker_with_args<'a>( tmpdir, ); - // Upstream dynamic native libraries linked with `#[link]` attributes at and `-l` - // command line options. - // If -Zlink-native-libraries=false is set, then the assumption is that an - // external build system already has the native dependencies defined, and it - // will provide them to the linker itself. + // Dynamic native libraries from upstream crates. + // + // FIXME: Merge this to `add_upstream_rust_crates` so that all native libraries are linked + // together with their respective upstream crates, and in their originally specified order. + // This may be slightly breaking due to our use of `--as-needed` and needs a crater run. if sess.opts.unstable_opts.link_native_libraries { add_upstream_native_libraries(cmd, sess, codegen_results); } @@ -2401,7 +2401,7 @@ fn add_upstream_rust_crates<'a>( // or is an rlib already included via some other dylib crate, the symbols from // native libs will have already been included in that dylib. // - // If -Zlink-native-libraries=false is set, then the assumption is that an + // If `-Zlink-native-libraries=false` is set, then the assumption is that an // external build system already has the native dependencies defined, and it // will provide them to the linker itself. if sess.opts.unstable_opts.link_native_libraries { diff --git a/compiler/rustc_codegen_ssa/src/back/metadata.rs b/compiler/rustc_codegen_ssa/src/back/metadata.rs index 0302c28815ab8..b92e146bee2af 100644 --- a/compiler/rustc_codegen_ssa/src/back/metadata.rs +++ b/compiler/rustc_codegen_ssa/src/back/metadata.rs @@ -187,12 +187,12 @@ pub enum MetadataPosition { Last, } -// For rlibs we "pack" rustc metadata into a dummy object file. When rustc -// creates a dylib crate type it will pass `--whole-archive` (or the -// platform equivalent) to include all object files from an rlib into the -// final dylib itself. This causes linkers to iterate and try to include all -// files located in an archive, so if metadata is stored in an archive then -// it needs to be of a form that the linker will be able to process. +// For rlibs we "pack" rustc metadata into a dummy object file. +// +// Historically it was needed because rustc linked rlibs as whole-archive in some cases. +// In that case linkers try to include all files located in an archive, so if metadata is stored +// in an archive then it needs to be of a form that the linker is able to process. +// Now it's not clear whether metadata still needs to be wrapped into an object file or not. // // Note, though, that we don't actually want this metadata to show up in any // final output of the compiler. Instead this is purely for rustc's own From 7680c8b69051536a9c4ebcf943b394526af1a1be Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 6 Aug 2022 19:50:01 -0700 Subject: [PATCH 02/21] Properly forward `ByRefSized::fold` to the inner iterator --- .../core/src/iter/adapters/by_ref_sized.rs | 29 +++++++++++-------- .../core/tests/iter/adapters/by_ref_sized.rs | 20 +++++++++++++ library/core/tests/iter/adapters/mod.rs | 1 + 3 files changed, 38 insertions(+), 12 deletions(-) create mode 100644 library/core/tests/iter/adapters/by_ref_sized.rs diff --git a/library/core/src/iter/adapters/by_ref_sized.rs b/library/core/src/iter/adapters/by_ref_sized.rs index cc1e8e8a27fa6..477e7117c3ea1 100644 --- a/library/core/src/iter/adapters/by_ref_sized.rs +++ b/library/core/src/iter/adapters/by_ref_sized.rs @@ -1,4 +1,4 @@ -use crate::ops::Try; +use crate::ops::{NeverShortCircuit, Try}; /// Like `Iterator::by_ref`, but requiring `Sized` so it can forward generics. /// @@ -8,28 +8,31 @@ use crate::ops::Try; #[derive(Debug)] pub struct ByRefSized<'a, I>(pub &'a mut I); +// The following implementations use UFCS-style, rather than trusting autoderef, +// to avoid accidentally calling the `&mut Iterator` implementations. + #[unstable(feature = "std_internals", issue = "none")] impl Iterator for ByRefSized<'_, I> { type Item = I::Item; #[inline] fn next(&mut self) -> Option { - self.0.next() + I::next(self.0) } #[inline] fn size_hint(&self) -> (usize, Option) { - self.0.size_hint() + I::size_hint(self.0) } #[inline] fn advance_by(&mut self, n: usize) -> Result<(), usize> { - self.0.advance_by(n) + I::advance_by(self.0, n) } #[inline] fn nth(&mut self, n: usize) -> Option { - self.0.nth(n) + I::nth(self.0, n) } #[inline] @@ -37,7 +40,8 @@ impl Iterator for ByRefSized<'_, I> { where F: FnMut(B, Self::Item) -> B, { - self.0.fold(init, f) + // `fold` needs ownership, so this can't forward directly. + I::try_fold(self.0, init, NeverShortCircuit::wrap_mut_2(f)).0 } #[inline] @@ -46,7 +50,7 @@ impl Iterator for ByRefSized<'_, I> { F: FnMut(B, Self::Item) -> R, R: Try, { - self.0.try_fold(init, f) + I::try_fold(self.0, init, f) } } @@ -54,17 +58,17 @@ impl Iterator for ByRefSized<'_, I> { impl DoubleEndedIterator for ByRefSized<'_, I> { #[inline] fn next_back(&mut self) -> Option { - self.0.next_back() + I::next_back(self.0) } #[inline] fn advance_back_by(&mut self, n: usize) -> Result<(), usize> { - self.0.advance_back_by(n) + I::advance_back_by(self.0, n) } #[inline] fn nth_back(&mut self, n: usize) -> Option { - self.0.nth_back(n) + I::nth_back(self.0, n) } #[inline] @@ -72,7 +76,8 @@ impl DoubleEndedIterator for ByRefSized<'_, I> { where F: FnMut(B, Self::Item) -> B, { - self.0.rfold(init, f) + // `rfold` needs ownership, so this can't forward directly. + I::try_rfold(self.0, init, NeverShortCircuit::wrap_mut_2(f)).0 } #[inline] @@ -81,6 +86,6 @@ impl DoubleEndedIterator for ByRefSized<'_, I> { F: FnMut(B, Self::Item) -> R, R: Try, { - self.0.try_rfold(init, f) + I::try_rfold(self.0, init, f) } } diff --git a/library/core/tests/iter/adapters/by_ref_sized.rs b/library/core/tests/iter/adapters/by_ref_sized.rs new file mode 100644 index 0000000000000..a9c066f0e8cb1 --- /dev/null +++ b/library/core/tests/iter/adapters/by_ref_sized.rs @@ -0,0 +1,20 @@ +use core::iter::*; + +#[test] +fn test_iterator_by_ref_sized() { + let a = ['a', 'b', 'c', 'd']; + + let mut s = String::from("Z"); + let mut it = a.iter().copied(); + ByRefSized(&mut it).take(2).for_each(|x| s.push(x)); + assert_eq!(s, "Zab"); + ByRefSized(&mut it).fold((), |(), x| s.push(x)); + assert_eq!(s, "Zabcd"); + + let mut s = String::from("Z"); + let mut it = a.iter().copied(); + ByRefSized(&mut it).rev().take(2).for_each(|x| s.push(x)); + assert_eq!(s, "Zdc"); + ByRefSized(&mut it).rfold((), |(), x| s.push(x)); + assert_eq!(s, "Zdcba"); +} diff --git a/library/core/tests/iter/adapters/mod.rs b/library/core/tests/iter/adapters/mod.rs index 96539c0c394e2..ffd5f3857aea4 100644 --- a/library/core/tests/iter/adapters/mod.rs +++ b/library/core/tests/iter/adapters/mod.rs @@ -1,4 +1,5 @@ mod array_chunks; +mod by_ref_sized; mod chain; mod cloned; mod copied; From acca4b8f86b1cf7b41236225247b884f6a52d708 Mon Sep 17 00:00:00 2001 From: Isaac Cloos Date: Sun, 21 Aug 2022 15:28:27 -0400 Subject: [PATCH 03/21] Extra documentation for new formatting feature High traffic macros should detail this helpful addition. --- library/alloc/src/macros.rs | 2 ++ library/std/src/macros.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/library/alloc/src/macros.rs b/library/alloc/src/macros.rs index 88eb6aa7a83c1..5198bf297d925 100644 --- a/library/alloc/src/macros.rs +++ b/library/alloc/src/macros.rs @@ -107,6 +107,8 @@ macro_rules! vec { /// format!("test"); /// format!("hello {}", "world!"); /// format!("x = {}, y = {y}", 10, y = 30); +/// let (x, y) = (1, 2); +/// format!("{x} + {y} = 3"); /// ``` #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] diff --git a/library/std/src/macros.rs b/library/std/src/macros.rs index 0cb21ef53b1eb..ce2a979475c9c 100644 --- a/library/std/src/macros.rs +++ b/library/std/src/macros.rs @@ -93,6 +93,8 @@ macro_rules! print { /// println!(); // prints just a newline /// println!("hello there!"); /// println!("format {} arguments", "some"); +/// let local_variable = "some"; +/// println!("format {local_variable} arguments"); /// ``` #[macro_export] #[stable(feature = "rust1", since = "1.0.0")] From 000dc8022129474a70f3ddb2635fa125f865abdf Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Mon, 22 Aug 2022 18:12:18 +0900 Subject: [PATCH 04/21] make some methods private --- compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs | 3 ++- compiler/rustc_resolve/src/late/diagnostics.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs index 72aee0267ac1e..4c5b32490a603 100644 --- a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs +++ b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs @@ -273,7 +273,8 @@ impl<'tcx> BorrowExplanation<'tcx> { _ => {} } } - pub(crate) fn add_lifetime_bound_suggestion_to_diagnostic( + + fn add_lifetime_bound_suggestion_to_diagnostic( &self, err: &mut Diagnostic, category: &ConstraintCategory<'tcx>, diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 4175527da470c..b545b9793915f 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2180,7 +2180,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { err.emit() } - pub(crate) fn add_missing_lifetime_specifiers_label( + fn add_missing_lifetime_specifiers_label( &mut self, err: &mut Diagnostic, lifetime_refs: Vec, From ba74a628adfa70be5b13b6588715f0d5abd1bd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 23 Aug 2022 00:00:00 +0000 Subject: [PATCH 05/21] Diagnose missing includes in run-make tests --- src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile | 2 +- src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile | 2 +- .../run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile | 2 +- .../run-make-fulldeps/allow-warnings-cmdline-stability/Makefile | 2 +- src/test/run-make-fulldeps/archive-duplicate-names/Makefile | 2 +- src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile | 2 +- src/test/run-make-fulldeps/atomic-lock-free/Makefile | 2 +- src/test/run-make-fulldeps/bare-outfile/Makefile | 2 +- src/test/run-make-fulldeps/c-dynamic-dylib/Makefile | 2 +- src/test/run-make-fulldeps/c-dynamic-rlib/Makefile | 2 +- src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile | 2 +- src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile | 2 +- src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile | 2 +- src/test/run-make-fulldeps/c-static-dylib/Makefile | 2 +- src/test/run-make-fulldeps/c-static-rlib/Makefile | 2 +- .../run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile | 2 +- src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile | 2 +- src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile | 2 +- src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile | 2 +- src/test/run-make-fulldeps/codegen-options-parsing/Makefile | 2 +- src/test/run-make-fulldeps/compile-stdin/Makefile | 2 +- src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile | 2 +- src/test/run-make-fulldeps/compiler-lookup-paths/Makefile | 2 +- src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile | 2 +- src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile | 2 +- src/test/run-make-fulldeps/crate-data-smoke/Makefile | 2 +- src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile | 2 +- src/test/run-make-fulldeps/crate-name-priority/Makefile | 2 +- src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile | 2 +- .../run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile | 2 +- .../run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile | 2 +- src/test/run-make-fulldeps/cross-lang-lto/Makefile | 2 +- src/test/run-make-fulldeps/debug-assertions/Makefile | 2 +- src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile | 2 +- src/test/run-make-fulldeps/dep-info-spaces/Makefile | 2 +- src/test/run-make-fulldeps/dep-info/Makefile | 2 +- src/test/run-make-fulldeps/dylib-chain/Makefile | 2 +- src/test/run-make-fulldeps/emit-stack-sizes/Makefile | 2 +- src/test/run-make-fulldeps/emit/Makefile | 2 +- .../error-found-staticlib-instead-crate/Makefile | 2 +- src/test/run-make-fulldeps/error-writing-dependencies/Makefile | 2 +- src/test/run-make-fulldeps/exit-code/Makefile | 2 +- src/test/run-make-fulldeps/extern-diff-internal-name/Makefile | 2 +- src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile | 2 +- src/test/run-make-fulldeps/extern-flag-fun/Makefile | 2 +- src/test/run-make-fulldeps/extern-flag-pathless/Makefile | 2 +- .../run-make-fulldeps/extern-flag-rename-transitive/Makefile | 2 +- src/test/run-make-fulldeps/extern-fn-generic/Makefile | 2 +- src/test/run-make-fulldeps/extern-fn-mangle/Makefile | 2 +- src/test/run-make-fulldeps/extern-fn-reachable/Makefile | 2 +- .../run-make-fulldeps/extern-fn-struct-passing-abi/Makefile | 2 +- src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile | 2 +- .../run-make-fulldeps/extern-fn-with-packed-struct/Makefile | 2 +- src/test/run-make-fulldeps/extern-fn-with-union/Makefile | 2 +- src/test/run-make-fulldeps/extern-multiple-copies/Makefile | 2 +- src/test/run-make-fulldeps/extern-multiple-copies2/Makefile | 2 +- .../run-make-fulldeps/extern-overrides-distribution/Makefile | 2 +- .../run-make-fulldeps/extra-filename-with-temp-outputs/Makefile | 2 +- src/test/run-make-fulldeps/foreign-double-unwind/Makefile | 2 +- src/test/run-make-fulldeps/foreign-exceptions/Makefile | 2 +- src/test/run-make-fulldeps/fpic/Makefile | 2 +- src/test/run-make-fulldeps/glibc-staticlib-args/Makefile | 2 +- src/test/run-make-fulldeps/hir-tree/Makefile | 2 +- src/test/run-make-fulldeps/include_bytes_deps/Makefile | 2 +- src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile | 2 +- src/test/run-make-fulldeps/inline-always-many-cgu/Makefile | 2 +- src/test/run-make-fulldeps/interdependent-c-libraries/Makefile | 2 +- src/test/run-make-fulldeps/intrinsic-unreachable/Makefile | 2 +- src/test/run-make-fulldeps/invalid-library/Makefile | 2 +- src/test/run-make-fulldeps/invalid-staticlib/Makefile | 2 +- src/test/run-make-fulldeps/issue-11908/Makefile | 2 +- src/test/run-make-fulldeps/issue-14500/Makefile | 2 +- src/test/run-make-fulldeps/issue-14698/Makefile | 2 +- src/test/run-make-fulldeps/issue-15460/Makefile | 2 +- src/test/run-make-fulldeps/issue-18943/Makefile | 2 +- src/test/run-make-fulldeps/issue-19371/Makefile | 2 +- src/test/run-make-fulldeps/issue-20626/Makefile | 2 +- src/test/run-make-fulldeps/issue-22131/Makefile | 2 +- src/test/run-make-fulldeps/issue-24445/Makefile | 2 +- src/test/run-make-fulldeps/issue-25581/Makefile | 2 +- src/test/run-make-fulldeps/issue-26006/Makefile | 2 +- src/test/run-make-fulldeps/issue-26092/Makefile | 2 +- src/test/run-make-fulldeps/issue-28595/Makefile | 2 +- src/test/run-make-fulldeps/issue-28766/Makefile | 2 +- src/test/run-make-fulldeps/issue-30063/Makefile | 2 +- src/test/run-make-fulldeps/issue-33329/Makefile | 2 +- src/test/run-make-fulldeps/issue-35164/Makefile | 2 +- src/test/run-make-fulldeps/issue-37839/Makefile | 2 +- src/test/run-make-fulldeps/issue-37893/Makefile | 2 +- src/test/run-make-fulldeps/issue-38237/Makefile | 2 +- src/test/run-make-fulldeps/issue-40535/Makefile | 2 +- src/test/run-make-fulldeps/issue-46239/Makefile | 2 +- src/test/run-make-fulldeps/issue-47551/Makefile | 2 +- src/test/run-make-fulldeps/issue-51671/Makefile | 2 +- src/test/run-make-fulldeps/issue-53964/Makefile | 2 +- src/test/run-make-fulldeps/issue-64153/Makefile | 2 +- .../issue-68794-textrel-on-minimal-lib/Makefile | 2 +- src/test/run-make-fulldeps/issue-69368/Makefile | 2 +- src/test/run-make-fulldeps/issue-7349/Makefile | 2 +- .../run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile | 2 +- src/test/run-make-fulldeps/issue64319/Makefile | 2 +- src/test/run-make-fulldeps/issues-41478-43796/Makefile | 2 +- src/test/run-make-fulldeps/libs-through-symlinks/Makefile | 2 +- src/test/run-make-fulldeps/libtest-json/Makefile | 2 +- src/test/run-make-fulldeps/link-arg/Makefile | 2 +- src/test/run-make-fulldeps/link-args-order/Makefile | 2 +- src/test/run-make-fulldeps/link-cfg/Makefile | 2 +- src/test/run-make-fulldeps/link-dedup/Makefile | 2 +- src/test/run-make-fulldeps/link-path-order/Makefile | 2 +- src/test/run-make-fulldeps/linkage-attr-on-static/Makefile | 2 +- .../long-linker-command-lines-cmd-exe/Makefile | 2 +- src/test/run-make-fulldeps/long-linker-command-lines/Makefile | 2 +- src/test/run-make-fulldeps/longjmp-across-rust/Makefile | 2 +- src/test/run-make-fulldeps/ls-metadata/Makefile | 2 +- src/test/run-make-fulldeps/lto-dylib-dep/Makefile | 2 +- src/test/run-make-fulldeps/lto-empty/Makefile | 2 +- src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile | 2 +- src/test/run-make-fulldeps/lto-readonly-lib/Makefile | 2 +- src/test/run-make-fulldeps/lto-smoke-c/Makefile | 2 +- src/test/run-make-fulldeps/lto-smoke/Makefile | 2 +- src/test/run-make-fulldeps/manual-crate-name/Makefile | 2 +- src/test/run-make-fulldeps/manual-link/Makefile | 2 +- src/test/run-make-fulldeps/many-crates-but-no-match/Makefile | 2 +- src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile | 2 +- src/test/run-make-fulldeps/min-global-align/Makefile | 2 +- src/test/run-make-fulldeps/mismatching-target-triples/Makefile | 2 +- src/test/run-make-fulldeps/missing-crate-dependency/Makefile | 2 +- src/test/run-make-fulldeps/mixing-deps/Makefile | 2 +- src/test/run-make-fulldeps/mixing-formats/Makefile | 2 +- src/test/run-make-fulldeps/mixing-libs/Makefile | 2 +- src/test/run-make-fulldeps/msvc-opt-minsize/Makefile | 2 +- src/test/run-make-fulldeps/multiple-emits/Makefile | 2 +- src/test/run-make-fulldeps/no-builtins-lto/Makefile | 2 +- src/test/run-make-fulldeps/no-duplicate-libs/Makefile | 2 +- src/test/run-make-fulldeps/no-intermediate-extras/Makefile | 2 +- src/test/run-make-fulldeps/obey-crate-type-flag/Makefile | 2 +- .../output-filename-conflicts-with-directory/Makefile | 2 +- .../run-make-fulldeps/output-filename-overwrites-input/Makefile | 2 +- src/test/run-make-fulldeps/output-type-permutations/Makefile | 2 +- src/test/run-make-fulldeps/output-with-hyphens/Makefile | 2 +- src/test/run-make-fulldeps/override-aliased-flags/Makefile | 2 +- src/test/run-make-fulldeps/panic-impl-transitive/Makefile | 2 +- src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile | 2 +- src/test/run-make-fulldeps/pgo-branch-weights/Makefile | 2 +- src/test/run-make-fulldeps/pgo-gen-lto/Makefile | 2 +- src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile | 2 +- src/test/run-make-fulldeps/pgo-gen/Makefile | 2 +- src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile | 2 +- src/test/run-make-fulldeps/pgo-use/Makefile | 2 +- src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile | 2 +- src/test/run-make-fulldeps/prefer-dylib/Makefile | 2 +- src/test/run-make-fulldeps/prefer-rlib/Makefile | 2 +- src/test/run-make-fulldeps/pretty-expanded/Makefile | 2 +- src/test/run-make-fulldeps/pretty-print-to-file/Makefile | 2 +- src/test/run-make-fulldeps/print-cfg/Makefile | 2 +- src/test/run-make-fulldeps/print-target-list/Makefile | 2 +- src/test/run-make-fulldeps/profile/Makefile | 2 +- src/test/run-make-fulldeps/prune-link-args/Makefile | 2 +- src/test/run-make-fulldeps/redundant-libs/Makefile | 2 +- src/test/run-make-fulldeps/relocation-model/Makefile | 2 +- src/test/run-make-fulldeps/relro-levels/Makefile | 2 +- src/test/run-make-fulldeps/remap-path-prefix/Makefile | 2 +- src/test/run-make-fulldeps/reproducible-build-2/Makefile | 2 +- src/test/run-make-fulldeps/reproducible-build/Makefile | 2 +- src/test/run-make-fulldeps/resolve-rename/Makefile | 2 +- .../run-make-fulldeps/return-non-c-like-enum-from-c/Makefile | 2 +- src/test/run-make-fulldeps/return-non-c-like-enum/Makefile | 2 +- src/test/run-make-fulldeps/rlib-chain/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-determinism/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-error-lines/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-io-error/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-map-file/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-output-path/Makefile | 2 +- .../run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile | 2 +- src/test/run-make-fulldeps/rustdoc-themes/Makefile | 2 +- src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile | 2 +- src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile | 2 +- src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile | 2 +- src/test/run-make-fulldeps/save-analysis-fail/Makefile | 2 +- src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile | 2 +- src/test/run-make-fulldeps/save-analysis/Makefile | 2 +- src/test/run-make-fulldeps/separate-link-fail/Makefile | 2 +- src/test/run-make-fulldeps/separate-link/Makefile | 2 +- src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile | 2 +- src/test/run-make-fulldeps/sepcomp-inlining/Makefile | 2 +- src/test/run-make-fulldeps/sepcomp-separate/Makefile | 2 +- src/test/run-make-fulldeps/share-generics-dylib/Makefile | 2 +- src/test/run-make-fulldeps/simd-ffi/Makefile | 2 +- src/test/run-make-fulldeps/simple-dylib/Makefile | 2 +- src/test/run-make-fulldeps/simple-rlib/Makefile | 2 +- src/test/run-make-fulldeps/split-debuginfo/Makefile | 2 +- src/test/run-make-fulldeps/stable-symbol-names/Makefile | 2 +- src/test/run-make-fulldeps/static-dylib-by-default/Makefile | 2 +- src/test/run-make-fulldeps/static-extern-type/Makefile | 2 +- src/test/run-make-fulldeps/static-unwinding/Makefile | 2 +- src/test/run-make-fulldeps/staticlib-blank-lib/Makefile | 2 +- src/test/run-make-fulldeps/std-core-cycle/Makefile | 2 +- src/test/run-make-fulldeps/stdin-non-utf8/Makefile | 2 +- src/test/run-make-fulldeps/suspicious-library/Makefile | 2 +- src/test/run-make-fulldeps/symbols-include-type-name/Makefile | 2 +- src/test/run-make-fulldeps/symlinked-extern/Makefile | 2 +- src/test/run-make-fulldeps/symlinked-libraries/Makefile | 2 +- src/test/run-make-fulldeps/symlinked-rlib/Makefile | 2 +- src/test/run-make-fulldeps/target-cpu-native/Makefile | 2 +- src/test/run-make-fulldeps/target-specs/Makefile | 2 +- src/test/run-make-fulldeps/target-without-atomic-cas/Makefile | 2 +- src/test/run-make-fulldeps/test-harness/Makefile | 2 +- .../run-make-fulldeps/type-mismatch-same-crate-name/Makefile | 2 +- src/test/run-make-fulldeps/use-extern-for-plugins/Makefile | 2 +- src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile | 2 +- src/test/run-make-fulldeps/used-cdylib-macos/Makefile | 2 +- src/test/run-make-fulldeps/used/Makefile | 2 +- src/test/run-make-fulldeps/version/Makefile | 2 +- src/test/run-make-fulldeps/volatile-intrinsics/Makefile | 2 +- src/test/run-make-fulldeps/weird-output-filenames/Makefile | 2 +- .../run-make-fulldeps/windows-binary-no-external-deps/Makefile | 2 +- src/test/run-make-fulldeps/windows-spawn/Makefile | 2 +- src/test/run-make-fulldeps/windows-subsystem/Makefile | 2 +- src/test/run-make/const_fn_mir/Makefile | 2 +- src/test/run-make/coverage-reports/Makefile | 2 +- src/test/run-make/dep-graph/Makefile | 2 +- src/test/run-make/emit-named-files/Makefile | 2 +- src/test/run-make/emit-path-unhashed/Makefile | 2 +- src/test/run-make/emit-shared-files/Makefile | 2 +- src/test/run-make/env-dep-info/Makefile | 2 +- src/test/run-make/export-executable-symbols/Makefile | 2 +- src/test/run-make/fmt-write-bloat/Makefile | 2 +- src/test/run-make/issue-10971-temps-dir/Makefile | 2 +- src/test/run-make/issue-47384/Makefile | 2 +- src/test/run-make/issue-71519/Makefile | 2 +- src/test/run-make/issue-85401-static-mir/Makefile | 2 +- src/test/run-make/issue-85441/Makefile | 2 +- src/test/run-make/issue-88756-default-output/Makefile | 2 +- src/test/run-make/issue-96498/Makefile | 2 +- src/test/run-make/libtest-thread-limit/Makefile | 2 +- src/test/run-make/llvm-outputs/Makefile | 2 +- src/test/run-make/native-link-modifier-bundle/Makefile | 2 +- src/test/run-make/native-link-modifier-whole-archive/Makefile | 2 +- src/test/run-make/pass-linker-flags-from-dep/Makefile | 2 +- src/test/run-make/pass-linker-flags/Makefile | 2 +- src/test/run-make/raw-dylib-alt-calling-convention/Makefile | 2 +- src/test/run-make/raw-dylib-c/Makefile | 2 +- src/test/run-make/raw-dylib-link-ordinal/Makefile | 2 +- src/test/run-make/raw-dylib-stdcall-ordinal/Makefile | 2 +- src/test/run-make/remap-path-prefix-dwarf/Makefile | 2 +- src/test/run-make/rustc-macro-dep-files/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-multiple/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk | 2 +- src/test/run-make/rustdoc-scrape-examples-ordering/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-remap/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-test/Makefile | 2 +- src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile | 2 +- src/test/run-make/rustdoc-with-out-dir-option/Makefile | 2 +- src/test/run-make/rustdoc-with-output-option/Makefile | 2 +- src/test/run-make/rustdoc-with-short-out-dir-option/Makefile | 2 +- src/test/run-make/static-pie/Makefile | 2 +- src/test/run-make/thumb-none-cortex-m/Makefile | 2 +- src/test/run-make/thumb-none-qemu/Makefile | 2 +- src/test/run-make/track-path-dep-info/Makefile | 2 +- src/test/run-make/unstable-flag-required/Makefile | 2 +- src/test/run-make/wasm-abi/Makefile | 2 +- src/test/run-make/wasm-custom-section/Makefile | 2 +- src/test/run-make/wasm-custom-sections-opt/Makefile | 2 +- src/test/run-make/wasm-export-all-symbols/Makefile | 2 +- src/test/run-make/wasm-import-module/Makefile | 2 +- src/test/run-make/wasm-panic-small/Makefile | 2 +- src/test/run-make/wasm-spurious-import/Makefile | 2 +- src/test/run-make/wasm-stringify-ints-small/Makefile | 2 +- src/test/run-make/wasm-symbols-different-module/Makefile | 2 +- src/test/run-make/wasm-symbols-not-exported/Makefile | 2 +- src/test/run-make/wasm-symbols-not-imported/Makefile | 2 +- src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile | 2 +- 273 files changed, 273 insertions(+), 273 deletions(-) diff --git a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile index 4a9b3d70933e4..adc9e3d091609 100644 --- a/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile +++ b/src/test/run-make-fulldeps/a-b-a-linker-guard/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that if we build `b` against a version of `a` that has one set # of types, it will not run with a dylib that has a different set of diff --git a/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile b/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile index eb6ad9bd1a7da..735d91bd27c51 100644 --- a/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile +++ b/src/test/run-make-fulldeps/alloc-no-oom-handling/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_global_oom_handling diff --git a/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile b/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile index c14006cc2e052..60d9c7c374590 100644 --- a/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile +++ b/src/test/run-make-fulldeps/allow-non-lint-warnings-cmdline/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that -A warnings makes the 'empty trait list for derive' warning go away OUT=$(shell $(RUSTC) foo.rs -A warnings 2>&1 | grep "warning" ) diff --git a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile index 3eecaf9314226..1ce8d0ec28417 100644 --- a/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile +++ b/src/test/run-make-fulldeps/allow-warnings-cmdline-stability/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that -A warnings makes the 'empty trait list for derive' warning go away DEP=$(shell $(RUSTC) bar.rs) diff --git a/src/test/run-make-fulldeps/archive-duplicate-names/Makefile b/src/test/run-make-fulldeps/archive-duplicate-names/Makefile index 93711c41d79f8..bbdcd2a34fe04 100644 --- a/src/test/run-make-fulldeps/archive-duplicate-names/Makefile +++ b/src/test/run-make-fulldeps/archive-duplicate-names/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: mkdir $(TMPDIR)/a diff --git a/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile b/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile index 5b5d620efe655..513311c828946 100644 --- a/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile +++ b/src/test/run-make-fulldeps/arguments-non-c-like-enum/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --crate-type=staticlib nonclike.rs diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile index 9e8b4fabf1798..37e59624a2541 100644 --- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile +++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # This tests ensure that atomic types are never lowered into runtime library calls that are not # guaranteed to be lock-free. diff --git a/src/test/run-make-fulldeps/bare-outfile/Makefile b/src/test/run-make-fulldeps/bare-outfile/Makefile index baa4c1c0237b2..858466e942b15 100644 --- a/src/test/run-make-fulldeps/bare-outfile/Makefile +++ b/src/test/run-make-fulldeps/bare-outfile/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cp foo.rs $(TMPDIR) diff --git a/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile b/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile index c524610bf5c07..ac68778922d6d 100644 --- a/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile +++ b/src/test/run-make-fulldeps/c-dynamic-dylib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-macos # diff --git a/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile index 91343e73e1519..c65d648b92957 100644 --- a/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile +++ b/src/test/run-make-fulldeps/c-dynamic-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-macos # diff --git a/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile index 98e112a374423..2a371b54541e5 100644 --- a/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile +++ b/src/test/run-make-fulldeps/c-link-to-rust-dylib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(TMPDIR)/$(call BIN,bar) $(call RUN,bar) diff --git a/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile index 687b59ac00e8f..d38bcef309a76 100644 --- a/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile +++ b/src/test/run-make-fulldeps/c-link-to-rust-staticlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-freebsd # FIXME diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile index f124ca2ab614a..9ce2a34e677b3 100644 --- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile +++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) checkrust.rs diff --git a/src/test/run-make-fulldeps/c-static-dylib/Makefile b/src/test/run-make-fulldeps/c-static-dylib/Makefile index f88786857ccdc..5b78005e3ee35 100644 --- a/src/test/run-make-fulldeps/c-static-dylib/Makefile +++ b/src/test/run-make-fulldeps/c-static-dylib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,cfoo) $(RUSTC) foo.rs -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/c-static-rlib/Makefile b/src/test/run-make-fulldeps/c-static-rlib/Makefile index be22b2728f05b..11a3cf1940c64 100644 --- a/src/test/run-make-fulldeps/c-static-rlib/Makefile +++ b/src/test/run-make-fulldeps/c-static-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,cfoo) $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile b/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile index a8515c533af57..134f000d4535b 100644 --- a/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile +++ b/src/test/run-make-fulldeps/c-unwind-abi-catch-lib-panic/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: archive # Compile `main.rs`, which will link into our library, and run it. diff --git a/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile b/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile index 9553b7aeeb983..e93ec99da2a57 100644 --- a/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile +++ b/src/test/run-make-fulldeps/c-unwind-abi-catch-panic/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,add) $(RUSTC) main.rs diff --git a/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile b/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile index fead197ce3906..82351e22009b2 100644 --- a/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile +++ b/src/test/run-make-fulldeps/cat-and-grep-sanity-check/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: echo a | $(CGREP) a diff --git a/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile b/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile index 23491d814d01d..324791af8dee5 100644 --- a/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile +++ b/src/test/run-make-fulldeps/cdylib-fewer-symbols/Makefile @@ -1,7 +1,7 @@ # Test that allocator-related symbols don't show up as exported from a cdylib as # they're internal to Rust and not part of the public ABI. --include ../tools.mk +include ../tools.mk # ignore-windows # FIXME: The __rdl_ and __rust_ symbol still remains, no matter using MSVC or GNU diff --git a/src/test/run-make-fulldeps/codegen-options-parsing/Makefile b/src/test/run-make-fulldeps/codegen-options-parsing/Makefile index f1410b69b3fce..b063593c9d97a 100644 --- a/src/test/run-make-fulldeps/codegen-options-parsing/Makefile +++ b/src/test/run-make-fulldeps/codegen-options-parsing/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: #Option taking a number diff --git a/src/test/run-make-fulldeps/compile-stdin/Makefile b/src/test/run-make-fulldeps/compile-stdin/Makefile index 1442224cf9a76..be15548690fb5 100644 --- a/src/test/run-make-fulldeps/compile-stdin/Makefile +++ b/src/test/run-make-fulldeps/compile-stdin/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: echo 'fn main(){}' | $(RUSTC) - diff --git a/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile b/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile index bd7f62d5c2d89..d4ff7d8daabf9 100644 --- a/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile +++ b/src/test/run-make-fulldeps/compiler-lookup-paths-2/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: mkdir -p $(TMPDIR)/a $(TMPDIR)/b diff --git a/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile b/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile index e22b937a08763..c16bf7af6c48d 100644 --- a/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile +++ b/src/test/run-make-fulldeps/compiler-lookup-paths/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(TMPDIR)/libnative.a mkdir -p $(TMPDIR)/crate diff --git a/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile b/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile index 0cf5d1855212d..74917570a0142 100644 --- a/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile +++ b/src/test/run-make-fulldeps/compiler-rt-works-on-mingw/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-windows-gnu diff --git a/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile b/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile index f79e4c3f4798c..d083aaa662005 100644 --- a/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile +++ b/src/test/run-make-fulldeps/core-no-fp-fmt-parse/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --edition=2021 --crate-type=rlib ../../../../library/core/src/lib.rs --cfg no_fp_fmt_parse diff --git a/src/test/run-make-fulldeps/crate-data-smoke/Makefile b/src/test/run-make-fulldeps/crate-data-smoke/Makefile index 1afda457411da..a453f65ff3ea2 100644 --- a/src/test/run-make-fulldeps/crate-data-smoke/Makefile +++ b/src/test/run-make-fulldeps/crate-data-smoke/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: [ `$(RUSTC) --print crate-name crate.rs` = "foo" ] diff --git a/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile b/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile index 091508cd805b9..4f25a865ebd1f 100644 --- a/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile +++ b/src/test/run-make-fulldeps/crate-hash-rustc-version/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Ensure that crates compiled with different rustc versions cannot # be dynamically linked. diff --git a/src/test/run-make-fulldeps/crate-name-priority/Makefile b/src/test/run-make-fulldeps/crate-name-priority/Makefile index 17ecb33ab28d0..08a07c325e310 100644 --- a/src/test/run-make-fulldeps/crate-name-priority/Makefile +++ b/src/test/run-make-fulldeps/crate-name-priority/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile index 3ca2a8afad0b1..acaebf439d65b 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-clang/Makefile @@ -3,7 +3,7 @@ # This test makes sure that cross-language inlining actually works by checking # the generated machine code. --include ../tools.mk +include ../tools.mk all: cpp-executable rust-executable diff --git a/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile index f8efeca56141b..70085d9bde1d9 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-pgo-smoketest/Makefile @@ -5,7 +5,7 @@ # can be executed without anything crashing. It does not test whether PGO or # xLTO have any specific effect on the generated code. --include ../tools.mk +include ../tools.mk COMMON_FLAGS=-Copt-level=3 -Ccodegen-units=1 diff --git a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile index f70b411d747e7..6f1caa31a8061 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto-upstream-rlibs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore windows due to libLLVM being present in PATH and the PATH and library path being the same # (so fixing it is harder). See #57765 for context diff --git a/src/test/run-make-fulldeps/cross-lang-lto/Makefile b/src/test/run-make-fulldeps/cross-lang-lto/Makefile index b4394cb5b4079..92058f952a9fc 100644 --- a/src/test/run-make-fulldeps/cross-lang-lto/Makefile +++ b/src/test/run-make-fulldeps/cross-lang-lto/Makefile @@ -1,5 +1,5 @@ --include ../tools.mk +include ../tools.mk # ignore windows due to libLLVM being present in PATH and the PATH and library path being the same # (so fixing it is harder). See #57765 for context diff --git a/src/test/run-make-fulldeps/debug-assertions/Makefile b/src/test/run-make-fulldeps/debug-assertions/Makefile index 76ada90f1e25a..73beb4b03ae10 100644 --- a/src/test/run-make-fulldeps/debug-assertions/Makefile +++ b/src/test/run-make-fulldeps/debug-assertions/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) debug.rs -C debug-assertions=no diff --git a/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile b/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile index 2fd84639f2190..b4dc44ad2be84 100644 --- a/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile +++ b/src/test/run-make-fulldeps/dep-info-doesnt-run-much/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --emit dep-info diff --git a/src/test/run-make-fulldeps/dep-info-spaces/Makefile b/src/test/run-make-fulldeps/dep-info-spaces/Makefile index 339a751ff96be..0cfe513e490a7 100644 --- a/src/test/run-make-fulldeps/dep-info-spaces/Makefile +++ b/src/test/run-make-fulldeps/dep-info-spaces/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # ignore-freebsd diff --git a/src/test/run-make-fulldeps/dep-info/Makefile b/src/test/run-make-fulldeps/dep-info/Makefile index afb9db177cf03..c76f43a8eed51 100644 --- a/src/test/run-make-fulldeps/dep-info/Makefile +++ b/src/test/run-make-fulldeps/dep-info/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # ignore-freebsd diff --git a/src/test/run-make-fulldeps/dylib-chain/Makefile b/src/test/run-make-fulldeps/dylib-chain/Makefile index a33177197b119..1139822f4ea91 100644 --- a/src/test/run-make-fulldeps/dylib-chain/Makefile +++ b/src/test/run-make-fulldeps/dylib-chain/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) m1.rs -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile index d270289484284..f636ebd28f2ea 100644 --- a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile +++ b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # ignore-macos diff --git a/src/test/run-make-fulldeps/emit/Makefile b/src/test/run-make-fulldeps/emit/Makefile index e0b57107e5b7b..78e68bd61114f 100644 --- a/src/test/run-make-fulldeps/emit/Makefile +++ b/src/test/run-make-fulldeps/emit/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -Copt-level=0 --emit=llvm-bc,llvm-ir,asm,obj,link test-24876.rs diff --git a/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile b/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile index fef12c4da6703..0eae41d720ccc 100644 --- a/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile +++ b/src/test/run-make-fulldeps/error-found-staticlib-instead-crate/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --crate-type staticlib diff --git a/src/test/run-make-fulldeps/error-writing-dependencies/Makefile b/src/test/run-make-fulldeps/error-writing-dependencies/Makefile index cbc96901a388a..a5d30a647f817 100644 --- a/src/test/run-make-fulldeps/error-writing-dependencies/Makefile +++ b/src/test/run-make-fulldeps/error-writing-dependencies/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # Let's get a nice error message diff --git a/src/test/run-make-fulldeps/exit-code/Makefile b/src/test/run-make-fulldeps/exit-code/Makefile index 007f19852a662..3ffaafe90657c 100644 --- a/src/test/run-make-fulldeps/exit-code/Makefile +++ b/src/test/run-make-fulldeps/exit-code/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) success.rs; [ $$? -eq 0 ] diff --git a/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile b/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile index b84e930757b25..54596c2f029e1 100644 --- a/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile +++ b/src/test/run-make-fulldeps/extern-diff-internal-name/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) lib.rs diff --git a/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile b/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile index 81930e969a9f6..a8f142a6402e2 100644 --- a/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile +++ b/src/test/run-make-fulldeps/extern-flag-disambiguates/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Attempt to build this dependency tree: # diff --git a/src/test/run-make-fulldeps/extern-flag-fun/Makefile b/src/test/run-make-fulldeps/extern-flag-fun/Makefile index 38d1d5bb8488a..a0b7c15edb9a5 100644 --- a/src/test/run-make-fulldeps/extern-flag-fun/Makefile +++ b/src/test/run-make-fulldeps/extern-flag-fun/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) bar.rs --crate-type=rlib diff --git a/src/test/run-make-fulldeps/extern-flag-pathless/Makefile b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile index 4849fc62f4a95..0f23815b6505b 100644 --- a/src/test/run-make-fulldeps/extern-flag-pathless/Makefile +++ b/src/test/run-make-fulldeps/extern-flag-pathless/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test mixing pathless --extern with paths. diff --git a/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile index 4354209a72202..d16a8e20868ef 100644 --- a/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile +++ b/src/test/run-make-fulldeps/extern-flag-rename-transitive/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/extern-fn-generic/Makefile b/src/test/run-make-fulldeps/extern-fn-generic/Makefile index cf897dba1f279..71746fb10cbf4 100644 --- a/src/test/run-make-fulldeps/extern-fn-generic/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-generic/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) testcrate.rs diff --git a/src/test/run-make-fulldeps/extern-fn-mangle/Makefile b/src/test/run-make-fulldeps/extern-fn-mangle/Makefile index 042048ec25f63..4f5d026f213f2 100644 --- a/src/test/run-make-fulldeps/extern-fn-mangle/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-mangle/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) test.rs diff --git a/src/test/run-make-fulldeps/extern-fn-reachable/Makefile b/src/test/run-make-fulldeps/extern-fn-reachable/Makefile index 9231a2b3574db..05bdb8d65b7bf 100644 --- a/src/test/run-make-fulldeps/extern-fn-reachable/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-reachable/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows-msvc diff --git a/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile b/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile index 042048ec25f63..4f5d026f213f2 100644 --- a/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-struct-passing-abi/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) test.rs diff --git a/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile b/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile index 8977e14c3ad1a..1fa708950d436 100644 --- a/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-with-extern-types/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,ctest) $(RUSTC) test.rs diff --git a/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile b/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile index 042048ec25f63..4f5d026f213f2 100644 --- a/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-with-packed-struct/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) test.rs diff --git a/src/test/run-make-fulldeps/extern-fn-with-union/Makefile b/src/test/run-make-fulldeps/extern-fn-with-union/Makefile index 71a5407e882dd..40bae923e30b9 100644 --- a/src/test/run-make-fulldeps/extern-fn-with-union/Makefile +++ b/src/test/run-make-fulldeps/extern-fn-with-union/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,ctest) $(RUSTC) testcrate.rs diff --git a/src/test/run-make-fulldeps/extern-multiple-copies/Makefile b/src/test/run-make-fulldeps/extern-multiple-copies/Makefile index 1631aa806af09..00668a6bc88c2 100644 --- a/src/test/run-make-fulldeps/extern-multiple-copies/Makefile +++ b/src/test/run-make-fulldeps/extern-multiple-copies/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo1.rs diff --git a/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile b/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile index 567d7e78a57a4..84de2ebf34dfc 100644 --- a/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile +++ b/src/test/run-make-fulldeps/extern-multiple-copies2/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo1.rs diff --git a/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile b/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile index 7d063a4c83cba..c57b062cd5dd1 100644 --- a/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile +++ b/src/test/run-make-fulldeps/extern-overrides-distribution/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) libc.rs -Cmetadata=foo diff --git a/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile b/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile index e46390a9d0cd7..470448cf50c57 100644 --- a/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile +++ b/src/test/run-make-fulldeps/extra-filename-with-temp-outputs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -C extra-filename=bar foo.rs -C save-temps diff --git a/src/test/run-make-fulldeps/foreign-double-unwind/Makefile b/src/test/run-make-fulldeps/foreign-double-unwind/Makefile index 27cf4d19ce067..ea2fe9ff881bc 100644 --- a/src/test/run-make-fulldeps/foreign-double-unwind/Makefile +++ b/src/test/run-make-fulldeps/foreign-double-unwind/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: foo $(call RUN,foo) | $(CGREP) -v unreachable diff --git a/src/test/run-make-fulldeps/foreign-exceptions/Makefile b/src/test/run-make-fulldeps/foreign-exceptions/Makefile index 7eba52f3c24e8..38fe2773df2e7 100644 --- a/src/test/run-make-fulldeps/foreign-exceptions/Makefile +++ b/src/test/run-make-fulldeps/foreign-exceptions/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: foo $(call RUN,foo) diff --git a/src/test/run-make-fulldeps/fpic/Makefile b/src/test/run-make-fulldeps/fpic/Makefile index a3d0190eed633..5986de3666f71 100644 --- a/src/test/run-make-fulldeps/fpic/Makefile +++ b/src/test/run-make-fulldeps/fpic/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # ignore-macos diff --git a/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile b/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile index ad841ec6101cd..39e64bacf5813 100644 --- a/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile +++ b/src/test/run-make-fulldeps/glibc-staticlib-args/Makefile @@ -1,7 +1,7 @@ # only-gnu # only-linux --include ../tools.mk +include ../tools.mk # This ensures that std::env::args works in a library called from C on glibc Linux. diff --git a/src/test/run-make-fulldeps/hir-tree/Makefile b/src/test/run-make-fulldeps/hir-tree/Makefile index 3412c8ce1f582..b0450ea4bc5fd 100644 --- a/src/test/run-make-fulldeps/hir-tree/Makefile +++ b/src/test/run-make-fulldeps/hir-tree/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that hir-tree output doesn't crash and includes # the string constant we would expect to see. diff --git a/src/test/run-make-fulldeps/include_bytes_deps/Makefile b/src/test/run-make-fulldeps/include_bytes_deps/Makefile index f91af88efe1b7..696dfd207bbff 100644 --- a/src/test/run-make-fulldeps/include_bytes_deps/Makefile +++ b/src/test/run-make-fulldeps/include_bytes_deps/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-freebsd diff --git a/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile b/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile index 371f94715a8c1..5c1d953cc05b6 100644 --- a/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile +++ b/src/test/run-make-fulldeps/incr-add-rust-src-component/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # rust-lang/rust#70924: Test that if we add rust-src component in between two # incremental compiles, the compiler does not ICE on the second. diff --git a/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile b/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile index 0cab955f6442b..9945821db2891 100644 --- a/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile +++ b/src/test/run-make-fulldeps/inline-always-many-cgu/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --emit llvm-ir -C codegen-units=2 diff --git a/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile b/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile index 0a50859cdaa4d..dc5b55a99256e 100644 --- a/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile +++ b/src/test/run-make-fulldeps/interdependent-c-libraries/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # The rust crate foo will link to the native library foo, while the rust crate # bar will link to the native library bar. There is also a dependency between diff --git a/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile b/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile index 2037728568e24..3c4dade0f5215 100644 --- a/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile +++ b/src/test/run-make-fulldeps/intrinsic-unreachable/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows-msvc # diff --git a/src/test/run-make-fulldeps/invalid-library/Makefile b/src/test/run-make-fulldeps/invalid-library/Makefile index de463a330149b..910d9af7b0564 100644 --- a/src/test/run-make-fulldeps/invalid-library/Makefile +++ b/src/test/run-make-fulldeps/invalid-library/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: touch $(TMPDIR)/lib.rmeta diff --git a/src/test/run-make-fulldeps/invalid-staticlib/Makefile b/src/test/run-make-fulldeps/invalid-staticlib/Makefile index 3a91902ccceb6..3f0f74ce3cb02 100644 --- a/src/test/run-make-fulldeps/invalid-staticlib/Makefile +++ b/src/test/run-make-fulldeps/invalid-staticlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: touch $(TMPDIR)/libfoo.a diff --git a/src/test/run-make-fulldeps/issue-11908/Makefile b/src/test/run-make-fulldeps/issue-11908/Makefile index cf6572c27ad5e..47005537e41af 100644 --- a/src/test/run-make-fulldeps/issue-11908/Makefile +++ b/src/test/run-make-fulldeps/issue-11908/Makefile @@ -5,7 +5,7 @@ # and then our aux-built libraries will collide with liburl (they have # the same version listed) --include ../tools.mk +include ../tools.mk all: mkdir $(TMPDIR)/other diff --git a/src/test/run-make-fulldeps/issue-14500/Makefile b/src/test/run-make-fulldeps/issue-14500/Makefile index 0c0e331da1d5a..52550e57018e4 100644 --- a/src/test/run-make-fulldeps/issue-14500/Makefile +++ b/src/test/run-make-fulldeps/issue-14500/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test to make sure that reachable extern fns are always available in final # productcs, including when LTO is used. In this test, the `foo` crate has a diff --git a/src/test/run-make-fulldeps/issue-14698/Makefile b/src/test/run-make-fulldeps/issue-14698/Makefile index dbe8317dbc4bc..a1cfb5abab541 100644 --- a/src/test/run-make-fulldeps/issue-14698/Makefile +++ b/src/test/run-make-fulldeps/issue-14698/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: TMP=fake TMPDIR=fake $(RUSTC) foo.rs 2>&1 | $(CGREP) "couldn't create a temp dir:" diff --git a/src/test/run-make-fulldeps/issue-15460/Makefile b/src/test/run-make-fulldeps/issue-15460/Makefile index 846805686a12a..1648d0c0c9b84 100644 --- a/src/test/run-make-fulldeps/issue-15460/Makefile +++ b/src/test/run-make-fulldeps/issue-15460/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,foo) $(RUSTC) foo.rs -C extra-filename=-383hf8 -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/issue-18943/Makefile b/src/test/run-make-fulldeps/issue-18943/Makefile index bef70a0edaab9..fc40d756d6f21 100644 --- a/src/test/run-make-fulldeps/issue-18943/Makefile +++ b/src/test/run-make-fulldeps/issue-18943/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Regression test for ICE #18943 when compiling as lib diff --git a/src/test/run-make-fulldeps/issue-19371/Makefile b/src/test/run-make-fulldeps/issue-19371/Makefile index 9f3ec78465b25..994e50801c817 100644 --- a/src/test/run-make-fulldeps/issue-19371/Makefile +++ b/src/test/run-make-fulldeps/issue-19371/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # This test ensures that rustc compile_input can be called twice in one task # without causing a panic. diff --git a/src/test/run-make-fulldeps/issue-20626/Makefile b/src/test/run-make-fulldeps/issue-20626/Makefile index 0487b24040021..f76f31e794af1 100644 --- a/src/test/run-make-fulldeps/issue-20626/Makefile +++ b/src/test/run-make-fulldeps/issue-20626/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test output to be four # The original error only occurred when printing, not when comparing using assert! diff --git a/src/test/run-make-fulldeps/issue-22131/Makefile b/src/test/run-make-fulldeps/issue-22131/Makefile index d76aaf5c146db..770f4b04ec358 100644 --- a/src/test/run-make-fulldeps/issue-22131/Makefile +++ b/src/test/run-make-fulldeps/issue-22131/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: foo.rs $(RUSTC) --cfg 'feature="bar"' --crate-type lib foo.rs diff --git a/src/test/run-make-fulldeps/issue-24445/Makefile b/src/test/run-make-fulldeps/issue-24445/Makefile index f7ad238af14cc..2a12226a6c037 100644 --- a/src/test/run-make-fulldeps/issue-24445/Makefile +++ b/src/test/run-make-fulldeps/issue-24445/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-linux diff --git a/src/test/run-make-fulldeps/issue-25581/Makefile b/src/test/run-make-fulldeps/issue-25581/Makefile index 042048ec25f63..4f5d026f213f2 100644 --- a/src/test/run-make-fulldeps/issue-25581/Makefile +++ b/src/test/run-make-fulldeps/issue-25581/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) test.rs diff --git a/src/test/run-make-fulldeps/issue-26006/Makefile b/src/test/run-make-fulldeps/issue-26006/Makefile index dd023c32ba28f..0ff0730200250 100644 --- a/src/test/run-make-fulldeps/issue-26006/Makefile +++ b/src/test/run-make-fulldeps/issue-26006/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows diff --git a/src/test/run-make-fulldeps/issue-26092/Makefile b/src/test/run-make-fulldeps/issue-26092/Makefile index 885f45a022431..96822e7690bef 100644 --- a/src/test/run-make-fulldeps/issue-26092/Makefile +++ b/src/test/run-make-fulldeps/issue-26092/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # This test ensures that rustc does not panic with `-o ""` option. diff --git a/src/test/run-make-fulldeps/issue-28595/Makefile b/src/test/run-make-fulldeps/issue-28595/Makefile index 61e9d0c654735..30a1d9c560a96 100644 --- a/src/test/run-make-fulldeps/issue-28595/Makefile +++ b/src/test/run-make-fulldeps/issue-28595/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,a) $(call NATIVE_STATICLIB,b) $(RUSTC) a.rs diff --git a/src/test/run-make-fulldeps/issue-28766/Makefile b/src/test/run-make-fulldeps/issue-28766/Makefile index 1f47ef15b278c..96d0bdc2b2aea 100644 --- a/src/test/run-make-fulldeps/issue-28766/Makefile +++ b/src/test/run-make-fulldeps/issue-28766/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -O foo.rs diff --git a/src/test/run-make-fulldeps/issue-30063/Makefile b/src/test/run-make-fulldeps/issue-30063/Makefile index a76051dc81e1e..e4ede598f7be8 100644 --- a/src/test/run-make-fulldeps/issue-30063/Makefile +++ b/src/test/run-make-fulldeps/issue-30063/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: rm -f $(TMPDIR)/foo-output diff --git a/src/test/run-make-fulldeps/issue-33329/Makefile b/src/test/run-make-fulldeps/issue-33329/Makefile index 591e4e3dda344..9c149440d8ec4 100644 --- a/src/test/run-make-fulldeps/issue-33329/Makefile +++ b/src/test/run-make-fulldeps/issue-33329/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --target x86_64_unknown-linux-musl main.rs 2>&1 | $(CGREP) \ diff --git a/src/test/run-make-fulldeps/issue-35164/Makefile b/src/test/run-make-fulldeps/issue-35164/Makefile index a95125c566ea0..38aa6f1265f1e 100644 --- a/src/test/run-make-fulldeps/issue-35164/Makefile +++ b/src/test/run-make-fulldeps/issue-35164/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) main.rs --error-format json 2>&1 | $(CGREP) -e '"byte_start":23\b' '"byte_end":29\b' diff --git a/src/test/run-make-fulldeps/issue-37839/Makefile b/src/test/run-make-fulldeps/issue-37839/Makefile index f17ce537fb813..de50bd7137968 100644 --- a/src/test/run-make-fulldeps/issue-37839/Makefile +++ b/src/test/run-make-fulldeps/issue-37839/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) a.rs && $(RUSTC) b.rs diff --git a/src/test/run-make-fulldeps/issue-37893/Makefile b/src/test/run-make-fulldeps/issue-37893/Makefile index 27b69baf97787..33a60830e5d19 100644 --- a/src/test/run-make-fulldeps/issue-37893/Makefile +++ b/src/test/run-make-fulldeps/issue-37893/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) a.rs && $(RUSTC) b.rs && $(RUSTC) c.rs diff --git a/src/test/run-make-fulldeps/issue-38237/Makefile b/src/test/run-make-fulldeps/issue-38237/Makefile index 0a681401b1afb..75121d0401243 100644 --- a/src/test/run-make-fulldeps/issue-38237/Makefile +++ b/src/test/run-make-fulldeps/issue-38237/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs; $(RUSTC) bar.rs diff --git a/src/test/run-make-fulldeps/issue-40535/Makefile b/src/test/run-make-fulldeps/issue-40535/Makefile index 49db1d43e4718..155c88252144d 100644 --- a/src/test/run-make-fulldeps/issue-40535/Makefile +++ b/src/test/run-make-fulldeps/issue-40535/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # The ICE occurred in the following situation: # * `foo` declares `extern crate bar, baz`, depends only on `bar` (forgetting `baz` in `Cargo.toml`) diff --git a/src/test/run-make-fulldeps/issue-46239/Makefile b/src/test/run-make-fulldeps/issue-46239/Makefile index 698a605f7e9ba..a93ef32129846 100644 --- a/src/test/run-make-fulldeps/issue-46239/Makefile +++ b/src/test/run-make-fulldeps/issue-46239/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) main.rs -C opt-level=1 diff --git a/src/test/run-make-fulldeps/issue-47551/Makefile b/src/test/run-make-fulldeps/issue-47551/Makefile index f4495e6b671d7..5a6ac725701b3 100644 --- a/src/test/run-make-fulldeps/issue-47551/Makefile +++ b/src/test/run-make-fulldeps/issue-47551/Makefile @@ -1,7 +1,7 @@ # only-linux # ignore-32bit --include ../tools.mk +include ../tools.mk all: $(RUSTC) eh_frame-terminator.rs diff --git a/src/test/run-make-fulldeps/issue-51671/Makefile b/src/test/run-make-fulldeps/issue-51671/Makefile index ba3d3b7100745..1d1d370d38264 100644 --- a/src/test/run-make-fulldeps/issue-51671/Makefile +++ b/src/test/run-make-fulldeps/issue-51671/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows-msvc diff --git a/src/test/run-make-fulldeps/issue-53964/Makefile b/src/test/run-make-fulldeps/issue-53964/Makefile index c56beb52fdd61..6bd83021374d9 100644 --- a/src/test/run-make-fulldeps/issue-53964/Makefile +++ b/src/test/run-make-fulldeps/issue-53964/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) panic.rs diff --git a/src/test/run-make-fulldeps/issue-64153/Makefile b/src/test/run-make-fulldeps/issue-64153/Makefile index 9c0c3fe6e019c..51dc6b53a4504 100644 --- a/src/test/run-make-fulldeps/issue-64153/Makefile +++ b/src/test/run-make-fulldeps/issue-64153/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # `llvm-objdump`'s output looks different on windows than on other platforms. # It should be enough to check on Unix platforms, so: diff --git a/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile b/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile index 2f16ad3285994..13983f4ffe03a 100644 --- a/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile +++ b/src/test/run-make-fulldeps/issue-68794-textrel-on-minimal-lib/Makefile @@ -6,7 +6,7 @@ # The test links a rust static library into a shared library, and checks that # the linker doesn't have to flag the resulting file as containing TEXTRELs. --include ../tools.mk +include ../tools.mk # only-linux diff --git a/src/test/run-make-fulldeps/issue-69368/Makefile b/src/test/run-make-fulldeps/issue-69368/Makefile index dbb044d8f5d46..41770475db04e 100644 --- a/src/test/run-make-fulldeps/issue-69368/Makefile +++ b/src/test/run-make-fulldeps/issue-69368/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that previously triggered a linker failure with root cause # similar to one found in the issue #69368. diff --git a/src/test/run-make-fulldeps/issue-7349/Makefile b/src/test/run-make-fulldeps/issue-7349/Makefile index 9658b99e3b0c3..dc073b77fe128 100644 --- a/src/test/run-make-fulldeps/issue-7349/Makefile +++ b/src/test/run-make-fulldeps/issue-7349/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test to make sure that inner functions within a polymorphic outer function # don't get re-codegened when the outer function is monomorphized. The test diff --git a/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile b/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile index 157edb20c30a5..879ce174339a6 100644 --- a/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile +++ b/src/test/run-make-fulldeps/issue-84395-lto-embed-bitcode/Makefile @@ -3,7 +3,7 @@ # This test makes sure the embed bitcode in elf created with # lto-embed-bitcode=optimized is valid llvm BC module. --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) test.rs --target $(TARGET) -Clink-arg=-fuse-ld=lld -Clinker-plugin-lto -Clinker=$(CLANG) -Clink-arg=-Wl,--plugin-opt=-lto-embed-bitcode=optimized -Zemit-thin-lto=no diff --git a/src/test/run-make-fulldeps/issue64319/Makefile b/src/test/run-make-fulldeps/issue64319/Makefile index 5592f5a71fff1..ee0d177abc986 100644 --- a/src/test/run-make-fulldeps/issue64319/Makefile +++ b/src/test/run-make-fulldeps/issue64319/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Different optimization levels imply different values for `-Zshare-generics`, # so try out a whole bunch of combinations to make sure everything is compatible diff --git a/src/test/run-make-fulldeps/issues-41478-43796/Makefile b/src/test/run-make-fulldeps/issues-41478-43796/Makefile index f9735253ab682..e451cb03126cc 100644 --- a/src/test/run-make-fulldeps/issues-41478-43796/Makefile +++ b/src/test/run-make-fulldeps/issues-41478-43796/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # Work in /tmp, because we need to create the `save-analysis-temp` folder. diff --git a/src/test/run-make-fulldeps/libs-through-symlinks/Makefile b/src/test/run-make-fulldeps/libs-through-symlinks/Makefile index 8be2e234fea1f..45deaecb8406a 100644 --- a/src/test/run-make-fulldeps/libs-through-symlinks/Makefile +++ b/src/test/run-make-fulldeps/libs-through-symlinks/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows diff --git a/src/test/run-make-fulldeps/libtest-json/Makefile b/src/test/run-make-fulldeps/libtest-json/Makefile index 67b5fc2ed32dc..37b6cb9e2d4d5 100644 --- a/src/test/run-make-fulldeps/libtest-json/Makefile +++ b/src/test/run-make-fulldeps/libtest-json/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test expected libtest's JSON output diff --git a/src/test/run-make-fulldeps/link-arg/Makefile b/src/test/run-make-fulldeps/link-arg/Makefile index 0360ede762551..103527c3e14d9 100644 --- a/src/test/run-make-fulldeps/link-arg/Makefile +++ b/src/test/run-make-fulldeps/link-arg/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk RUSTC_FLAGS = -C link-arg="-lfoo" -C link-arg="-lbar" --print link-args all: diff --git a/src/test/run-make-fulldeps/link-args-order/Makefile b/src/test/run-make-fulldeps/link-args-order/Makefile index f94e882ccb68d..c562cc1b396fa 100644 --- a/src/test/run-make-fulldeps/link-args-order/Makefile +++ b/src/test/run-make-fulldeps/link-args-order/Makefile @@ -1,6 +1,6 @@ # ignore-msvc --include ../tools.mk +include ../tools.mk RUSTC_FLAGS = -C linker-flavor=ld -C link-arg=a -C link-args="b c" -C link-args="d e" -C link-arg=f RUSTC_FLAGS_PRE = -C linker-flavor=ld -Z pre-link-arg=a -Z pre-link-args="b c" -Z pre-link-args="d e" -Z pre-link-arg=f diff --git a/src/test/run-make-fulldeps/link-cfg/Makefile b/src/test/run-make-fulldeps/link-cfg/Makefile index 2701b4a593cc6..0b25ccded0694 100644 --- a/src/test/run-make-fulldeps/link-cfg/Makefile +++ b/src/test/run-make-fulldeps/link-cfg/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call DYLIB,return1) $(call DYLIB,return2) $(call NATIVE_STATICLIB,return3) ls $(TMPDIR) diff --git a/src/test/run-make-fulldeps/link-dedup/Makefile b/src/test/run-make-fulldeps/link-dedup/Makefile index 4e7ce0f02d4dc..5c9603352989a 100644 --- a/src/test/run-make-fulldeps/link-dedup/Makefile +++ b/src/test/run-make-fulldeps/link-dedup/Makefile @@ -1,6 +1,6 @@ # ignore-msvc --include ../tools.mk +include ../tools.mk all: $(RUSTC) depa.rs diff --git a/src/test/run-make-fulldeps/link-path-order/Makefile b/src/test/run-make-fulldeps/link-path-order/Makefile index eeea0e3714e7f..ed7c299e61a77 100644 --- a/src/test/run-make-fulldeps/link-path-order/Makefile +++ b/src/test/run-make-fulldeps/link-path-order/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Verifies that the -L arguments given to the linker is in the same order # as the -L arguments on the rustc command line. diff --git a/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile b/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile index 4befbe1446542..7cc54e40a3a80 100644 --- a/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile +++ b/src/test/run-make-fulldeps/linkage-attr-on-static/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,foo) $(RUSTC) bar.rs diff --git a/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile index debe9e93824bd..a38f4fe5dc596 100644 --- a/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile +++ b/src/test/run-make-fulldeps/long-linker-command-lines-cmd-exe/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs -g diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile index 5876fbc94bc98..00199ca970d3d 100644 --- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile +++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs -g -O diff --git a/src/test/run-make-fulldeps/longjmp-across-rust/Makefile b/src/test/run-make-fulldeps/longjmp-across-rust/Makefile index 9d71ed8fcf3ab..848638d82dd6e 100644 --- a/src/test/run-make-fulldeps/longjmp-across-rust/Makefile +++ b/src/test/run-make-fulldeps/longjmp-across-rust/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,foo) $(RUSTC) main.rs diff --git a/src/test/run-make-fulldeps/ls-metadata/Makefile b/src/test/run-make-fulldeps/ls-metadata/Makefile index fc3f5bce0cda2..e0f916a248e9b 100644 --- a/src/test/run-make-fulldeps/ls-metadata/Makefile +++ b/src/test/run-make-fulldeps/ls-metadata/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/lto-dylib-dep/Makefile b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile index ab8ee6c2ef7e1..41487b23c748f 100644 --- a/src/test/run-make-fulldeps/lto-dylib-dep/Makefile +++ b/src/test/run-make-fulldeps/lto-dylib-dep/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that we don't run into an assertion when using a Rust dylib dependency # while compiling with full LTO. diff --git a/src/test/run-make-fulldeps/lto-empty/Makefile b/src/test/run-make-fulldeps/lto-empty/Makefile index 345d10bc4b9ea..b4345ba188321 100644 --- a/src/test/run-make-fulldeps/lto-empty/Makefile +++ b/src/test/run-make-fulldeps/lto-empty/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cdylib-fat cdylib-thin diff --git a/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile b/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile index 25afad92adb09..e576ee37cf715 100644 --- a/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile +++ b/src/test/run-make-fulldeps/lto-no-link-whole-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,foo) $(call NATIVE_STATICLIB,bar) $(RUSTC) lib1.rs diff --git a/src/test/run-make-fulldeps/lto-readonly-lib/Makefile b/src/test/run-make-fulldeps/lto-readonly-lib/Makefile index 0afbbc3450ac7..a20ecea88ea1c 100644 --- a/src/test/run-make-fulldeps/lto-readonly-lib/Makefile +++ b/src/test/run-make-fulldeps/lto-readonly-lib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) lib.rs diff --git a/src/test/run-make-fulldeps/lto-smoke-c/Makefile b/src/test/run-make-fulldeps/lto-smoke-c/Makefile index 0f61f5de938bc..7c6ee3be84950 100644 --- a/src/test/run-make-fulldeps/lto-smoke-c/Makefile +++ b/src/test/run-make-fulldeps/lto-smoke-c/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Apparently older versions of GCC segfault if -g is passed... CC := $(CC:-g=) diff --git a/src/test/run-make-fulldeps/lto-smoke/Makefile b/src/test/run-make-fulldeps/lto-smoke/Makefile index 9b1dc2550b21b..8bce708b44b0b 100644 --- a/src/test/run-make-fulldeps/lto-smoke/Makefile +++ b/src/test/run-make-fulldeps/lto-smoke/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: noparam bool_true bool_false thin fat diff --git a/src/test/run-make-fulldeps/manual-crate-name/Makefile b/src/test/run-make-fulldeps/manual-crate-name/Makefile index 1d1419997a21b..c00e20c7c57d6 100644 --- a/src/test/run-make-fulldeps/manual-crate-name/Makefile +++ b/src/test/run-make-fulldeps/manual-crate-name/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --crate-name foo bar.rs diff --git a/src/test/run-make-fulldeps/manual-link/Makefile b/src/test/run-make-fulldeps/manual-link/Makefile index dccf0d99b0f82..401f6eb440a58 100644 --- a/src/test/run-make-fulldeps/manual-link/Makefile +++ b/src/test/run-make-fulldeps/manual-link/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(TMPDIR)/libbar.a $(RUSTC) foo.rs -lstatic=bar diff --git a/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile index e7268311b1317..ca0ab8e9e5f41 100644 --- a/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile +++ b/src/test/run-make-fulldeps/many-crates-but-no-match/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Modelled after ui/changing-crates.rs test, but this one puts # more than one (mismatching) candidate crate into the search path, diff --git a/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile b/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile index 3ffbba9444bc2..dc6b10f4e9db2 100644 --- a/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile +++ b/src/test/run-make-fulldeps/metadata-flag-frobs-symbols/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs -C metadata=a -C extra-filename=-a diff --git a/src/test/run-make-fulldeps/min-global-align/Makefile b/src/test/run-make-fulldeps/min-global-align/Makefile index 621027470040d..82f38749e0092 100644 --- a/src/test/run-make-fulldeps/min-global-align/Makefile +++ b/src/test/run-make-fulldeps/min-global-align/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-linux diff --git a/src/test/run-make-fulldeps/mismatching-target-triples/Makefile b/src/test/run-make-fulldeps/mismatching-target-triples/Makefile index 1636e41b05652..409388e041478 100644 --- a/src/test/run-make-fulldeps/mismatching-target-triples/Makefile +++ b/src/test/run-make-fulldeps/mismatching-target-triples/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Issue #10814 # diff --git a/src/test/run-make-fulldeps/missing-crate-dependency/Makefile b/src/test/run-make-fulldeps/missing-crate-dependency/Makefile index b5a5bf492abe5..7c271ab8a90de 100644 --- a/src/test/run-make-fulldeps/missing-crate-dependency/Makefile +++ b/src/test/run-make-fulldeps/missing-crate-dependency/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --crate-type=rlib crateA.rs diff --git a/src/test/run-make-fulldeps/mixing-deps/Makefile b/src/test/run-make-fulldeps/mixing-deps/Makefile index 0e52d4a8befba..956e704ee168e 100644 --- a/src/test/run-make-fulldeps/mixing-deps/Makefile +++ b/src/test/run-make-fulldeps/mixing-deps/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) both.rs -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/mixing-formats/Makefile b/src/test/run-make-fulldeps/mixing-formats/Makefile index 48257669baf94..b27e54257f9c1 100644 --- a/src/test/run-make-fulldeps/mixing-formats/Makefile +++ b/src/test/run-make-fulldeps/mixing-formats/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Testing various mixings of rlibs and dylibs. Makes sure that it's possible to # link an rlib to a dylib. The dependency tree among the file looks like: diff --git a/src/test/run-make-fulldeps/mixing-libs/Makefile b/src/test/run-make-fulldeps/mixing-libs/Makefile index babeeef164dd4..39cc0708ca1ea 100644 --- a/src/test/run-make-fulldeps/mixing-libs/Makefile +++ b/src/test/run-make-fulldeps/mixing-libs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) rlib.rs diff --git a/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile b/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile index 1095a047dd178..a5f019f244e2a 100644 --- a/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile +++ b/src/test/run-make-fulldeps/msvc-opt-minsize/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs -Copt-level=z 2>&1 diff --git a/src/test/run-make-fulldeps/multiple-emits/Makefile b/src/test/run-make-fulldeps/multiple-emits/Makefile index e126422835cae..d1f297644854f 100644 --- a/src/test/run-make-fulldeps/multiple-emits/Makefile +++ b/src/test/run-make-fulldeps/multiple-emits/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --emit=asm,llvm-ir -o $(TMPDIR)/out 2>&1 diff --git a/src/test/run-make-fulldeps/no-builtins-lto/Makefile b/src/test/run-make-fulldeps/no-builtins-lto/Makefile index 2e41be39d5d00..c8f05d9918b91 100644 --- a/src/test/run-make-fulldeps/no-builtins-lto/Makefile +++ b/src/test/run-make-fulldeps/no-builtins-lto/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # Compile a `#![no_builtins]` rlib crate diff --git a/src/test/run-make-fulldeps/no-duplicate-libs/Makefile b/src/test/run-make-fulldeps/no-duplicate-libs/Makefile index 13d8366c60ab9..b05aff7826e09 100644 --- a/src/test/run-make-fulldeps/no-duplicate-libs/Makefile +++ b/src/test/run-make-fulldeps/no-duplicate-libs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk ifdef IS_MSVC # FIXME(#27979) diff --git a/src/test/run-make-fulldeps/no-intermediate-extras/Makefile b/src/test/run-make-fulldeps/no-intermediate-extras/Makefile index 258cbf04c611d..4116aac1b8f0b 100644 --- a/src/test/run-make-fulldeps/no-intermediate-extras/Makefile +++ b/src/test/run-make-fulldeps/no-intermediate-extras/Makefile @@ -1,6 +1,6 @@ # Regression test for issue #10973 --include ../tools.mk +include ../tools.mk all: $(RUSTC) --crate-type=rlib --test foo.rs diff --git a/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile b/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile index 903349152dfd2..effcfc94cc5ee 100644 --- a/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile +++ b/src/test/run-make-fulldeps/obey-crate-type-flag/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # check that rustc builds all crate_type attributes # delete rlib diff --git a/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile b/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile index 74e5dcfcf36c2..45221356cd97f 100644 --- a/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile +++ b/src/test/run-make-fulldeps/output-filename-conflicts-with-directory/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cp foo.rs $(TMPDIR)/foo.rs diff --git a/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile b/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile index 6377038b7be74..33069c06f5ade 100644 --- a/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile +++ b/src/test/run-make-fulldeps/output-filename-overwrites-input/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cp foo.rs $(TMPDIR)/foo diff --git a/src/test/run-make-fulldeps/output-type-permutations/Makefile b/src/test/run-make-fulldeps/output-type-permutations/Makefile index b6e0cbaf5ddc7..791606c643b14 100644 --- a/src/test/run-make-fulldeps/output-type-permutations/Makefile +++ b/src/test/run-make-fulldeps/output-type-permutations/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --crate-type=rlib,dylib,staticlib diff --git a/src/test/run-make-fulldeps/output-with-hyphens/Makefile b/src/test/run-make-fulldeps/output-with-hyphens/Makefile index 69a286f0b74f8..365fb6e591a91 100644 --- a/src/test/run-make-fulldeps/output-with-hyphens/Makefile +++ b/src/test/run-make-fulldeps/output-with-hyphens/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo-bar.rs --crate-type bin diff --git a/src/test/run-make-fulldeps/override-aliased-flags/Makefile b/src/test/run-make-fulldeps/override-aliased-flags/Makefile index bea610eeb9fd1..186b8c7c85ead 100644 --- a/src/test/run-make-fulldeps/override-aliased-flags/Makefile +++ b/src/test/run-make-fulldeps/override-aliased-flags/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # FIXME: it would be good to check that it's actually the rightmost flags # that are used when multiple flags are specified, but I can't think of a diff --git a/src/test/run-make-fulldeps/panic-impl-transitive/Makefile b/src/test/run-make-fulldeps/panic-impl-transitive/Makefile index 1714578b2ba28..c3192efcb5a08 100644 --- a/src/test/run-make-fulldeps/panic-impl-transitive/Makefile +++ b/src/test/run-make-fulldeps/panic-impl-transitive/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # NOTE we use --emit=llvm-ir to avoid running the linker (linking will fail because there's no main # in this crate) diff --git a/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile b/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile index f3d9357865c16..42d3c977f757d 100644 --- a/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile +++ b/src/test/run-make-fulldeps/pass-non-c-like-enum-to-c/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) nonclike.rs -L$(TMPDIR) -ltest diff --git a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile index 9773e3f1fdfc4..c60206a1f341c 100644 --- a/src/test/run-make-fulldeps/pgo-branch-weights/Makefile +++ b/src/test/run-make-fulldeps/pgo-branch-weights/Makefile @@ -4,7 +4,7 @@ # FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works # properly. Since we only have GCC on the CI ignore the test for now. --include ../tools.mk +include ../tools.mk # For some very small programs GNU ld seems to not properly handle # instrumentation sections correctly. Neither Gold nor LLD have that problem. diff --git a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile index a7d5c56163257..3f2f6a838b51c 100644 --- a/src/test/run-make-fulldeps/pgo-gen-lto/Makefile +++ b/src/test/run-make-fulldeps/pgo-gen-lto/Makefile @@ -4,7 +4,7 @@ # FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works # properly. Since we only have GCC on the CI ignore the test for now. --include ../tools.mk +include ../tools.mk COMPILE_FLAGS=-Copt-level=3 -Clto=fat -Cprofile-generate="$(TMPDIR)" diff --git a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile index 425bfc28a9766..7f72b11b611ed 100644 --- a/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile +++ b/src/test/run-make-fulldeps/pgo-gen-no-imp-symbols/Makefile @@ -1,6 +1,6 @@ # needs-profiler-support --include ../tools.mk +include ../tools.mk COMPILE_FLAGS=-O -Ccodegen-units=1 -Cprofile-generate="$(TMPDIR)" diff --git a/src/test/run-make-fulldeps/pgo-gen/Makefile b/src/test/run-make-fulldeps/pgo-gen/Makefile index 6533355be3418..4623a74957b0f 100644 --- a/src/test/run-make-fulldeps/pgo-gen/Makefile +++ b/src/test/run-make-fulldeps/pgo-gen/Makefile @@ -4,7 +4,7 @@ # FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works # properly. Since we only have GCC on the CI ignore the test for now. --include ../tools.mk +include ../tools.mk COMPILE_FLAGS=-g -Cprofile-generate="$(TMPDIR)" diff --git a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile index c0195dcbb31be..45302215cc64e 100644 --- a/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile +++ b/src/test/run-make-fulldeps/pgo-indirect-call-promotion/Makefile @@ -4,7 +4,7 @@ # FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works # properly. Since we only have GCC on the CI ignore the test for now. --include ../tools.mk +include ../tools.mk all: # We don't compile `opaque` with either optimizations or instrumentation. diff --git a/src/test/run-make-fulldeps/pgo-use/Makefile b/src/test/run-make-fulldeps/pgo-use/Makefile index d7863c9c587a5..3bac9b77aa39c 100644 --- a/src/test/run-make-fulldeps/pgo-use/Makefile +++ b/src/test/run-make-fulldeps/pgo-use/Makefile @@ -4,7 +4,7 @@ # FIXME(mati865): MinGW GCC miscompiles compiler-rt profiling library but with Clang it works # properly. Since we only have GCC on the CI ignore the test for now. --include ../tools.mk +include ../tools.mk # This test makes sure that PGO profiling data leads to cold functions being # marked as `cold` and hot functions with `inlinehint`. diff --git a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile index d0e22cfef4c2a..7acea03802cb3 100644 --- a/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile +++ b/src/test/run-make-fulldeps/pointer-auth-link-with-c/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-aarch64 diff --git a/src/test/run-make-fulldeps/prefer-dylib/Makefile b/src/test/run-make-fulldeps/prefer-dylib/Makefile index bd44feecf2a5d..3817ca195eb2d 100644 --- a/src/test/run-make-fulldeps/prefer-dylib/Makefile +++ b/src/test/run-make-fulldeps/prefer-dylib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/prefer-rlib/Makefile b/src/test/run-make-fulldeps/prefer-rlib/Makefile index c6a239eef08e2..adc345d760da5 100644 --- a/src/test/run-make-fulldeps/prefer-rlib/Makefile +++ b/src/test/run-make-fulldeps/prefer-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) bar.rs --crate-type=dylib --crate-type=rlib diff --git a/src/test/run-make-fulldeps/pretty-expanded/Makefile b/src/test/run-make-fulldeps/pretty-expanded/Makefile index e721c5afdd7bc..5a0097a83511f 100644 --- a/src/test/run-make-fulldeps/pretty-expanded/Makefile +++ b/src/test/run-make-fulldeps/pretty-expanded/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -o $(TMPDIR)/input.expanded.rs -Zunpretty=expanded input.rs diff --git a/src/test/run-make-fulldeps/pretty-print-to-file/Makefile b/src/test/run-make-fulldeps/pretty-print-to-file/Makefile index b224c52fcadde..ca11b8c47f06f 100644 --- a/src/test/run-make-fulldeps/pretty-print-to-file/Makefile +++ b/src/test/run-make-fulldeps/pretty-print-to-file/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -o $(TMPDIR)/input.out -Zunpretty=normal input.rs diff --git a/src/test/run-make-fulldeps/print-cfg/Makefile b/src/test/run-make-fulldeps/print-cfg/Makefile index 5472baae3f2b0..126f5768c90f2 100644 --- a/src/test/run-make-fulldeps/print-cfg/Makefile +++ b/src/test/run-make-fulldeps/print-cfg/Makefile @@ -1,6 +1,6 @@ # needs-llvm-components: x86 arm --include ../tools.mk +include ../tools.mk all: default $(RUSTC) --target x86_64-pc-windows-gnu --print cfg | $(CGREP) windows diff --git a/src/test/run-make-fulldeps/print-target-list/Makefile b/src/test/run-make-fulldeps/print-target-list/Makefile index 5f10f2aa3b0f4..f23c40d4281e3 100644 --- a/src/test/run-make-fulldeps/print-target-list/Makefile +++ b/src/test/run-make-fulldeps/print-target-list/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Checks that all the targets returned by `rustc --print target-list` are valid # target specifications diff --git a/src/test/run-make-fulldeps/profile/Makefile b/src/test/run-make-fulldeps/profile/Makefile index 04d382b475ed2..fffc051adbf8e 100644 --- a/src/test/run-make-fulldeps/profile/Makefile +++ b/src/test/run-make-fulldeps/profile/Makefile @@ -1,6 +1,6 @@ # needs-profiler-support --include ../tools.mk +include ../tools.mk all: $(RUSTC) -g -Z profile test.rs diff --git a/src/test/run-make-fulldeps/prune-link-args/Makefile b/src/test/run-make-fulldeps/prune-link-args/Makefile index 3589f98e7e5c8..a359dc5aef102 100644 --- a/src/test/run-make-fulldeps/prune-link-args/Makefile +++ b/src/test/run-make-fulldeps/prune-link-args/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows diff --git a/src/test/run-make-fulldeps/redundant-libs/Makefile b/src/test/run-make-fulldeps/redundant-libs/Makefile index e09841fb42e18..b2dff05d1639a 100644 --- a/src/test/run-make-fulldeps/redundant-libs/Makefile +++ b/src/test/run-make-fulldeps/redundant-libs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows-msvc diff --git a/src/test/run-make-fulldeps/relocation-model/Makefile b/src/test/run-make-fulldeps/relocation-model/Makefile index 485ecbb4b5a59..a31dbfd916772 100644 --- a/src/test/run-make-fulldeps/relocation-model/Makefile +++ b/src/test/run-make-fulldeps/relocation-model/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: others $(RUSTC) -C relocation-model=dynamic-no-pic foo.rs diff --git a/src/test/run-make-fulldeps/relro-levels/Makefile b/src/test/run-make-fulldeps/relro-levels/Makefile index aacb5acb7a3af..6176fc1a58954 100644 --- a/src/test/run-make-fulldeps/relro-levels/Makefile +++ b/src/test/run-make-fulldeps/relro-levels/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-linux # diff --git a/src/test/run-make-fulldeps/remap-path-prefix/Makefile b/src/test/run-make-fulldeps/remap-path-prefix/Makefile index 86785c59509df..2a7378fdf9ed5 100644 --- a/src/test/run-make-fulldeps/remap-path-prefix/Makefile +++ b/src/test/run-make-fulldeps/remap-path-prefix/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows diff --git a/src/test/run-make-fulldeps/reproducible-build-2/Makefile b/src/test/run-make-fulldeps/reproducible-build-2/Makefile index fd94516fbbaf6..1df5e102ce36c 100644 --- a/src/test/run-make-fulldeps/reproducible-build-2/Makefile +++ b/src/test/run-make-fulldeps/reproducible-build-2/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-musl # ignore-windows diff --git a/src/test/run-make-fulldeps/reproducible-build/Makefile b/src/test/run-make-fulldeps/reproducible-build/Makefile index adccc15356848..642a480815b7b 100644 --- a/src/test/run-make-fulldeps/reproducible-build/Makefile +++ b/src/test/run-make-fulldeps/reproducible-build/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-musl # Objects are reproducible but their path is not. diff --git a/src/test/run-make-fulldeps/resolve-rename/Makefile b/src/test/run-make-fulldeps/resolve-rename/Makefile index 4b0c36d01b7a8..00f83a5d6b2d4 100644 --- a/src/test/run-make-fulldeps/resolve-rename/Makefile +++ b/src/test/run-make-fulldeps/resolve-rename/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -C extra-filename=-hash foo.rs diff --git a/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile b/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile index f3d9357865c16..42d3c977f757d 100644 --- a/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile +++ b/src/test/run-make-fulldeps/return-non-c-like-enum-from-c/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,test) $(RUSTC) nonclike.rs -L$(TMPDIR) -ltest diff --git a/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile b/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile index 5b5d620efe655..513311c828946 100644 --- a/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile +++ b/src/test/run-make-fulldeps/return-non-c-like-enum/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) --crate-type=staticlib nonclike.rs diff --git a/src/test/run-make-fulldeps/rlib-chain/Makefile b/src/test/run-make-fulldeps/rlib-chain/Makefile index 30b6811a388ca..236943a2a3b35 100644 --- a/src/test/run-make-fulldeps/rlib-chain/Makefile +++ b/src/test/run-make-fulldeps/rlib-chain/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) m1.rs diff --git a/src/test/run-make-fulldeps/rustdoc-determinism/Makefile b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile index 0534c2c383145..a3ef169067184 100644 --- a/src/test/run-make-fulldeps/rustdoc-determinism/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Assert that the search index is generated deterministically, regardless of the # order that crates are documented in. diff --git a/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile b/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile index c9d41f0ec3b78..2dc30f56b833f 100644 --- a/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-error-lines/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that hir-tree output doesn't crash and includes # the string constant we would expect to see. diff --git a/src/test/run-make-fulldeps/rustdoc-io-error/Makefile b/src/test/run-make-fulldeps/rustdoc-io-error/Makefile index f95fa88d41cf7..27f5ecf94aba3 100644 --- a/src/test/run-make-fulldeps/rustdoc-io-error/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-io-error/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # This test verifies that rustdoc doesn't ICE when it encounters an IO error # while generating files. Ideally this would be a rustdoc-ui test, so we could diff --git a/src/test/run-make-fulldeps/rustdoc-map-file/Makefile b/src/test/run-make-fulldeps/rustdoc-map-file/Makefile index ce977fa0cea55..5cbf7747af638 100644 --- a/src/test/run-make-fulldeps/rustdoc-map-file/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-map-file/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTDOC) -Z unstable-options --generate-redirect-map foo.rs -o "$(TMPDIR)/out" diff --git a/src/test/run-make-fulldeps/rustdoc-output-path/Makefile b/src/test/run-make-fulldeps/rustdoc-output-path/Makefile index 8ce1c699526cd..8f5cda9e56e9f 100644 --- a/src/test/run-make-fulldeps/rustdoc-output-path/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-output-path/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTDOC) -o "$(TMPDIR)/foo/bar/doc" foo.rs diff --git a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile index 4934e875da6f1..c857aa4b9937a 100644 --- a/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-scrape-examples-macros/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUTPUT_DIR := "$(TMPDIR)/rustdoc" DYLIB_NAME := $(shell echo | $(RUSTC) --crate-name foobar_macro --crate-type dylib --print file-names -) diff --git a/src/test/run-make-fulldeps/rustdoc-themes/Makefile b/src/test/run-make-fulldeps/rustdoc-themes/Makefile index f3d07b25c47f8..a6d9a43addf69 100644 --- a/src/test/run-make-fulldeps/rustdoc-themes/Makefile +++ b/src/test/run-make-fulldeps/rustdoc-themes/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that rustdoc will properly load in a theme file and display it in the theme selector. diff --git a/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile index e72fe5a50913a..691585268bfe9 100644 --- a/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile +++ b/src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile @@ -1,7 +1,7 @@ # needs-sanitizer-support # needs-sanitizer-address --include ../tools.mk +include ../tools.mk LOG := $(TMPDIR)/log.txt diff --git a/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile index b9a3f829555af..b0a91e5b197d7 100644 --- a/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile +++ b/src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile @@ -1,7 +1,7 @@ # needs-sanitizer-support # needs-sanitizer-address --include ../tools.mk +include ../tools.mk LOG := $(TMPDIR)/log.txt diff --git a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile index 4894f65b114cd..7b1a286ed121d 100644 --- a/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile +++ b/src/test/run-make-fulldeps/sanitizer-staticlib-link/Makefile @@ -1,7 +1,7 @@ # needs-sanitizer-support # needs-sanitizer-address --include ../tools.mk +include ../tools.mk # This test first builds a staticlib with AddressSanitizer and checks that # linking it to an executable fails due to the missing sanitizer runtime. diff --git a/src/test/run-make-fulldeps/save-analysis-fail/Makefile b/src/test/run-make-fulldeps/save-analysis-fail/Makefile index f29f907cf387e..69a2b2746948b 100644 --- a/src/test/run-make-fulldeps/save-analysis-fail/Makefile +++ b/src/test/run-make-fulldeps/save-analysis-fail/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: code krate2: krate2.rs $(RUSTC) $< diff --git a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile index 36288c4b870e7..30f57034bba55 100644 --- a/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile +++ b/src/test/run-make-fulldeps/save-analysis-rfc2126/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: extern_absolute_paths.rs krate2 $(RUSTC) extern_absolute_paths.rs -Zsave-analysis --edition=2018 --extern krate2 diff --git a/src/test/run-make-fulldeps/save-analysis/Makefile b/src/test/run-make-fulldeps/save-analysis/Makefile index 7296fb9cc5936..b8b6be13dbd76 100644 --- a/src/test/run-make-fulldeps/save-analysis/Makefile +++ b/src/test/run-make-fulldeps/save-analysis/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: code krate2: krate2.rs $(RUSTC) $< diff --git a/src/test/run-make-fulldeps/separate-link-fail/Makefile b/src/test/run-make-fulldeps/separate-link-fail/Makefile index c759f42a2351e..bfd18fbf972d6 100644 --- a/src/test/run-make-fulldeps/separate-link-fail/Makefile +++ b/src/test/run-make-fulldeps/separate-link-fail/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: echo 'fn main(){}' > $(TMPDIR)/main.rs diff --git a/src/test/run-make-fulldeps/separate-link/Makefile b/src/test/run-make-fulldeps/separate-link/Makefile index 060484e89f930..3ccdb6275d158 100644 --- a/src/test/run-make-fulldeps/separate-link/Makefile +++ b/src/test/run-make-fulldeps/separate-link/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: echo 'fn main(){}' | $(RUSTC) -Z no-link - diff --git a/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile b/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile index 77d1d71e9b269..df289d0b0b1a2 100644 --- a/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile +++ b/src/test/run-make-fulldeps/sepcomp-cci-copies/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Check that cross-crate inlined items are inlined in all compilation units # that refer to them, and not in any other compilation units. diff --git a/src/test/run-make-fulldeps/sepcomp-inlining/Makefile b/src/test/run-make-fulldeps/sepcomp-inlining/Makefile index 1d20d940000f4..327aeb75e5eda 100644 --- a/src/test/run-make-fulldeps/sepcomp-inlining/Makefile +++ b/src/test/run-make-fulldeps/sepcomp-inlining/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that #[inline] functions still get inlined across compilation unit # boundaries. Compilation should produce three IR files, but only the two diff --git a/src/test/run-make-fulldeps/sepcomp-separate/Makefile b/src/test/run-make-fulldeps/sepcomp-separate/Makefile index 5b8bdb0fad8cd..62cf54a88fbe9 100644 --- a/src/test/run-make-fulldeps/sepcomp-separate/Makefile +++ b/src/test/run-make-fulldeps/sepcomp-separate/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Test that separate compilation actually puts code into separate compilation # units. `foo.rs` defines `magic_fn` in three different modules, which should diff --git a/src/test/run-make-fulldeps/share-generics-dylib/Makefile b/src/test/run-make-fulldeps/share-generics-dylib/Makefile index 282cb2461f69a..065fb574c3cba 100644 --- a/src/test/run-make-fulldeps/share-generics-dylib/Makefile +++ b/src/test/run-make-fulldeps/share-generics-dylib/Makefile @@ -9,7 +9,7 @@ # # This is regression test for https://github.com/rust-lang/rust/issues/67276. --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk COMMON_ARGS=-Cprefer-dynamic -Zshare-generics=yes -Ccodegen-units=1 -Csymbol-mangling-version=v0 diff --git a/src/test/run-make-fulldeps/simd-ffi/Makefile b/src/test/run-make-fulldeps/simd-ffi/Makefile index e9c974a013732..297353470411f 100644 --- a/src/test/run-make-fulldeps/simd-ffi/Makefile +++ b/src/test/run-make-fulldeps/simd-ffi/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk TARGETS = ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm) diff --git a/src/test/run-make-fulldeps/simple-dylib/Makefile b/src/test/run-make-fulldeps/simple-dylib/Makefile index 26730820fea2b..5dda5d66d1c84 100644 --- a/src/test/run-make-fulldeps/simple-dylib/Makefile +++ b/src/test/run-make-fulldeps/simple-dylib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) bar.rs --crate-type=dylib -C prefer-dynamic $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/simple-rlib/Makefile b/src/test/run-make-fulldeps/simple-rlib/Makefile index 7b156cb874880..d912b8a7bab1f 100644 --- a/src/test/run-make-fulldeps/simple-rlib/Makefile +++ b/src/test/run-make-fulldeps/simple-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) bar.rs --crate-type=rlib $(RUSTC) foo.rs diff --git a/src/test/run-make-fulldeps/split-debuginfo/Makefile b/src/test/run-make-fulldeps/split-debuginfo/Makefile index e2dc64d8ce2dd..371fb5ffba2a0 100644 --- a/src/test/run-make-fulldeps/split-debuginfo/Makefile +++ b/src/test/run-make-fulldeps/split-debuginfo/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: off packed unpacked diff --git a/src/test/run-make-fulldeps/stable-symbol-names/Makefile b/src/test/run-make-fulldeps/stable-symbol-names/Makefile index 451af809b2223..bbfb8e3888171 100644 --- a/src/test/run-make-fulldeps/stable-symbol-names/Makefile +++ b/src/test/run-make-fulldeps/stable-symbol-names/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # The following command will: # 1. dump the symbols of a library using `nm` diff --git a/src/test/run-make-fulldeps/static-dylib-by-default/Makefile b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile index 6409aa66ae061..eedd0b320920a 100644 --- a/src/test/run-make-fulldeps/static-dylib-by-default/Makefile +++ b/src/test/run-make-fulldeps/static-dylib-by-default/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk TO_LINK := $(call DYLIB,bar) ifdef IS_MSVC diff --git a/src/test/run-make-fulldeps/static-extern-type/Makefile b/src/test/run-make-fulldeps/static-extern-type/Makefile index 5879fc0ce7781..e9aa95e63a05f 100644 --- a/src/test/run-make-fulldeps/static-extern-type/Makefile +++ b/src/test/run-make-fulldeps/static-extern-type/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(call NATIVE_STATICLIB,define-foo) $(RUSTC) -ldefine-foo use-foo.rs diff --git a/src/test/run-make-fulldeps/static-unwinding/Makefile b/src/test/run-make-fulldeps/static-unwinding/Makefile index cb0397442658d..9c755d4ab1819 100644 --- a/src/test/run-make-fulldeps/static-unwinding/Makefile +++ b/src/test/run-make-fulldeps/static-unwinding/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) lib.rs diff --git a/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile b/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile index 92a278825c242..fcbf87758fb9c 100644 --- a/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile +++ b/src/test/run-make-fulldeps/staticlib-blank-lib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(AR) crus $(TMPDIR)/libfoo.a foo.rs diff --git a/src/test/run-make-fulldeps/std-core-cycle/Makefile b/src/test/run-make-fulldeps/std-core-cycle/Makefile index ce3b2d46bbc7b..4f25286376790 100644 --- a/src/test/run-make-fulldeps/std-core-cycle/Makefile +++ b/src/test/run-make-fulldeps/std-core-cycle/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk ifeq ($(UNAME),Darwin) FLAGS := diff --git a/src/test/run-make-fulldeps/stdin-non-utf8/Makefile b/src/test/run-make-fulldeps/stdin-non-utf8/Makefile index 7948c442616e3..709d4cf140895 100644 --- a/src/test/run-make-fulldeps/stdin-non-utf8/Makefile +++ b/src/test/run-make-fulldeps/stdin-non-utf8/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cp non-utf8 $(TMPDIR)/non-utf.rs diff --git a/src/test/run-make-fulldeps/suspicious-library/Makefile b/src/test/run-make-fulldeps/suspicious-library/Makefile index 12f437075fbd4..2af9e85c228fd 100644 --- a/src/test/run-make-fulldeps/suspicious-library/Makefile +++ b/src/test/run-make-fulldeps/suspicious-library/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs -C prefer-dynamic diff --git a/src/test/run-make-fulldeps/symbols-include-type-name/Makefile b/src/test/run-make-fulldeps/symbols-include-type-name/Makefile index 0850a2633e5d8..ac26a852e36c1 100644 --- a/src/test/run-make-fulldeps/symbols-include-type-name/Makefile +++ b/src/test/run-make-fulldeps/symbols-include-type-name/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # Check that symbol names for methods include type names, instead of . diff --git a/src/test/run-make-fulldeps/symlinked-extern/Makefile b/src/test/run-make-fulldeps/symlinked-extern/Makefile index e5061fddead0b..058f43e857a2b 100644 --- a/src/test/run-make-fulldeps/symlinked-extern/Makefile +++ b/src/test/run-make-fulldeps/symlinked-extern/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # `ln` is actually `cp` on msys. diff --git a/src/test/run-make-fulldeps/symlinked-libraries/Makefile b/src/test/run-make-fulldeps/symlinked-libraries/Makefile index 618ae87bfe3c5..576bf7e54bed8 100644 --- a/src/test/run-make-fulldeps/symlinked-libraries/Makefile +++ b/src/test/run-make-fulldeps/symlinked-libraries/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # `ln` is actually `cp` on msys. diff --git a/src/test/run-make-fulldeps/symlinked-rlib/Makefile b/src/test/run-make-fulldeps/symlinked-rlib/Makefile index 996989ce4d893..49d3f220a353f 100644 --- a/src/test/run-make-fulldeps/symlinked-rlib/Makefile +++ b/src/test/run-make-fulldeps/symlinked-rlib/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows # `ln` is actually `cp` on msys. diff --git a/src/test/run-make-fulldeps/target-cpu-native/Makefile b/src/test/run-make-fulldeps/target-cpu-native/Makefile index d152e9f76d3d6..eb3ca1e13aa62 100644 --- a/src/test/run-make-fulldeps/target-cpu-native/Makefile +++ b/src/test/run-make-fulldeps/target-cpu-native/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-linux # only-x86_64 diff --git a/src/test/run-make-fulldeps/target-specs/Makefile b/src/test/run-make-fulldeps/target-specs/Makefile index fb95ee5539acd..a33f5368e3cfd 100644 --- a/src/test/run-make-fulldeps/target-specs/Makefile +++ b/src/test/run-make-fulldeps/target-specs/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) foo.rs --target=my-awesome-platform.json --crate-type=lib --emit=asm $(CGREP) -v morestack < $(TMPDIR)/foo.s diff --git a/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile b/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile index 9868fc1d41700..451f03d66cd23 100644 --- a/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile +++ b/src/test/run-make-fulldeps/target-without-atomic-cas/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # The target used below doesn't support atomic CAS operations. Verify that's the case all: diff --git a/src/test/run-make-fulldeps/test-harness/Makefile b/src/test/run-make-fulldeps/test-harness/Makefile index 39477c07ced7c..1fe059b07d2a0 100644 --- a/src/test/run-make-fulldeps/test-harness/Makefile +++ b/src/test/run-make-fulldeps/test-harness/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # check that #[cfg_attr(..., ignore)] does the right thing. diff --git a/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile b/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile index 802b3df460a79..9f4be71263465 100644 --- a/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile +++ b/src/test/run-make-fulldeps/type-mismatch-same-crate-name/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # compile two different versions of crateA diff --git a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile index 838b1a2719b9f..6ae53afad207b 100644 --- a/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile +++ b/src/test/run-make-fulldeps/use-extern-for-plugins/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-freebsd # ignore-openbsd diff --git a/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile b/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile index fc39691c507e0..37cd6283c0a6e 100644 --- a/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile +++ b/src/test/run-make-fulldeps/use-suggestions-rust-2018/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) ep-nested-lib.rs diff --git a/src/test/run-make-fulldeps/used-cdylib-macos/Makefile b/src/test/run-make-fulldeps/used-cdylib-macos/Makefile index 4828d9c8aad2c..38a4c31c7b3af 100644 --- a/src/test/run-make-fulldeps/used-cdylib-macos/Makefile +++ b/src/test/run-make-fulldeps/used-cdylib-macos/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-macos # diff --git a/src/test/run-make-fulldeps/used/Makefile b/src/test/run-make-fulldeps/used/Makefile index 4d904472931ec..e80eb9e402086 100644 --- a/src/test/run-make-fulldeps/used/Makefile +++ b/src/test/run-make-fulldeps/used/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # ignore-windows-msvc diff --git a/src/test/run-make-fulldeps/version/Makefile b/src/test/run-make-fulldeps/version/Makefile index 23e14a9cb93de..3a130545d69d3 100644 --- a/src/test/run-make-fulldeps/version/Makefile +++ b/src/test/run-make-fulldeps/version/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) -V diff --git a/src/test/run-make-fulldeps/volatile-intrinsics/Makefile b/src/test/run-make-fulldeps/volatile-intrinsics/Makefile index acbadbef9fb4a..2a78c7b9cfe17 100644 --- a/src/test/run-make-fulldeps/volatile-intrinsics/Makefile +++ b/src/test/run-make-fulldeps/volatile-intrinsics/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: # The tests must pass... diff --git a/src/test/run-make-fulldeps/weird-output-filenames/Makefile b/src/test/run-make-fulldeps/weird-output-filenames/Makefile index f161fe9f8e8df..d3a34e3b46e89 100644 --- a/src/test/run-make-fulldeps/weird-output-filenames/Makefile +++ b/src/test/run-make-fulldeps/weird-output-filenames/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: cp foo.rs $(TMPDIR)/.foo.rs diff --git a/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile b/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile index f6adb6d76279d..8960020fed558 100644 --- a/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile +++ b/src/test/run-make-fulldeps/windows-binary-no-external-deps/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-windows diff --git a/src/test/run-make-fulldeps/windows-spawn/Makefile b/src/test/run-make-fulldeps/windows-spawn/Makefile index c09ce8109e6fd..b6cdb169bab48 100644 --- a/src/test/run-make-fulldeps/windows-spawn/Makefile +++ b/src/test/run-make-fulldeps/windows-spawn/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk # only-windows diff --git a/src/test/run-make-fulldeps/windows-subsystem/Makefile b/src/test/run-make-fulldeps/windows-subsystem/Makefile index 34fb5db32f95a..78c4e2ac1e875 100644 --- a/src/test/run-make-fulldeps/windows-subsystem/Makefile +++ b/src/test/run-make-fulldeps/windows-subsystem/Makefile @@ -1,4 +1,4 @@ --include ../tools.mk +include ../tools.mk all: $(RUSTC) windows.rs diff --git a/src/test/run-make/const_fn_mir/Makefile b/src/test/run-make/const_fn_mir/Makefile index 2aa0bc9d45dc9..ad5695093a1a2 100644 --- a/src/test/run-make/const_fn_mir/Makefile +++ b/src/test/run-make/const_fn_mir/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) main.rs --emit=mir -o "$(TMPDIR)"/dump.mir diff --git a/src/test/run-make/coverage-reports/Makefile b/src/test/run-make/coverage-reports/Makefile index 4e75672f27533..cac881ece1296 100644 --- a/src/test/run-make/coverage-reports/Makefile +++ b/src/test/run-make/coverage-reports/Makefile @@ -75,7 +75,7 @@ ifdef RUSTC_BLESS_TEST rm -f expected_* endif --include clear_expected_if_blessed +include clear_expected_if_blessed %: $(SOURCEDIR)/lib/%.rs # Compile the test library with coverage instrumentation diff --git a/src/test/run-make/dep-graph/Makefile b/src/test/run-make/dep-graph/Makefile index 88916022c7c82..ae97b1672ae27 100644 --- a/src/test/run-make/dep-graph/Makefile +++ b/src/test/run-make/dep-graph/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # ignore-cross-compile diff --git a/src/test/run-make/emit-named-files/Makefile b/src/test/run-make/emit-named-files/Makefile index 03eb83b97e383..e081fa4793bb1 100644 --- a/src/test/run-make/emit-named-files/Makefile +++ b/src/test/run-make/emit-named-files/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUT=$(TMPDIR)/emit diff --git a/src/test/run-make/emit-path-unhashed/Makefile b/src/test/run-make/emit-path-unhashed/Makefile index b6b2d8af64800..c144d4aa92f67 100644 --- a/src/test/run-make/emit-path-unhashed/Makefile +++ b/src/test/run-make/emit-path-unhashed/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUT=$(TMPDIR)/emit diff --git a/src/test/run-make/emit-shared-files/Makefile b/src/test/run-make/emit-shared-files/Makefile index 9f46883beaacc..09b4c29c1dd33 100644 --- a/src/test/run-make/emit-shared-files/Makefile +++ b/src/test/run-make/emit-shared-files/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk INVOCATION_ONLY = $(TMPDIR)/invocation-only TOOLCHAIN_ONLY = $(TMPDIR)/toolchain-only diff --git a/src/test/run-make/env-dep-info/Makefile b/src/test/run-make/env-dep-info/Makefile index 25d9a31c2d6ff..1675a61b1673b 100644 --- a/src/test/run-make/env-dep-info/Makefile +++ b/src/test/run-make/env-dep-info/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC` # instead of hardcoding them everywhere they're needed. diff --git a/src/test/run-make/export-executable-symbols/Makefile b/src/test/run-make/export-executable-symbols/Makefile index 5006f9cb8cfea..daa77c99dcdd6 100644 --- a/src/test/run-make/export-executable-symbols/Makefile +++ b/src/test/run-make/export-executable-symbols/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # ignore-wasm32 # ignore-wasm64 diff --git a/src/test/run-make/fmt-write-bloat/Makefile b/src/test/run-make/fmt-write-bloat/Makefile index 26e08086a72a3..07e6e025e08e3 100644 --- a/src/test/run-make/fmt-write-bloat/Makefile +++ b/src/test/run-make/fmt-write-bloat/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # ignore-windows diff --git a/src/test/run-make/issue-10971-temps-dir/Makefile b/src/test/run-make/issue-10971-temps-dir/Makefile index 5ce27192603e2..e589bbffe60b9 100644 --- a/src/test/run-make/issue-10971-temps-dir/Makefile +++ b/src/test/run-make/issue-10971-temps-dir/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Regression test for issue #10971 # Running two invocations in parallel would overwrite each other's temp files. diff --git a/src/test/run-make/issue-47384/Makefile b/src/test/run-make/issue-47384/Makefile index f10365f8c8811..0aadf6c88c98f 100644 --- a/src/test/run-make/issue-47384/Makefile +++ b/src/test/run-make/issue-47384/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-linux # ignore-cross-compile diff --git a/src/test/run-make/issue-71519/Makefile b/src/test/run-make/issue-71519/Makefile index 636665ec1d0c2..4475649ca9272 100644 --- a/src/test/run-make/issue-71519/Makefile +++ b/src/test/run-make/issue-71519/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # needs-rust-lld all: diff --git a/src/test/run-make/issue-85401-static-mir/Makefile b/src/test/run-make/issue-85401-static-mir/Makefile index 5e094cb4d3379..99590166bca3e 100644 --- a/src/test/run-make/issue-85401-static-mir/Makefile +++ b/src/test/run-make/issue-85401-static-mir/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Regression test for issue #85401 # Verify that we do not ICE when trying to access MIR for statics, diff --git a/src/test/run-make/issue-85441/Makefile b/src/test/run-make/issue-85441/Makefile index c7ae708c173c1..f04b07d51fa63 100644 --- a/src/test/run-make/issue-85441/Makefile +++ b/src/test/run-make/issue-85441/Makefile @@ -1,6 +1,6 @@ # only-windows-msvc --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Tests that WS2_32.dll is not unnecessarily linked, see issue #85441 diff --git a/src/test/run-make/issue-88756-default-output/Makefile b/src/test/run-make/issue-88756-default-output/Makefile index cacbcbf3933a4..275c35c262935 100644 --- a/src/test/run-make/issue-88756-default-output/Makefile +++ b/src/test/run-make/issue-88756-default-output/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(BARE_RUSTDOC) 2>&1 | sed -E 's@/nightly/|/beta/|/stable/|/1\.[0-9]+\.[0-9]+/@/$$CHANNEL/@g' | diff - output-default.stdout diff --git a/src/test/run-make/issue-96498/Makefile b/src/test/run-make/issue-96498/Makefile index eae6400aee43a..ce2b1b1ff7c3d 100644 --- a/src/test/run-make/issue-96498/Makefile +++ b/src/test/run-make/issue-96498/Makefile @@ -1,7 +1,7 @@ # only-windows # needs-rust-lld --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # Ensure that LLD can link all: diff --git a/src/test/run-make/libtest-thread-limit/Makefile b/src/test/run-make/libtest-thread-limit/Makefile index 29c1bc71d8704..d43a89e60cab8 100644 --- a/src/test/run-make/libtest-thread-limit/Makefile +++ b/src/test/run-make/libtest-thread-limit/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-linux diff --git a/src/test/run-make/llvm-outputs/Makefile b/src/test/run-make/llvm-outputs/Makefile index d7f67577b04ce..a3f25eba0b2ea 100644 --- a/src/test/run-make/llvm-outputs/Makefile +++ b/src/test/run-make/llvm-outputs/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: echo 'fn main() {}' | $(BARE_RUSTC) - --out-dir=$(TMPDIR)/random_directory_that_does_not_exist_ir/ --emit=llvm-ir diff --git a/src/test/run-make/native-link-modifier-bundle/Makefile b/src/test/run-make/native-link-modifier-bundle/Makefile index e4b0f74ac26ac..7c78d7783e0b6 100644 --- a/src/test/run-make/native-link-modifier-bundle/Makefile +++ b/src/test/run-make/native-link-modifier-bundle/Makefile @@ -1,7 +1,7 @@ # ignore-cross-compile # ignore-windows-msvc --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # We're using the llvm-nm instead of the system nm to ensure it is compatible # with the LLVM bitcode generated by rustc. diff --git a/src/test/run-make/native-link-modifier-whole-archive/Makefile b/src/test/run-make/native-link-modifier-whole-archive/Makefile index 967cb065cad1a..f26bd864ced31 100644 --- a/src/test/run-make/native-link-modifier-whole-archive/Makefile +++ b/src/test/run-make/native-link-modifier-whole-archive/Makefile @@ -8,7 +8,7 @@ # that code would never make it into the final executable and we'd thus be missing some # of the output. --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(TMPDIR)/$(call BIN,directly_linked) \ $(TMPDIR)/$(call BIN,directly_linked_test_plus_whole_archive) \ diff --git a/src/test/run-make/pass-linker-flags-from-dep/Makefile b/src/test/run-make/pass-linker-flags-from-dep/Makefile index 365216b4c35bb..b9426326aea40 100644 --- a/src/test/run-make/pass-linker-flags-from-dep/Makefile +++ b/src/test/run-make/pass-linker-flags-from-dep/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: # Build deps diff --git a/src/test/run-make/pass-linker-flags/Makefile b/src/test/run-make/pass-linker-flags/Makefile index 02b1e2179e189..a3efb8df6ac38 100644 --- a/src/test/run-make/pass-linker-flags/Makefile +++ b/src/test/run-make/pass-linker-flags/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) rs.rs -Z unstable-options -l static=l1 -l link-arg=a1 -l static=l2 -l link-arg=a2 -l dylib=d1 -l link-arg=a3 --print link-args | $(CGREP) -e 'l1.*a1.*l2.*a2.*d1.*a3' diff --git a/src/test/run-make/raw-dylib-alt-calling-convention/Makefile b/src/test/run-make/raw-dylib-alt-calling-convention/Makefile index a254285ab76ce..03f8778d25de6 100644 --- a/src/test/run-make/raw-dylib-alt-calling-convention/Makefile +++ b/src/test/run-make/raw-dylib-alt-calling-convention/Makefile @@ -3,7 +3,7 @@ # only-x86 # only-windows --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) --crate-type lib --crate-name raw_dylib_alt_calling_convention_test lib.rs diff --git a/src/test/run-make/raw-dylib-c/Makefile b/src/test/run-make/raw-dylib-c/Makefile index 713f665078e57..f47ab24f4fbfa 100644 --- a/src/test/run-make/raw-dylib-c/Makefile +++ b/src/test/run-make/raw-dylib-c/Makefile @@ -2,7 +2,7 @@ # only-windows --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs diff --git a/src/test/run-make/raw-dylib-link-ordinal/Makefile b/src/test/run-make/raw-dylib-link-ordinal/Makefile index c9baa3c1ec9ac..b55a94dbc46f2 100644 --- a/src/test/run-make/raw-dylib-link-ordinal/Makefile +++ b/src/test/run-make/raw-dylib-link-ordinal/Makefile @@ -2,7 +2,7 @@ # only-windows --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs diff --git a/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile b/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile index 3360a97b5ff0e..b9deb7729c22b 100644 --- a/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile +++ b/src/test/run-make/raw-dylib-stdcall-ordinal/Makefile @@ -3,7 +3,7 @@ # only-x86 # only-windows --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs diff --git a/src/test/run-make/remap-path-prefix-dwarf/Makefile b/src/test/run-make/remap-path-prefix-dwarf/Makefile index 561a343d60b94..fbaea7b68fe56 100644 --- a/src/test/run-make/remap-path-prefix-dwarf/Makefile +++ b/src/test/run-make/remap-path-prefix-dwarf/Makefile @@ -6,7 +6,7 @@ SRC_DIR := $(abspath .) SRC_DIR_PARENT := $(abspath ..) --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: \ abs_input_outside_working_dir \ diff --git a/src/test/run-make/rustc-macro-dep-files/Makefile b/src/test/run-make/rustc-macro-dep-files/Makefile index a08a63fb44bf5..6ae659db2e99f 100644 --- a/src/test/run-make/rustc-macro-dep-files/Makefile +++ b/src/test/run-make/rustc-macro-dep-files/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC` # instead of hardcoding them everywhere they're needed. diff --git a/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile b/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile index dce8b83eefe4e..7786ff762cb30 100644 --- a/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-invalid-expr/Makefile @@ -1,5 +1,5 @@ deps := ex --include ../rustdoc-scrape-examples-multiple/scrape.mk +include ../rustdoc-scrape-examples-multiple/scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile b/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile index 897805e4405b9..453a7d4bc8b81 100644 --- a/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-multiple/Makefile @@ -1,5 +1,5 @@ deps := ex ex2 --include ./scrape.mk +include ./scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk b/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk index d49b6c1f290cb..7a28d2145d551 100644 --- a/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk +++ b/src/test/run-make/rustdoc-scrape-examples-multiple/scrape.mk @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUTPUT_DIR := "$(TMPDIR)/rustdoc" diff --git a/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile b/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile index 339d539bfd57d..bf45b8148c03a 100644 --- a/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-ordering/Makefile @@ -1,5 +1,5 @@ deps := ex1 ex2 --include ../rustdoc-scrape-examples-multiple/scrape.mk +include ../rustdoc-scrape-examples-multiple/scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-scrape-examples-remap/Makefile b/src/test/run-make/rustdoc-scrape-examples-remap/Makefile index dce8b83eefe4e..7786ff762cb30 100644 --- a/src/test/run-make/rustdoc-scrape-examples-remap/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-remap/Makefile @@ -1,5 +1,5 @@ deps := ex --include ../rustdoc-scrape-examples-multiple/scrape.mk +include ../rustdoc-scrape-examples-multiple/scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-scrape-examples-test/Makefile b/src/test/run-make/rustdoc-scrape-examples-test/Makefile index 9f80a8d96022f..1235ead675156 100644 --- a/src/test/run-make/rustdoc-scrape-examples-test/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-test/Makefile @@ -1,6 +1,6 @@ extra_flags := --scrape-tests deps := ex --include ../rustdoc-scrape-examples-multiple/scrape.mk +include ../rustdoc-scrape-examples-multiple/scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile b/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile index dce8b83eefe4e..7786ff762cb30 100644 --- a/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile +++ b/src/test/run-make/rustdoc-scrape-examples-whitespace/Makefile @@ -1,5 +1,5 @@ deps := ex --include ../rustdoc-scrape-examples-multiple/scrape.mk +include ../rustdoc-scrape-examples-multiple/scrape.mk all: scrape diff --git a/src/test/run-make/rustdoc-with-out-dir-option/Makefile b/src/test/run-make/rustdoc-with-out-dir-option/Makefile index f79fce8eeeae1..b3c3f5230c187 100644 --- a/src/test/run-make/rustdoc-with-out-dir-option/Makefile +++ b/src/test/run-make/rustdoc-with-out-dir-option/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUTPUT_DIR := "$(TMPDIR)/rustdoc" diff --git a/src/test/run-make/rustdoc-with-output-option/Makefile b/src/test/run-make/rustdoc-with-output-option/Makefile index 654f9672588ed..02093a35cfc2a 100644 --- a/src/test/run-make/rustdoc-with-output-option/Makefile +++ b/src/test/run-make/rustdoc-with-output-option/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUTPUT_DIR := "$(TMPDIR)/rustdoc" diff --git a/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile b/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile index 1e9ba71de2649..dc5056a86dda2 100644 --- a/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile +++ b/src/test/run-make/rustdoc-with-short-out-dir-option/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk OUTPUT_DIR := "$(TMPDIR)/rustdoc" diff --git a/src/test/run-make/static-pie/Makefile b/src/test/run-make/static-pie/Makefile index 945ec1724ac04..e71770636ee10 100644 --- a/src/test/run-make/static-pie/Makefile +++ b/src/test/run-make/static-pie/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-x86_64 # only-linux diff --git a/src/test/run-make/thumb-none-cortex-m/Makefile b/src/test/run-make/thumb-none-cortex-m/Makefile index 13385369e4451..aa046af95da85 100644 --- a/src/test/run-make/thumb-none-cortex-m/Makefile +++ b/src/test/run-make/thumb-none-cortex-m/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # How to run this # $ ./x.py clean diff --git a/src/test/run-make/thumb-none-qemu/Makefile b/src/test/run-make/thumb-none-qemu/Makefile index ab8b90e154eab..328758d41ba66 100644 --- a/src/test/run-make/thumb-none-qemu/Makefile +++ b/src/test/run-make/thumb-none-qemu/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-thumb diff --git a/src/test/run-make/track-path-dep-info/Makefile b/src/test/run-make/track-path-dep-info/Makefile index 465d3744789b0..ee853943f8bce 100644 --- a/src/test/run-make/track-path-dep-info/Makefile +++ b/src/test/run-make/track-path-dep-info/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC` # instead of hardcoding them everywhere they're needed. diff --git a/src/test/run-make/unstable-flag-required/Makefile b/src/test/run-make/unstable-flag-required/Makefile index b8769d5f69051..d3a734fae77f9 100644 --- a/src/test/run-make/unstable-flag-required/Makefile +++ b/src/test/run-make/unstable-flag-required/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk all: $(RUSTDOC) --output-format=json x.html 2>&1 | diff - output-format-json.stderr diff --git a/src/test/run-make/wasm-abi/Makefile b/src/test/run-make/wasm-abi/Makefile index 61fc4e8f57fb8..e713ca1876d53 100644 --- a/src/test/run-make/wasm-abi/Makefile +++ b/src/test/run-make/wasm-abi/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-custom-section/Makefile b/src/test/run-make/wasm-custom-section/Makefile index 2f48b852566e0..92b0802e30a61 100644 --- a/src/test/run-make/wasm-custom-section/Makefile +++ b/src/test/run-make/wasm-custom-section/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-custom-sections-opt/Makefile b/src/test/run-make/wasm-custom-sections-opt/Makefile index 76698c0aae3ba..e5b45d96310f1 100644 --- a/src/test/run-make/wasm-custom-sections-opt/Makefile +++ b/src/test/run-make/wasm-custom-sections-opt/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-export-all-symbols/Makefile b/src/test/run-make/wasm-export-all-symbols/Makefile index 7e47ba4850e38..834f4d258db12 100644 --- a/src/test/run-make/wasm-export-all-symbols/Makefile +++ b/src/test/run-make/wasm-export-all-symbols/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-import-module/Makefile b/src/test/run-make/wasm-import-module/Makefile index fe63e66f242b4..18cef16aac3a1 100644 --- a/src/test/run-make/wasm-import-module/Makefile +++ b/src/test/run-make/wasm-import-module/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-panic-small/Makefile b/src/test/run-make/wasm-panic-small/Makefile index 68397e4bc6e18..2af9f71357e9a 100644 --- a/src/test/run-make/wasm-panic-small/Makefile +++ b/src/test/run-make/wasm-panic-small/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-spurious-import/Makefile b/src/test/run-make/wasm-spurious-import/Makefile index 1bb59dc1bfa41..6f50e6e554e7f 100644 --- a/src/test/run-make/wasm-spurious-import/Makefile +++ b/src/test/run-make/wasm-spurious-import/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-stringify-ints-small/Makefile b/src/test/run-make/wasm-stringify-ints-small/Makefile index 01e1c6b0ce8d8..2fa2c954d4a84 100644 --- a/src/test/run-make/wasm-stringify-ints-small/Makefile +++ b/src/test/run-make/wasm-stringify-ints-small/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk ifeq ($(TARGET),wasm32-unknown-unknown) all: diff --git a/src/test/run-make/wasm-symbols-different-module/Makefile b/src/test/run-make/wasm-symbols-different-module/Makefile index bb6a5d3c9d24a..9e657222deab1 100644 --- a/src/test/run-make/wasm-symbols-different-module/Makefile +++ b/src/test/run-make/wasm-symbols-different-module/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-symbols-not-exported/Makefile b/src/test/run-make/wasm-symbols-not-exported/Makefile index 62bd0f0872ebe..60b0dee001fbf 100644 --- a/src/test/run-make/wasm-symbols-not-exported/Makefile +++ b/src/test/run-make/wasm-symbols-not-exported/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/wasm-symbols-not-imported/Makefile b/src/test/run-make/wasm-symbols-not-imported/Makefile index 7a923375c1813..dc7618c19a757 100644 --- a/src/test/run-make/wasm-symbols-not-imported/Makefile +++ b/src/test/run-make/wasm-symbols-not-imported/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk # only-wasm32-bare diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile index 6a04d34391035..84dcd2393517c 100644 --- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile @@ -1,4 +1,4 @@ --include ../../run-make-fulldeps/tools.mk +include ../../run-make-fulldeps/tools.mk #only-x86_64-fortanix-unknown-sgx From f280138c7c99c3a9bebbdf719f716c43eb944bbd Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Tue, 23 Aug 2022 20:53:02 +0900 Subject: [PATCH 06/21] Use par_body_owners for liveness --- compiler/rustc_interface/src/passes.rs | 6 +- compiler/rustc_middle/src/query/mod.rs | 4 +- compiler/rustc_passes/src/liveness.rs | 101 ++++++++---------- ...ture-pattern-closure-within-closure.stderr | 16 +-- .../issue-54180-unused-ref-field.stderr | 12 +-- .../lint/unused/lint-unused-variables.stderr | 28 ++--- src/test/ui/liveness/liveness-consts.stderr | 12 +-- .../param-attrs-cfg.stderr | 42 ++++---- 8 files changed, 106 insertions(+), 115 deletions(-) diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 014cf88389e44..b7fbda58eca73 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -911,13 +911,13 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { }); }, { - sess.time("liveness_and_intrinsic_checking", || { - tcx.hir().par_for_each_module(|module| { + sess.time("liveness_checking", || { + tcx.hir().par_body_owners(|def_id| { // this must run before MIR dump, because // "not all control paths return a value" is reported here. // // maybe move the check to a MIR pass? - tcx.ensure().check_mod_liveness(module); + tcx.ensure().check_liveness(def_id.to_def_id()); }); }); } diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index f78f62e31d286..16de6ebfe58e6 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -818,8 +818,8 @@ rustc_queries! { desc { |tcx| "checking privacy in {}", describe_as_module(key, tcx) } } - query check_mod_liveness(key: LocalDefId) -> () { - desc { |tcx| "checking liveness of variables in {}", describe_as_module(key, tcx) } + query check_liveness(key: DefId) { + desc { |tcx| "checking liveness of variables in {}", tcx.def_path_str(key) } } /// Return the live symbols in the crate for dead code check. diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs index 7124b84bfef38..1f22ebc730aed 100644 --- a/compiler/rustc_passes/src/liveness.rs +++ b/compiler/rustc_passes/src/liveness.rs @@ -89,11 +89,10 @@ use rustc_data_structures::fx::FxIndexMap; use rustc_errors::Applicability; use rustc_hir as hir; use rustc_hir::def::*; -use rustc_hir::def_id::LocalDefId; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::intravisit::{self, Visitor}; use rustc_hir::{Expr, HirId, HirIdMap, HirIdSet}; use rustc_index::vec::IndexVec; -use rustc_middle::hir::nested_filter; use rustc_middle::ty::query::Providers; use rustc_middle::ty::{self, DefIdTree, RootVariableMinCaptureList, Ty, TyCtxt}; use rustc_session::lint; @@ -139,12 +138,54 @@ fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_>) -> String { } } -fn check_mod_liveness(tcx: TyCtxt<'_>, module_def_id: LocalDefId) { - tcx.hir().visit_item_likes_in_module(module_def_id, &mut IrMaps::new(tcx)); +fn check_liveness(tcx: TyCtxt<'_>, def_id: DefId) { + let local_def_id = match def_id.as_local() { + None => return, + Some(def_id) => def_id, + }; + + // Don't run unused pass for #[derive()] + let parent = tcx.local_parent(local_def_id); + if let DefKind::Impl = tcx.def_kind(parent) + && tcx.has_attr(parent.to_def_id(), sym::automatically_derived) + { + return; + } + + // Don't run unused pass for #[naked] + if tcx.has_attr(def_id, sym::naked) { + return; + } + + let mut maps = IrMaps::new(tcx); + let body_id = tcx.hir().body_owned_by(local_def_id); + let hir_id = tcx.hir().body_owner(body_id); + let body = tcx.hir().body(body_id); + + if let Some(upvars) = tcx.upvars_mentioned(def_id) { + for &var_hir_id in upvars.keys() { + let var_name = tcx.hir().name(var_hir_id); + maps.add_variable(Upvar(var_hir_id, var_name)); + } + } + + // gather up the various local variables, significant expressions, + // and so forth: + maps.visit_body(body); + + // compute liveness + let mut lsets = Liveness::new(&mut maps, local_def_id); + let entry_ln = lsets.compute(&body, hir_id); + lsets.log_liveness(entry_ln, body_id.hir_id); + + // check for various error conditions + lsets.visit_body(body); + lsets.warn_about_unused_upvars(entry_ln); + lsets.warn_about_unused_args(body, entry_ln); } pub fn provide(providers: &mut Providers) { - *providers = Providers { check_mod_liveness, ..*providers }; + *providers = Providers { check_liveness, ..*providers }; } // ______________________________________________________________________ @@ -316,56 +357,6 @@ impl<'tcx> IrMaps<'tcx> { } impl<'tcx> Visitor<'tcx> for IrMaps<'tcx> { - type NestedFilter = nested_filter::OnlyBodies; - - fn nested_visit_map(&mut self) -> Self::Map { - self.tcx.hir() - } - - fn visit_body(&mut self, body: &'tcx hir::Body<'tcx>) { - debug!("visit_body {:?}", body.id()); - - // swap in a new set of IR maps for this body - let mut maps = IrMaps::new(self.tcx); - let hir_id = maps.tcx.hir().body_owner(body.id()); - let local_def_id = maps.tcx.hir().local_def_id(hir_id); - let def_id = local_def_id.to_def_id(); - - // Don't run unused pass for #[derive()] - let parent = self.tcx.local_parent(local_def_id); - if let DefKind::Impl = self.tcx.def_kind(parent) - && self.tcx.has_attr(parent.to_def_id(), sym::automatically_derived) - { - return; - } - - // Don't run unused pass for #[naked] - if self.tcx.has_attr(def_id, sym::naked) { - return; - } - - if let Some(upvars) = maps.tcx.upvars_mentioned(def_id) { - for &var_hir_id in upvars.keys() { - let var_name = maps.tcx.hir().name(var_hir_id); - maps.add_variable(Upvar(var_hir_id, var_name)); - } - } - - // gather up the various local variables, significant expressions, - // and so forth: - intravisit::walk_body(&mut maps, body); - - // compute liveness - let mut lsets = Liveness::new(&mut maps, local_def_id); - let entry_ln = lsets.compute(&body, hir_id); - lsets.log_liveness(entry_ln, body.id().hir_id); - - // check for various error conditions - lsets.visit_body(body); - lsets.warn_about_unused_upvars(entry_ln); - lsets.warn_about_unused_args(body, entry_ln); - } - fn visit_local(&mut self, local: &'tcx hir::Local<'tcx>) { self.add_from_pat(&local.pat); if local.els.is_some() { diff --git a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr index 40274c88318c3..cf8bd7a0a2765 100644 --- a/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr +++ b/src/test/ui/closures/2229_closure_analysis/run_pass/destructure-pattern-closure-within-closure.stderr @@ -1,8 +1,8 @@ -warning: unused variable: `t2` - --> $DIR/destructure-pattern-closure-within-closure.rs:13:21 +warning: unused variable: `g2` + --> $DIR/destructure-pattern-closure-within-closure.rs:10:17 | -LL | let (_, t2) = t; - | ^^ help: if this is intentional, prefix it with an underscore: `_t2` +LL | let (_, g2) = g; + | ^^ help: if this is intentional, prefix it with an underscore: `_g2` | note: the lint level is defined here --> $DIR/destructure-pattern-closure-within-closure.rs:3:9 @@ -11,11 +11,11 @@ LL | #![warn(unused)] | ^^^^^^ = note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` -warning: unused variable: `g2` - --> $DIR/destructure-pattern-closure-within-closure.rs:10:17 +warning: unused variable: `t2` + --> $DIR/destructure-pattern-closure-within-closure.rs:13:21 | -LL | let (_, g2) = g; - | ^^ help: if this is intentional, prefix it with an underscore: `_g2` +LL | let (_, t2) = t; + | ^^ help: if this is intentional, prefix it with an underscore: `_t2` warning: 2 warnings emitted diff --git a/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr b/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr index c501aa25f1352..f2e6168998c44 100644 --- a/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr +++ b/src/test/ui/lint/unused/issue-54180-unused-ref-field.stderr @@ -11,12 +11,6 @@ LL | #![deny(unused)] | ^^^^^^ = note: `#[deny(unused_variables)]` implied by `#[deny(unused)]` -error: unused variable: `x` - --> $DIR/issue-54180-unused-ref-field.rs:29:45 - | -LL | let _: i32 = points.iter().map(|Point { x, y }| y).sum(); - | ^ help: try ignoring the field: `x: _` - error: unused variable: `f1` --> $DIR/issue-54180-unused-ref-field.rs:26:13 | @@ -29,5 +23,11 @@ error: unused variable: `x` LL | Point { y, ref mut x } => y, | ^^^^^^^^^ help: try ignoring the field: `x: _` +error: unused variable: `x` + --> $DIR/issue-54180-unused-ref-field.rs:29:45 + | +LL | let _: i32 = points.iter().map(|Point { x, y }| y).sum(); + | ^ help: try ignoring the field: `x: _` + error: aborting due to 4 previous errors diff --git a/src/test/ui/lint/unused/lint-unused-variables.stderr b/src/test/ui/lint/unused/lint-unused-variables.stderr index d6e684e830651..fd9a5bcbfc49b 100644 --- a/src/test/ui/lint/unused/lint-unused-variables.stderr +++ b/src/test/ui/lint/unused/lint-unused-variables.stderr @@ -17,55 +17,55 @@ LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `a` - --> $DIR/lint-unused-variables.rs:68:9 + --> $DIR/lint-unused-variables.rs:22:9 | LL | a: i32, | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:74:9 + --> $DIR/lint-unused-variables.rs:29:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:42:9 + --> $DIR/lint-unused-variables.rs:34:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:47:9 + --> $DIR/lint-unused-variables.rs:42:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` -error: unused variable: `a` - --> $DIR/lint-unused-variables.rs:22:9 - | -LL | a: i32, - | ^ help: if this is intentional, prefix it with an underscore: `_a` - error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:29:9 + --> $DIR/lint-unused-variables.rs:47:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:34:9 + --> $DIR/lint-unused-variables.rs:55:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:55:9 + --> $DIR/lint-unused-variables.rs:60:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` +error: unused variable: `a` + --> $DIR/lint-unused-variables.rs:68:9 + | +LL | a: i32, + | ^ help: if this is intentional, prefix it with an underscore: `_a` + error: unused variable: `b` - --> $DIR/lint-unused-variables.rs:60:9 + --> $DIR/lint-unused-variables.rs:74:9 | LL | b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` diff --git a/src/test/ui/liveness/liveness-consts.stderr b/src/test/ui/liveness/liveness-consts.stderr index adaf543162976..16209d16c195f 100644 --- a/src/test/ui/liveness/liveness-consts.stderr +++ b/src/test/ui/liveness/liveness-consts.stderr @@ -39,12 +39,6 @@ warning: unused variable: `z` LL | pub fn f(x: [u8; { let s = 17; 100 }]) -> [u8; { let z = 18; 100 }] { | ^ help: if this is intentional, prefix it with an underscore: `_z` -warning: unused variable: `z` - --> $DIR/liveness-consts.rs:60:13 - | -LL | let z = 42; - | ^ help: if this is intentional, prefix it with an underscore: `_z` - warning: value assigned to `t` is never read --> $DIR/liveness-consts.rs:42:9 | @@ -59,5 +53,11 @@ warning: unused variable: `w` LL | let w = 10; | ^ help: if this is intentional, prefix it with an underscore: `_w` +warning: unused variable: `z` + --> $DIR/liveness-consts.rs:60:13 + | +LL | let z = 42; + | ^ help: if this is intentional, prefix it with an underscore: `_z` + warning: 8 warnings emitted diff --git a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr index 1ced8d8a14a53..6d18d295cfc64 100644 --- a/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr +++ b/src/test/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr @@ -23,97 +23,97 @@ LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `a` - --> $DIR/param-attrs-cfg.rs:107:27 + --> $DIR/param-attrs-cfg.rs:41:27 | LL | #[cfg(something)] a: i32, | ^ help: if this is intentional, prefix it with an underscore: `_a` error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:113:27 + --> $DIR/param-attrs-cfg.rs:48:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:115:44 + --> $DIR/param-attrs-cfg.rs:50:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:67:27 + --> $DIR/param-attrs-cfg.rs:56:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:69:44 + --> $DIR/param-attrs-cfg.rs:58:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:75:27 + --> $DIR/param-attrs-cfg.rs:67:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:77:44 + --> $DIR/param-attrs-cfg.rs:69:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` -error: unused variable: `a` - --> $DIR/param-attrs-cfg.rs:41:27 - | -LL | #[cfg(something)] a: i32, - | ^ help: if this is intentional, prefix it with an underscore: `_a` - error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:48:27 + --> $DIR/param-attrs-cfg.rs:75:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:50:44 + --> $DIR/param-attrs-cfg.rs:77:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:56:27 + --> $DIR/param-attrs-cfg.rs:86:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:58:44 + --> $DIR/param-attrs-cfg.rs:88:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:86:27 + --> $DIR/param-attrs-cfg.rs:94:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:88:44 + --> $DIR/param-attrs-cfg.rs:96:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` +error: unused variable: `a` + --> $DIR/param-attrs-cfg.rs:107:27 + | +LL | #[cfg(something)] a: i32, + | ^ help: if this is intentional, prefix it with an underscore: `_a` + error: unused variable: `b` - --> $DIR/param-attrs-cfg.rs:94:27 + --> $DIR/param-attrs-cfg.rs:113:27 | LL | #[cfg(something)] b: i32, | ^ help: if this is intentional, prefix it with an underscore: `_b` error: unused variable: `c` - --> $DIR/param-attrs-cfg.rs:96:44 + --> $DIR/param-attrs-cfg.rs:115:44 | LL | #[cfg_attr(nothing, cfg(nothing))] c: i32, | ^ help: if this is intentional, prefix it with an underscore: `_c` From 5ff45dc89efdaabe903e5bff4dc1c170def7b325 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 22 Aug 2022 16:53:34 -0300 Subject: [PATCH 07/21] Move InferCtxtExt to rustc_trait_selection --- compiler/rustc_trait_selection/src/lib.rs | 1 + compiler/rustc_trait_selection/src/traits/mod.rs | 1 + .../src/traits}/outlives_bounds.rs | 8 ++++---- compiler/rustc_typeck/src/check/compare_method.rs | 2 +- compiler/rustc_typeck/src/check/wfcheck.rs | 2 +- .../rustc_typeck/src/impl_wf_check/min_specialization.rs | 2 +- compiler/rustc_typeck/src/outlives/mod.rs | 1 - 7 files changed, 9 insertions(+), 8 deletions(-) rename compiler/{rustc_typeck/src/outlives => rustc_trait_selection/src/traits}/outlives_bounds.rs (93%) diff --git a/compiler/rustc_trait_selection/src/lib.rs b/compiler/rustc_trait_selection/src/lib.rs index 9c252fcfe1c63..ce48d4c99e9de 100644 --- a/compiler/rustc_trait_selection/src/lib.rs +++ b/compiler/rustc_trait_selection/src/lib.rs @@ -20,6 +20,7 @@ #![feature(let_else)] #![feature(if_let_guard)] #![feature(never_type)] +#![feature(type_alias_impl_trait)] #![recursion_limit = "512"] // For rustdoc #[macro_use] diff --git a/compiler/rustc_trait_selection/src/traits/mod.rs b/compiler/rustc_trait_selection/src/traits/mod.rs index 85ff6e23711ca..86471eeb070e0 100644 --- a/compiler/rustc_trait_selection/src/traits/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/mod.rs @@ -13,6 +13,7 @@ mod fulfill; pub mod misc; mod object_safety; mod on_unimplemented; +pub mod outlives_bounds; mod project; pub mod query; pub(crate) mod relationships; diff --git a/compiler/rustc_typeck/src/outlives/outlives_bounds.rs b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs similarity index 93% rename from compiler/rustc_typeck/src/outlives/outlives_bounds.rs rename to compiler/rustc_trait_selection/src/traits/outlives_bounds.rs index 024e20d92234b..a4b540182280b 100644 --- a/compiler/rustc_typeck/src/outlives/outlives_bounds.rs +++ b/compiler/rustc_trait_selection/src/traits/outlives_bounds.rs @@ -1,11 +1,11 @@ +use crate::infer::InferCtxt; +use crate::traits::query::type_op::{self, TypeOp, TypeOpOutput}; +use crate::traits::query::NoSolution; +use crate::traits::{ObligationCause, TraitEngine, TraitEngineExt}; use rustc_data_structures::fx::FxHashSet; use rustc_hir as hir; use rustc_hir::HirId; use rustc_middle::ty::{self, ParamEnv, Ty}; -use rustc_trait_selection::infer::InferCtxt; -use rustc_trait_selection::traits::query::type_op::{self, TypeOp, TypeOpOutput}; -use rustc_trait_selection::traits::query::NoSolution; -use rustc_trait_selection::traits::{ObligationCause, TraitEngine, TraitEngineExt}; pub use rustc_middle::traits::query::OutlivesBound; diff --git a/compiler/rustc_typeck/src/check/compare_method.rs b/compiler/rustc_typeck/src/check/compare_method.rs index dfef924f6993a..af5e5622fb381 100644 --- a/compiler/rustc_typeck/src/check/compare_method.rs +++ b/compiler/rustc_typeck/src/check/compare_method.rs @@ -1,6 +1,5 @@ use super::potentially_plural_count; use crate::errors::LifetimesOrBoundsMismatchOnTrait; -use crate::outlives::outlives_bounds::InferCtxtExt as _; use rustc_data_structures::fx::FxHashSet; use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticId, ErrorGuaranteed}; use rustc_hir as hir; @@ -17,6 +16,7 @@ use rustc_middle::ty::{self, DefIdTree}; use rustc_middle::ty::{GenericParamDefKind, ToPredicate, TyCtxt}; use rustc_span::Span; use rustc_trait_selection::traits::error_reporting::InferCtxtExt; +use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; use rustc_trait_selection::traits::{ self, ObligationCause, ObligationCauseCode, ObligationCtxt, Reveal, }; diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index e8243d666b641..ce42647c837a5 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -1,5 +1,4 @@ use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter}; -use crate::outlives::outlives_bounds::InferCtxtExt as _; use rustc_ast as ast; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder, ErrorGuaranteed}; @@ -22,6 +21,7 @@ use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; use rustc_trait_selection::autoderef::Autoderef; use rustc_trait_selection::traits::error_reporting::InferCtxtExt; +use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; use rustc_trait_selection::traits::{ self, ObligationCause, ObligationCauseCode, ObligationCtxt, WellFormedLoc, diff --git a/compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs b/compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs index 6240024d49c74..2741d9f776ce2 100644 --- a/compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs +++ b/compiler/rustc_typeck/src/impl_wf_check/min_specialization.rs @@ -67,7 +67,6 @@ use crate::constrained_generic_params as cgp; use crate::errors::SubstsOnOverriddenImpl; -use crate::outlives::outlives_bounds::InferCtxtExt as _; use rustc_data_structures::fx::FxHashSet; use rustc_hir::def_id::{DefId, LocalDefId}; @@ -79,6 +78,7 @@ use rustc_middle::ty::trait_def::TraitSpecializationKind; use rustc_middle::ty::{self, TyCtxt, TypeVisitable}; use rustc_span::Span; use rustc_trait_selection::traits::error_reporting::InferCtxtExt; +use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; use rustc_trait_selection::traits::{self, translate_substs, wf, ObligationCtxt}; pub(super) fn check_min_specialization(tcx: TyCtxt<'_>, impl_def_id: LocalDefId) { diff --git a/compiler/rustc_typeck/src/outlives/mod.rs b/compiler/rustc_typeck/src/outlives/mod.rs index 8fa65d51e3ba1..e50c267659e3f 100644 --- a/compiler/rustc_typeck/src/outlives/mod.rs +++ b/compiler/rustc_typeck/src/outlives/mod.rs @@ -9,7 +9,6 @@ use rustc_span::Span; mod explicit; mod implicit_infer; -pub(crate) mod outlives_bounds; /// Code to write unit test for outlives. pub mod test; mod utils; From ac0b6af37bc6d8ed6f4468a8c3feab31ebb9e15d Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 22 Aug 2022 15:52:49 -0300 Subject: [PATCH 08/21] Permit negative impls coherence to take advantage of implied bounds --- .../src/traits/coherence.rs | 34 ++++++++++++++----- .../coherence-negative-outlives-lifetimes.rs | 6 ++-- ...s-lifetimes.with_negative_coherence.stderr | 11 ------ 3 files changed, 29 insertions(+), 22 deletions(-) delete mode 100644 src/test/ui/coherence/coherence-negative-outlives-lifetimes.with_negative_coherence.stderr diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index 3bc08fba91a10..fb2440ef45774 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -6,12 +6,13 @@ use crate::infer::outlives::env::OutlivesEnvironment; use crate::infer::{CombinedSnapshot, InferOk}; +use crate::traits::outlives_bounds::InferCtxtExt as _; use crate::traits::select::IntercrateAmbiguityCause; use crate::traits::util::impl_subject_and_oblig; use crate::traits::SkipLeakCheck; use crate::traits::{ - self, Normalized, Obligation, ObligationCause, PredicateObligation, PredicateObligations, - SelectionContext, + self, Normalized, Obligation, ObligationCause, ObligationCtxt, PredicateObligation, + PredicateObligations, SelectionContext, }; use rustc_data_structures::fx::FxIndexSet; use rustc_errors::Diagnostic; @@ -322,7 +323,7 @@ fn negative_impl<'cx, 'tcx>( let (subject2, obligations) = impl_subject_and_oblig(selcx, impl_env, impl2_def_id, impl2_substs); - !equate(&infcx, impl_env, subject1, subject2, obligations) + !equate(&infcx, impl_env, subject1, subject2, obligations, impl1_def_id) }) } @@ -332,6 +333,7 @@ fn equate<'cx, 'tcx>( subject1: ImplSubject<'tcx>, subject2: ImplSubject<'tcx>, obligations: impl Iterator>, + body_def_id: DefId, ) -> bool { // do the impls unify? If not, not disjoint. let Ok(InferOk { obligations: more_obligations, .. }) = @@ -342,8 +344,10 @@ fn equate<'cx, 'tcx>( }; let selcx = &mut SelectionContext::new(&infcx); - let opt_failing_obligation = - obligations.into_iter().chain(more_obligations).find(|o| negative_impl_exists(selcx, o)); + let opt_failing_obligation = obligations + .into_iter() + .chain(more_obligations) + .find(|o| negative_impl_exists(selcx, o, body_def_id)); if let Some(failing_obligation) = opt_failing_obligation { debug!("overlap: obligation unsatisfiable {:?}", failing_obligation); @@ -358,14 +362,15 @@ fn equate<'cx, 'tcx>( fn negative_impl_exists<'cx, 'tcx>( selcx: &SelectionContext<'cx, 'tcx>, o: &PredicateObligation<'tcx>, + body_def_id: DefId, ) -> bool { - if resolve_negative_obligation(selcx.infcx().fork(), o) { + if resolve_negative_obligation(selcx.infcx().fork(), o, body_def_id) { return true; } // Try to prove a negative obligation exists for super predicates for o in util::elaborate_predicates(selcx.tcx(), iter::once(o.predicate)) { - if resolve_negative_obligation(selcx.infcx().fork(), &o) { + if resolve_negative_obligation(selcx.infcx().fork(), &o, body_def_id) { return true; } } @@ -377,6 +382,7 @@ fn negative_impl_exists<'cx, 'tcx>( fn resolve_negative_obligation<'cx, 'tcx>( infcx: InferCtxt<'cx, 'tcx>, o: &PredicateObligation<'tcx>, + body_def_id: DefId, ) -> bool { let tcx = infcx.tcx; @@ -390,7 +396,19 @@ fn resolve_negative_obligation<'cx, 'tcx>( return false; } - let outlives_env = OutlivesEnvironment::new(param_env); + let outlives_env = if let Some(body_def_id) = body_def_id.as_local() { + let body_id = tcx.hir().local_def_id_to_hir_id(body_def_id); + let ocx = ObligationCtxt::new(&infcx); + let wf_tys = ocx.assumed_wf_types(param_env, DUMMY_SP, body_def_id); + OutlivesEnvironment::with_bounds( + param_env, + Some(&infcx), + infcx.implied_bounds_tys(param_env, body_id, wf_tys), + ) + } else { + OutlivesEnvironment::new(param_env) + }; + infcx.process_registered_region_obligations(outlives_env.region_bound_pairs(), param_env); infcx.resolve_regions(&outlives_env).is_empty() diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs index 221c1bc23b3f4..3acf0d8d39ab9 100644 --- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs +++ b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs @@ -1,9 +1,9 @@ // revisions: stock with_negative_coherence +//[with_negative_coherence] check-pass + #![feature(negative_impls)] #![cfg_attr(with_negative_coherence, feature(with_negative_coherence))] -// FIXME: this should compile - trait MyPredicate<'a> {} impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {} @@ -12,6 +12,6 @@ trait MyTrait<'a> {} impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} impl<'a, T> MyTrait<'a> for &'a T {} -//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` +//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` fn main() {} diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.with_negative_coherence.stderr b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.with_negative_coherence.stderr deleted file mode 100644 index 097cc4e0fe3e6..0000000000000 --- a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.with_negative_coherence.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0119]: conflicting implementations of trait `MyTrait<'_>` for type `&_` - --> $DIR/coherence-negative-outlives-lifetimes.rs:14:1 - | -LL | impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} - | ---------------------------------------------- first implementation here -LL | impl<'a, T> MyTrait<'a> for &'a T {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `&_` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0119`. From 4cb492e7408c9c54fbc9e6ad5a13af650514c715 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Mon, 22 Aug 2022 15:54:02 -0300 Subject: [PATCH 09/21] Do not use unneeded extra errors variable --- compiler/rustc_trait_selection/src/traits/coherence.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index fb2440ef45774..f09be12b84d0c 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -391,8 +391,7 @@ fn resolve_negative_obligation<'cx, 'tcx>( }; let param_env = o.param_env; - let errors = super::fully_solve_obligation(&infcx, o); - if !errors.is_empty() { + if !super::fully_solve_obligation(&infcx, o).is_empty() { return false; } From 4da14ef50eb697298f36d41f91cb02dc800275bf Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Tue, 23 Aug 2022 09:08:30 -0300 Subject: [PATCH 10/21] Use CRATE_HIR_ID and CRATE_DEF_ID for obligations from foreign crates --- .../src/traits/coherence.rs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs index f09be12b84d0c..292787d4dbb24 100644 --- a/compiler/rustc_trait_selection/src/traits/coherence.rs +++ b/compiler/rustc_trait_selection/src/traits/coherence.rs @@ -16,7 +16,8 @@ use crate::traits::{ }; use rustc_data_structures::fx::FxIndexSet; use rustc_errors::Diagnostic; -use rustc_hir::def_id::{DefId, LOCAL_CRATE}; +use rustc_hir::def_id::{DefId, CRATE_DEF_ID, LOCAL_CRATE}; +use rustc_hir::CRATE_HIR_ID; use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; use rustc_infer::traits::util; use rustc_middle::traits::specialization_graph::OverlapMode; @@ -395,19 +396,20 @@ fn resolve_negative_obligation<'cx, 'tcx>( return false; } - let outlives_env = if let Some(body_def_id) = body_def_id.as_local() { - let body_id = tcx.hir().local_def_id_to_hir_id(body_def_id); - let ocx = ObligationCtxt::new(&infcx); - let wf_tys = ocx.assumed_wf_types(param_env, DUMMY_SP, body_def_id); - OutlivesEnvironment::with_bounds( - param_env, - Some(&infcx), - infcx.implied_bounds_tys(param_env, body_id, wf_tys), - ) + let (body_id, body_def_id) = if let Some(body_def_id) = body_def_id.as_local() { + (tcx.hir().local_def_id_to_hir_id(body_def_id), body_def_id) } else { - OutlivesEnvironment::new(param_env) + (CRATE_HIR_ID, CRATE_DEF_ID) }; + let ocx = ObligationCtxt::new(&infcx); + let wf_tys = ocx.assumed_wf_types(param_env, DUMMY_SP, body_def_id); + let outlives_env = OutlivesEnvironment::with_bounds( + param_env, + Some(&infcx), + infcx.implied_bounds_tys(param_env, body_id, wf_tys), + ); + infcx.process_registered_region_obligations(outlives_env.region_bound_pairs(), param_env); infcx.resolve_regions(&outlives_env).is_empty() From b0255a1849dea3e39ebd9089230a17446230c3d8 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Tue, 23 Aug 2022 15:15:34 +0000 Subject: [PATCH 11/21] Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing The error can be quite confusing to newcomers. --- .../src/diagnostics/mutability_errors.rs | 19 +++++++++++++++++-- src/test/ui/borrowck/index-mut-help.stderr | 3 +++ src/test/ui/btreemap/btreemap-index-mut.rs | 6 ++++++ .../ui/btreemap/btreemap-index-mut.stderr | 12 ++++++++++++ src/test/ui/hashmap/hashmap-index-mut.rs | 6 ++++++ src/test/ui/hashmap/hashmap-index-mut.stderr | 12 ++++++++++++ src/test/ui/issues/issue-41726.stderr | 1 + 7 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/test/ui/btreemap/btreemap-index-mut.rs create mode 100644 src/test/ui/btreemap/btreemap-index-mut.stderr create mode 100644 src/test/ui/hashmap/hashmap-index-mut.rs create mode 100644 src/test/ui/hashmap/hashmap-index-mut.stderr diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 0ad4abbce2063..56721cc3f5c75 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -1,3 +1,4 @@ +use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed}; use rustc_hir as hir; use rustc_hir::Node; use rustc_middle::hir::map::Map; @@ -12,12 +13,11 @@ use rustc_middle::{ }; use rustc_span::source_map::DesugaringKind; use rustc_span::symbol::{kw, Symbol}; -use rustc_span::{BytePos, Span}; +use rustc_span::{sym, BytePos, Span}; use crate::diagnostics::BorrowedContentSource; use crate::MirBorrowckCtxt; use rustc_const_eval::util::collect_writes::FindAssignments; -use rustc_errors::{Applicability, Diagnostic}; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub(crate) enum AccessKind { @@ -614,6 +614,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { "trait `IndexMut` is required to modify indexed content, \ but it is not implemented for `{ty}`", )); + self.suggest_map_index_mut_alternatives(ty, &mut err); } _ => (), } @@ -627,6 +628,20 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> { self.buffer_error(err); } + fn suggest_map_index_mut_alternatives( + &self, + ty: Ty<'_>, + err: &mut DiagnosticBuilder<'_, ErrorGuaranteed>, + ) { + let Some(adt) = ty.ty_adt_def() else { return }; + let did = adt.did(); + if self.infcx.tcx.is_diagnostic_item(sym::HashMap, did) + || self.infcx.tcx.is_diagnostic_item(sym::BTreeMap, did) + { + err.help(format!("to modify a `{ty}`, use `.get_mut()`, `.insert()` or the entry API")); + } + } + /// User cannot make signature of a trait mutable without changing the /// trait. So we find if this error belongs to a trait and if so we move /// suggestion to the trait or disable it if it is out of scope of this crate diff --git a/src/test/ui/borrowck/index-mut-help.stderr b/src/test/ui/borrowck/index-mut-help.stderr index 057c6ee15f36c..0ce60e3eb1db8 100644 --- a/src/test/ui/borrowck/index-mut-help.stderr +++ b/src/test/ui/borrowck/index-mut-help.stderr @@ -5,6 +5,7 @@ LL | map["peter"].clear(); | ^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` + = help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API error[E0594]: cannot assign to data in an index of `HashMap<&str, String>` --> $DIR/index-mut-help.rs:12:5 @@ -13,6 +14,7 @@ LL | map["peter"] = "0".to_string(); | ^^^^^^^^^^^^ cannot assign | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` + = help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API error[E0596]: cannot borrow data in an index of `HashMap<&str, String>` as mutable --> $DIR/index-mut-help.rs:13:13 @@ -21,6 +23,7 @@ LL | let _ = &mut map["peter"]; | ^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap<&str, String>` + = help: to modify a `HashMap<&str, String>`, use `.get_mut()`, `.insert()` or the entry API error: aborting due to 3 previous errors diff --git a/src/test/ui/btreemap/btreemap-index-mut.rs b/src/test/ui/btreemap/btreemap-index-mut.rs new file mode 100644 index 0000000000000..62972acab86eb --- /dev/null +++ b/src/test/ui/btreemap/btreemap-index-mut.rs @@ -0,0 +1,6 @@ +use std::collections::BTreeMap; + +fn main() { + let mut map = BTreeMap::::new(); + map[&0] = 1; //~ ERROR cannot assign +} diff --git a/src/test/ui/btreemap/btreemap-index-mut.stderr b/src/test/ui/btreemap/btreemap-index-mut.stderr new file mode 100644 index 0000000000000..260f710007426 --- /dev/null +++ b/src/test/ui/btreemap/btreemap-index-mut.stderr @@ -0,0 +1,12 @@ +error[E0594]: cannot assign to data in an index of `BTreeMap` + --> $DIR/btreemap-index-mut.rs:5:5 + | +LL | map[&0] = 1; + | ^^^^^^^^^^^ cannot assign + | + = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `BTreeMap` + = help: to modify a `BTreeMap`, use `.get_mut()`, `.insert()` or the entry API + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/hashmap/hashmap-index-mut.rs b/src/test/ui/hashmap/hashmap-index-mut.rs new file mode 100644 index 0000000000000..98448e9d5f0f0 --- /dev/null +++ b/src/test/ui/hashmap/hashmap-index-mut.rs @@ -0,0 +1,6 @@ +use std::collections::HashMap; + +fn main() { + let mut map = HashMap::::new(); + map[&0] = 1; //~ ERROR cannot assign +} diff --git a/src/test/ui/hashmap/hashmap-index-mut.stderr b/src/test/ui/hashmap/hashmap-index-mut.stderr new file mode 100644 index 0000000000000..c72b380f4666d --- /dev/null +++ b/src/test/ui/hashmap/hashmap-index-mut.stderr @@ -0,0 +1,12 @@ +error[E0594]: cannot assign to data in an index of `HashMap` + --> $DIR/hashmap-index-mut.rs:5:5 + | +LL | map[&0] = 1; + | ^^^^^^^^^^^ cannot assign + | + = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap` + = help: to modify a `HashMap`, use `.get_mut()`, `.insert()` or the entry API + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0594`. diff --git a/src/test/ui/issues/issue-41726.stderr b/src/test/ui/issues/issue-41726.stderr index 22631e7c2a332..9c70ab7d9711d 100644 --- a/src/test/ui/issues/issue-41726.stderr +++ b/src/test/ui/issues/issue-41726.stderr @@ -5,6 +5,7 @@ LL | things[src.as_str()].sort(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot borrow as mutable | = help: trait `IndexMut` is required to modify indexed content, but it is not implemented for `HashMap>` + = help: to modify a `HashMap>`, use `.get_mut()`, `.insert()` or the entry API error: aborting due to previous error From 8ad36c45f8116c80cda018e63b9db6862e73a87d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 23 Aug 2022 18:27:18 +0200 Subject: [PATCH 12/21] Rewrite error index generator to greatly reduce the size of the pages --- src/tools/error_index_generator/build.rs | 31 --- src/tools/error_index_generator/main.rs | 297 ++++++++--------------- 2 files changed, 106 insertions(+), 222 deletions(-) delete mode 100644 src/tools/error_index_generator/build.rs diff --git a/src/tools/error_index_generator/build.rs b/src/tools/error_index_generator/build.rs deleted file mode 100644 index 70b00b36cf175..0000000000000 --- a/src/tools/error_index_generator/build.rs +++ /dev/null @@ -1,31 +0,0 @@ -use std::path::PathBuf; -use std::{env, fs}; -use walkdir::WalkDir; - -fn main() { - // The src directory (we are in src/tools/error_index_generator) - // Note that we could skip one of the .. but this ensures we at least loosely find the right - // directory. - let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap()); - - let error_codes_path = "../../../compiler/rustc_error_codes/src/error_codes.rs"; - - println!("cargo:rerun-if-changed={}", error_codes_path); - let file = fs::read_to_string(error_codes_path) - .unwrap() - .replace(": include_str!(\"./error_codes/", ": include_str!(\"./"); - let contents = format!("(|| {{\n{}\n}})()", file); - fs::write(&out_dir.join("all_error_codes.rs"), &contents).unwrap(); - - // We copy the md files as well to the target directory. - for entry in WalkDir::new("../../../compiler/rustc_error_codes/src/error_codes") { - let entry = entry.unwrap(); - match entry.path().extension() { - Some(s) if s == "md" => {} - _ => continue, - } - println!("cargo:rerun-if-changed={}", entry.path().to_str().unwrap()); - let md_content = fs::read_to_string(entry.path()).unwrap(); - fs::write(&out_dir.join(entry.file_name()), &md_content).unwrap(); - } -} diff --git a/src/tools/error_index_generator/main.rs b/src/tools/error_index_generator/main.rs index 1ce02e48c05b6..22243f9fc9d6c 100644 --- a/src/tools/error_index_generator/main.rs +++ b/src/tools/error_index_generator/main.rs @@ -3,11 +3,11 @@ extern crate rustc_driver; extern crate rustc_span; -use std::cell::RefCell; -use std::collections::BTreeMap; +use crate::error_codes::error_codes; + use std::env; use std::error::Error; -use std::fs::File; +use std::fs::{create_dir_all, File}; use std::io::Write; use std::path::Path; use std::path::PathBuf; @@ -16,49 +16,81 @@ use rustc_span::edition::DEFAULT_EDITION; use rustdoc::html::markdown::{ErrorCodes, HeadingOffset, IdMap, Markdown, Playground}; -pub struct ErrorMetadata { - pub description: Option, +macro_rules! register_diagnostics { + ($($error_code:ident: $message:expr,)+ ; $($undocumented:ident,)* ) => { + pub fn error_codes() -> Vec<(&'static str, Option<&'static str>)> { + let mut errors: Vec<(&str, Option<&str>)> = vec![ + $((stringify!($error_code), Some($message)),)+ + $((stringify!($undocumented), None),)+ + ]; + errors.sort(); + errors + } + } } -/// Mapping from error codes to metadata that can be (de)serialized. -pub type ErrorMetadataMap = BTreeMap; +#[path = "../../../compiler/rustc_error_codes/src/error_codes.rs"] +mod error_codes; enum OutputFormat { HTML(HTMLFormatter), - Markdown(MarkdownFormatter), + Markdown, Unknown(String), } impl OutputFormat { fn from(format: &str, resource_suffix: &str) -> OutputFormat { match &*format.to_lowercase() { - "html" => OutputFormat::HTML(HTMLFormatter( - RefCell::new(IdMap::new()), - resource_suffix.to_owned(), - )), - "markdown" => OutputFormat::Markdown(MarkdownFormatter), + "html" => OutputFormat::HTML(HTMLFormatter(resource_suffix.to_owned())), + "markdown" => OutputFormat::Markdown, s => OutputFormat::Unknown(s.to_owned()), } } } -trait Formatter { - fn header(&self, output: &mut dyn Write) -> Result<(), Box>; - fn title(&self, output: &mut dyn Write) -> Result<(), Box>; - fn error_code_block( +struct HTMLFormatter(String); + +impl HTMLFormatter { + fn create_error_code_file( &self, - output: &mut dyn Write, - info: &ErrorMetadata, err_code: &str, - ) -> Result<(), Box>; - fn footer(&self, output: &mut dyn Write) -> Result<(), Box>; -} + explanation: &str, + parent_dir: &Path, + ) -> Result<(), Box> { + let mut output_file = File::create(parent_dir.join(err_code).with_extension("html"))?; -struct HTMLFormatter(RefCell, String); -struct MarkdownFormatter; + self.header(&mut output_file, "../")?; + self.title(&mut output_file, &format!("Error code {}", err_code))?; -impl Formatter for HTMLFormatter { - fn header(&self, output: &mut dyn Write) -> Result<(), Box> { + let mut id_map = IdMap::new(); + let playground = + Playground { crate_name: None, url: String::from("https://play.rust-lang.org/") }; + write!( + output_file, + "{}", + Markdown { + content: explanation, + links: &[], + ids: &mut id_map, + error_codes: ErrorCodes::Yes, + edition: DEFAULT_EDITION, + playground: &Some(playground), + heading_offset: HeadingOffset::H1, + } + .into_string() + )?; + write!( + output_file, + "

\ + Back to list of error codes\ +

", + )?; + + self.footer(&mut output_file) + } + + fn header(&self, output: &mut dyn Write, extra: &str) -> Result<(), Box> { write!( output, r##" @@ -67,9 +99,9 @@ impl Formatter for HTMLFormatter { Rust Compiler Error Index - - - + + + +{extra} "##, @@ -153,7 +158,22 @@ fn render_html(output_path: &Path, formatter: HTMLFormatter) -> Result<(), Box(function() {{ + if (window.location.hash) {{ + let code = window.location.hash.replace(/^#/, ''); + // We have to make sure this pattern matches to avoid inadvertently creating an + // open redirect. + if (/^E[0-9]+$/.test(code)) {{ + window.location = './{error_codes_dir}/' + code + '.html'; + }} + }} +}})()"# + ), + )?; formatter.title(&mut output_file, "Rust Compiler Error Index")?; write!( From 4398d9229aea35d5f3b6b8365260ee87304b27b0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Tue, 23 Aug 2022 21:47:31 +0200 Subject: [PATCH 15/21] Fix links to error codes --- library/core/src/marker.rs | 2 +- library/core/src/ops/drop.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 2c57897956fcd..ab673c623b5d6 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -343,7 +343,7 @@ pub trait StructuralEq { /// If you try to implement `Copy` on a struct or enum containing non-`Copy` data, you will get /// the error [E0204]. /// -/// [E0204]: ../../error-index.html#E0204 +/// [E0204]: ../../error_codes/E0204.html /// /// ## When *should* my type be `Copy`? /// diff --git a/library/core/src/ops/drop.rs b/library/core/src/ops/drop.rs index aa654aa5570ee..de9ddb852df31 100644 --- a/library/core/src/ops/drop.rs +++ b/library/core/src/ops/drop.rs @@ -156,7 +156,7 @@ pub trait Drop { /// handled by the compiler, but when using unsafe code, can sometimes occur /// unintentionally, particularly when using [`ptr::drop_in_place`]. /// - /// [E0040]: ../../error-index.html#E0040 + /// [E0040]: ../../error_codes/E0040.html /// [`panic!`]: crate::panic! /// [`mem::drop`]: drop /// [`ptr::drop_in_place`]: crate::ptr::drop_in_place From 3d8c7d2c0a83a7603c3fc4164accfc41a38a5415 Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Sat, 20 Aug 2022 23:29:38 +0000 Subject: [PATCH 16/21] sugg: take into count the debug formatting Signed-off-by: Vincenzo Palazzo --- compiler/rustc_lint/src/context.rs | 9 ++++++-- ...sugg_with_positional_args_and_debug_fmt.rs | 10 +++++++++ ..._with_positional_args_and_debug_fmt.stderr | 21 +++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs create mode 100644 src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr diff --git a/compiler/rustc_lint/src/context.rs b/compiler/rustc_lint/src/context.rs index b95fc341db656..6586fe440f362 100644 --- a/compiler/rustc_lint/src/context.rs +++ b/compiler/rustc_lint/src/context.rs @@ -865,9 +865,14 @@ pub trait LintContext: Sized { if let Some(positional_arg_to_replace) = position_sp_to_replace { let name = if is_formatting_arg { named_arg_name + "$" } else { named_arg_name }; - + let span_to_replace = if let Ok(positional_arg_content) = + self.sess().source_map().span_to_snippet(positional_arg_to_replace) && positional_arg_content.starts_with(":") { + positional_arg_to_replace.shrink_to_lo() + } else { + positional_arg_to_replace + }; db.span_suggestion_verbose( - positional_arg_to_replace, + span_to_replace, "use the named argument by name to avoid ambiguity", name, Applicability::MaybeIncorrect, diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs new file mode 100644 index 0000000000000..21ab6830b3c81 --- /dev/null +++ b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.rs @@ -0,0 +1,10 @@ +// When build the suggesttion take in consideration the `:?` +// https://github.com/rust-lang/rust/issues/100648 +#![deny(warnings)] + +fn main () { + println!("hello {:?}", world = "world"); + //~^ ERROR named argument `world` is not used by name + //~| HELP use the named argument by name to avoid ambiguity + //~| SUGGESTION world +} diff --git a/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr new file mode 100644 index 0000000000000..850f69f2d9853 --- /dev/null +++ b/src/test/ui/suggestions/sugg_with_positional_args_and_debug_fmt.stderr @@ -0,0 +1,21 @@ +error: named argument `world` is not used by name + --> $DIR/sugg_with_positional_args_and_debug_fmt.rs:6:28 + | +LL | println!("hello {:?}", world = "world"); + | ---- ^^^^^ this named argument is referred to by position in formatting string + | | + | this formatting argument uses named argument `world` by position + | +note: the lint level is defined here + --> $DIR/sugg_with_positional_args_and_debug_fmt.rs:3:9 + | +LL | #![deny(warnings)] + | ^^^^^^^^ + = note: `#[deny(named_arguments_used_positionally)]` implied by `#[deny(warnings)]` +help: use the named argument by name to avoid ambiguity + | +LL | println!("hello {world:?}", world = "world"); + | +++++ + +error: aborting due to previous error + From 4eb748bf394aacdf96f6cf446cef8d781d3ab8b4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Tue, 23 Aug 2022 15:10:36 -0700 Subject: [PATCH 17/21] Use `--userns=keep-id` when "docker" is really podman Rootless podman creates a separate user namespace, where an inner `LOCAL_USER_ID` will map to a different subuid range on the host. The "keep-id" mode maps the current UID directly into the container. This makes `src/ci/docker/run.sh` work better for testing container images on systems running podman, where "docker" is just a shim. --- src/ci/docker/run.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 93b4f435d4db7..69d4916e5a963 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -213,7 +213,16 @@ else args="$args --volume $HOME/.cargo:/cargo" args="$args --volume $HOME/rustsrc:$HOME/rustsrc" args="$args --volume /tmp/toolstate:/tmp/toolstate" - args="$args --env LOCAL_USER_ID=`id -u`" + + id=$(id -u) + if [[ "$id" != 0 && "$(docker -v)" =~ ^podman ]]; then + # Rootless podman creates a separate user namespace, where an inner + # LOCAL_USER_ID will map to a different subuid range on the host. + # The "keep-id" mode maps the current UID directly into the container. + args="$args --env NO_CHANGE_USER=1 --userns=keep-id" + else + args="$args --env LOCAL_USER_ID=$id" + fi fi if [ "$dev" = "1" ] From b1925b811e55a2d9596abdf860b3b175ae871a34 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Tue, 23 Aug 2022 18:15:53 -0700 Subject: [PATCH 18/21] rustdoc: remove unused CSS rule According to [blame], this rule was added to support enum struct variants. However, enum struct variants don't use tables in their design any more, so this rule does nothing. [blame]: https://github.com/rust-lang/rust/blame/87991d5f5d72d6baca490141cb890211ba2f3843/src/librustdoc/html/static/css/rustdoc.css#L748 --- src/librustdoc/html/static/css/rustdoc.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index b1fa5e7d86de6..f1cd3defbef6b 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -745,10 +745,6 @@ pre, .rustdoc.source .example-wrap { border: 1px solid var(--border-color); } -.fields + table { - margin-bottom: 1em; -} - .content .item-list { list-style-type: none; padding: 0; From 3855e039a2c095f2e54b2f389f29e200293774ac Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 24 Aug 2022 11:34:14 +0900 Subject: [PATCH 19/21] do not suggest adding a bound to a opaque type --- .../src/diagnostics/explain_borrow.rs | 6 +++- ...not-suggest-adding-bound-to-opaque-type.rs | 29 +++++++++++++++++++ ...suggest-adding-bound-to-opaque-type.stderr | 14 +++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs create mode 100644 src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr diff --git a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs index 72aee0267ac1e..68f9a7c5007c8 100644 --- a/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs +++ b/compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs @@ -273,13 +273,17 @@ impl<'tcx> BorrowExplanation<'tcx> { _ => {} } } - pub(crate) fn add_lifetime_bound_suggestion_to_diagnostic( + + fn add_lifetime_bound_suggestion_to_diagnostic( &self, err: &mut Diagnostic, category: &ConstraintCategory<'tcx>, span: Span, region_name: &RegionName, ) { + if !span.is_desugaring(DesugaringKind::OpaqueTy) { + return; + } if let ConstraintCategory::OpaqueType = category { let suggestable_name = if region_name.was_named() { region_name.name } else { kw::UnderscoreLifetime }; diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs new file mode 100644 index 0000000000000..5340288051ac9 --- /dev/null +++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs @@ -0,0 +1,29 @@ +#![feature(allocator_api)] + +use std::{ + alloc::{AllocError, Allocator, Layout}, + ptr::NonNull, +}; + +struct GhostBump; + +unsafe impl Allocator for &GhostBump { + fn allocate(&self, layout: Layout) -> Result, AllocError> { + todo!() + } + + unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { + todo!() + } +} + +fn foo() -> impl Iterator { + let arena = GhostBump; + let mut vec = Vec::new_in(&arena); //~ ERROR `arena` does not live long enough + vec.push(1); + vec.push(2); + vec.push(3); + vec.into_iter() +} + +fn main() {} diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr new file mode 100644 index 0000000000000..677b81956f987 --- /dev/null +++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr @@ -0,0 +1,14 @@ +error[E0597]: `arena` does not live long enough + --> $DIR/do-not-suggest-adding-bound-to-opaque-type.rs:22:31 + | +LL | let mut vec = Vec::new_in(&arena); + | ^^^^^^ borrowed value does not live long enough +... +LL | vec.into_iter() + | --------------- opaque type requires that `arena` is borrowed for `'static` +LL | } + | - `arena` dropped here while still borrowed + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0597`. From 56f9e29d2a372771251a06189a23442e336567cf Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Wed, 24 Aug 2022 14:09:55 +0900 Subject: [PATCH 20/21] add a missing test case for impl generic mismatch --- .../ui/impl-trait/impl-generic-mismatch.rs | 9 +++++++++ .../ui/impl-trait/impl-generic-mismatch.stderr | 18 ++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.rs b/src/test/ui/impl-trait/impl-generic-mismatch.rs index ba678bb032dcb..fb8bde0d08131 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.rs +++ b/src/test/ui/impl-trait/impl-generic-mismatch.rs @@ -18,6 +18,15 @@ impl Bar for () { //~^ Error method `bar` has incompatible signature for trait } +trait Baz { + fn baz(&self, _: &U, _: &T); +} + +impl Baz for () { + fn baz(&self, _: &impl Debug, _: &T) { } + //~^ Error method `baz` has incompatible signature for trait +} + // With non-local trait (#49841): use std::hash::{Hash, Hasher}; diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr index 489afd7615f54..542f02d7ec567 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr +++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr @@ -27,8 +27,22 @@ help: try changing the `impl Trait` argument to a generic parameter LL | fn bar(&self, _: &U) { } | ++++++++++ ~ +error[E0643]: method `baz` has incompatible signature for trait + --> $DIR/impl-generic-mismatch.rs:26:33 + | +LL | fn baz(&self, _: &U, _: &T); + | - declaration in trait here +... +LL | fn baz(&self, _: &impl Debug, _: &T) { } + | ^^^^^^^^^^ expected generic parameter, found `impl Trait` + | +help: try changing the `impl Trait` argument to a generic parameter + | +LL | fn baz(&self, _: &T, _: &T) { } + | ~~~~~~~~~~~~~~~~~~~~ ~ + error[E0643]: method `hash` has incompatible signature for trait - --> $DIR/impl-generic-mismatch.rs:28:33 + --> $DIR/impl-generic-mismatch.rs:37:33 | LL | fn hash(&self, hasher: &mut impl Hasher) {} | ^^^^^^^^^^^ expected generic parameter, found `impl Trait` @@ -38,6 +52,6 @@ LL | fn hash(&self, hasher: &mut impl Hasher) {} LL | fn hash(&self, state: &mut H); | - declaration in trait here -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0643`. From c57ecfae0e131d14676e6d1aa535cb8f17dba80b Mon Sep 17 00:00:00 2001 From: Takayuki Maeda Date: Thu, 25 Aug 2022 00:42:34 +0900 Subject: [PATCH 21/21] use a minimized example --- ...not-suggest-adding-bound-to-opaque-type.rs | 29 ++++--------------- ...suggest-adding-bound-to-opaque-type.stderr | 16 +++++----- 2 files changed, 14 insertions(+), 31 deletions(-) diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs index 5340288051ac9..a1e801e392305 100644 --- a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs +++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.rs @@ -1,29 +1,12 @@ -#![feature(allocator_api)] +pub trait T {} -use std::{ - alloc::{AllocError, Allocator, Layout}, - ptr::NonNull, -}; +struct S<'a>(&'a ()); -struct GhostBump; +impl<'a> T for S<'a> {} -unsafe impl Allocator for &GhostBump { - fn allocate(&self, layout: Layout) -> Result, AllocError> { - todo!() - } - - unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { - todo!() - } -} - -fn foo() -> impl Iterator { - let arena = GhostBump; - let mut vec = Vec::new_in(&arena); //~ ERROR `arena` does not live long enough - vec.push(1); - vec.push(2); - vec.push(3); - vec.into_iter() +fn foo() -> impl T { + let x = (); + S(&x) //~ ERROR `x` does not live long enough } fn main() {} diff --git a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr index 677b81956f987..6ea238f302f3f 100644 --- a/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr +++ b/src/test/ui/regions/do-not-suggest-adding-bound-to-opaque-type.stderr @@ -1,13 +1,13 @@ -error[E0597]: `arena` does not live long enough - --> $DIR/do-not-suggest-adding-bound-to-opaque-type.rs:22:31 +error[E0597]: `x` does not live long enough + --> $DIR/do-not-suggest-adding-bound-to-opaque-type.rs:9:7 | -LL | let mut vec = Vec::new_in(&arena); - | ^^^^^^ borrowed value does not live long enough -... -LL | vec.into_iter() - | --------------- opaque type requires that `arena` is borrowed for `'static` +LL | S(&x) + | --^^- + | | | + | | borrowed value does not live long enough + | opaque type requires that `x` is borrowed for `'static` LL | } - | - `arena` dropped here while still borrowed + | - `x` dropped here while still borrowed error: aborting due to previous error