From 7bddcbae51b9417b9054ea042174416d8f538405 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Wed, 16 Jan 2019 14:37:22 +0100 Subject: [PATCH] With this change, I am able to build and test cross-platform `rustc` In particular, I can use the following in my `config.toml`: ``` [build] host = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] target = ["i686-unknown-linux-gnu", "x86_64-unknown-linux-gnu"] ``` Before this change, my attempt to run the test suite would fail because the error output differs depending on what your host and targets are. ---- To be concrete, here are the actual messages one can observe: ``` % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=x86_64-unknown-linux-gnu error: the type `std::option::Option<[u32; 35184372088831]>` is too big for the current architecture error: aborting due to previous error % ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=i686-unknown-linux-gnu error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture error: aborting due to previous error % ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=i686-unknown-linux-gnu error: the type `std::option::Option<[u32; 536870911]>` is too big for the current architecture error: aborting due to previous error % ./build/i686-unknown-linux-gnu/stage1/bin/rustc ../src/test/ui/huge-enum.rs -Aunused --target=x86_64-unknown-linux-gnu error: the type `[u32; 35184372088831]` is too big for the current architecture error: aborting due to previous error ``` To address these variations, I changed the test to be more aggressive in its normalization strategy. We cannot (and IMO should not) guarantee that `Option` will appear in the error output here. So I normalized both types `Option<[u32; N]>` and `[u32; N]` to just `TYPE` --- src/test/ui/huge-enum.rs | 6 ++---- src/test/ui/huge-enum.stderr | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/test/ui/huge-enum.rs b/src/test/ui/huge-enum.rs index 18ef45794af19..71c8fd55b23f3 100644 --- a/src/test/ui/huge-enum.rs +++ b/src/test/ui/huge-enum.rs @@ -1,7 +1,5 @@ -// error-pattern: Option -// normalize-stderr-test "<\[u32; \d+\]>" -> "<[u32; N]>" - -// FIXME: work properly with higher limits +// normalize-stderr-test "std::option::Option<\[u32; \d+\]>" -> "TYPE" +// normalize-stderr-test "\[u32; \d+\]" -> "TYPE" #[cfg(target_pointer_width = "32")] fn main() { diff --git a/src/test/ui/huge-enum.stderr b/src/test/ui/huge-enum.stderr index b7cf25504614a..67cae3d52ed2d 100644 --- a/src/test/ui/huge-enum.stderr +++ b/src/test/ui/huge-enum.stderr @@ -1,4 +1,4 @@ -error: the type `std::option::Option<[u32; N]>` is too big for the current architecture +error: the type `TYPE` is too big for the current architecture error: aborting due to previous error