about summary refs log tree commit diff
path: root/src/test/ui/enum-discriminant
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-882/+0
2023-01-04Move testsCaio-0/+39
2022-11-18rustc_codegen_ssa: Fix for codegen_get_discrMichael Benfield-0/+36
When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly. Fixes #104519
2022-11-12Move testsCaio-0/+30
2022-11-11rustc_codegen_ssa: Better code generation for niche discriminants.Michael Benfield-0/+114
In some cases we can avoid arithmetic before checking whether a niche represents an untagged variant. This is relevant to #101872
2022-10-22Bless testsDeadbeef-1/+1
2022-10-22Stabilize arbitrary_enum_discriminant, take 2Deadbeef-53/+6
2022-10-01bless ui testsMaybe Waffle-4/+4
2022-08-03Warn about dead tuple struct fieldsFabian Wolff-1/+3
2022-07-15Make item spans more consistentMichael Goulet-7/+2
2022-06-01update explicit impls error msglcnr-1/+1
2021-12-01Disallow non-c-like but "fieldless" ADTs from being casted to integer...Gary Guo-13/+0
... if they use arbitrary enum discriminant. Code like ```rust enum Enum { Foo = 1, Bar(), Baz{} } ``` seems to be unintentionally allowed so we couldn't disallow them now, but we could disallow them if arbitrary enum discriminant is used before 1.56 hits stable.
2021-11-13Auto merge of #89551 - jhpratt:stabilize-const_raw_ptr_deref, r=oli-obkbors-1/+1
Stabilize `const_raw_ptr_deref` for `*const T` This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is behind the same feature gate as mutable references. closes https://github.com/rust-lang/rust/issues/51911
2021-11-06Stabilize `const_raw_ptr_deref` for `*const T`Jacob Pratt-1/+1
This stabilizes dereferencing immutable raw pointers in const contexts. It does not stabilize `*mut T` dereferencing. This is placed behind the `const_raw_mut_ptr_deref` feature gate.
2021-11-06Move some tests to more reasonable directoriesCaio-0/+18
2021-10-19Fix issue 90038Gary Guo-0/+21
2021-10-14Revert "Stabilize `arbitrary_enum_discriminant`"Mark Rousskov-7/+54
This reverts commit 7a62f29f3171767090949778ce0f161e930706b9.
2021-10-11Add enum_intrinsics_non_enums lintFlying-Toast-0/+3
2021-10-04Stabilize `const_panic`Jacob Pratt-2/+0
2021-09-13enum niche allocation grows toward zero if possibleAndreas Liljeqvist-0/+14
2021-08-30`feature(const_generics)` -> `feature(const_param_types)`lcnr-3/+3
2021-08-30rename const_evaluatable_checked to generic_const_exprsEllen-3/+3
:sparkles:
2021-07-28Stabilize `arbitrary_enum_discriminant`Deadbeef-54/+7
2021-05-01Add help message for unused type paramkadmin-0/+1
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+25
Address comments Update limits
2020-12-26update testsBastian Kauschke-20/+19
2020-10-21Mark `repr128` as `incomplete_features`varkor-0/+36
2020-09-08add tracking issue, fix rebaseBastian Kauschke-1/+1
2020-09-08convert to future compat lintBastian Kauschke-5/+9
2020-09-08make `ConstEvaluatable` more strictBastian Kauschke-2/+11
2020-09-02pretty: trim paths of unique symbolsDan Aloni-1/+1
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-06-28Update testsDylan MacKenzie-1/+0
2020-06-10Migrate to numeric associated constsLzu Tao-9/+9
2020-05-19add test for repr(128) enum derivesBastian Kauschke-0/+17
2020-05-19add tests for enum discriminantsBastian Kauschke-0/+169
2020-05-19update `discriminant_value` usage in testsBastian Kauschke-12/+12
2020-05-02typeck: always expose explicit enum discriminant `AnonConst`s' parent in ↵Eduard-Mihai Burtescu-0/+79
`generics_of`.
2020-02-09--bless --compare-mode=nllMatthias Prechtl-3/+3
2019-11-21Reorganize, bless and add tests for const control flowDylan MacKenzie-0/+112
This creates a new test directory, `ui/consts/control-flow` to hold tests related to control flow in a const context. It also blesses all existing tests with the new error messages, and adds new tests for the `const_if_match` feature.
2019-11-06Rebase falloutOliver Scherer-24/+21
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-3/+3
https://github.com/rust-lang/rust/issues/60532
2019-06-21Implement arbitrary_enum_discriminantJohn Wrenn-0/+225