Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some ui tests print traits differently on big-endian #74886

Closed
infinity0 opened this issue Jul 28, 2020 · 2 comments · Fixed by #74965
Closed

some ui tests print traits differently on big-endian #74886

infinity0 opened this issue Jul 28, 2020 · 2 comments · Fixed by #74965
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@infinity0
Copy link
Contributor

version 1.44.1 s390x ppc64 powerpc

I will be adding an ignore-endian-big feature as part of #74829, just wanted to confirm these failures are OK to ignore:

---- [ui] ui/consts/const-eval/ub-enum.rs stdout ----
[ .. omitted for brevity .. ]
------------------------------------------
diff of stderr:

90	  --> $DIR/ub-enum.rs:90:1
91	   |
92	LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(1u64) };
-	   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(Err)>.0.1
+	   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(Ok)>.0.1
94	   |
95	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
96	

98	  --> $DIR/ub-enum.rs:92:1
99	   |
100	LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(1u64) };
-	   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Never at .<enum-variant(Err)>.0.1
+	   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of the never type `!` at .<enum-variant(Ok)>.0.1
102	   |
103	   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
104	
---- [ui] ui/suggestions/missing-trait-bounds-for-method-call.rs stdout ----
[ .. omitted for brevity .. ]
------------------------------------------
diff of stderr:

14	           which is required by `Foo<T>: Bar`
15	help: consider restricting the type parameters to satisfy the trait bounds
16	   |
-	LL | struct Foo<T> where T: Bar, T: std::default::Default {
+	LL | struct Foo<T> where T: std::default::Default, T: Bar {
18	   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19	
20	error[E0599]: no method named `foo` found for reference `&Fin<T>` in the current scope

CC @estebank and @RalfJung who wrote the tests, but I guess you may not be responsible for the underlying behavior.

@infinity0 infinity0 added the C-bug Category: This is a bug. label Jul 28, 2020
@jonas-schievink jonas-schievink added A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc labels Jul 28, 2020
@RalfJung
Copy link
Member

RalfJung commented Jul 28, 2020

We have adjusted the const test to be endianess-independent in #73989.

@estebank
Copy link
Contributor

For the suggestion in missing-trait-bounds-for-method-call.rs we can presort the restrictions so that the output is always consistent.

@estebank estebank added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 28, 2020
@bors bors closed this as completed in e614f66 Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants