Skip to content

Beta regression: References to what's supposed to be static singleton don't pointer compare as equal on 1.23.0-beta.1 #46371

Closed
@hsivonen

Description

@hsivonen

Steps to reproduce:

  1. git clone https://github.com/hsivonen/encoding_rs
  2. cd encoding_rs
  3. rustup default beta
  4. cargo test --release

Actual results:

failures:

---- test_labels_names::test_all_labels stdout ----
	thread 'test_labels_names::test_all_labels' panicked at 'assertion failed: `(left == right)`
  left: `Some(Encoding { windows-1252 })`,
 right: `Some(Encoding { windows-1252 })`', src/test_labels_names.rs:11:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- tests::test_label_resolution stdout ----
	thread 'tests::test_label_resolution' panicked at 'assertion failed: `(left == right)`
  left: `Some(Encoding { UTF-8 })`,
 right: `Some(Encoding { UTF-8 })`', src/lib.rs:4419:8

Note how left and right in both cases have the same debug stringification.

The eq implementation assumes that there is one instance of each encoding so it's OK to pointer compare them.

Various previous stable channel releases work. Nightly works. Beta works in debug mode. 1.23.0-beta.1 fails in release mode.

encoding_rs issue, Firefox bug

Metadata

Metadata

Labels

C-bugCategory: This is a bug.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions