about summary refs log tree commit diff
path: root/src/test/ui/consts/std
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-160/+0
2022-12-27Fix ui constant tests for big-endian platformsUlrich Weigand-12/+15
A number of tests under ui/const-ptr and ui/consts are currently failing on big-endian platforms as the binary encoding of some constants is hard-coded in the stderr test files. Fix this by providing a normalize-stderr-test rule that strips out the raw bytes hex dump, so the comparison can be done in an endianness-independent manner. Note that in most cases, this means the tests are now also independent of word size, so the 32bit and 64bit cases can be re-unified. To keep tests that verify the details of those raw bytes dumps, a new test case raw-bytes.rs performs the tests where the hex dumps were stripped out a second time, but only on little- endian platforms. In addition, src/test/ui/const-ptr/forbidden_slices.rs exposes an endian-specific difference in this diagnostic output: constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean depending on which byte of D0 is not a boolean value (0 or 1). Fixed this by choosing a value of D0 that differs from 0 or 1 in all bytes. Fixes part of https://github.com/rust-lang/rust/issues/105383.
2022-07-01Shorten def_span for more items.Camille GILLOT-8/+8
2022-06-29fix stderr by hand since that test is not run on my systemRalf Jung-4/+4
2022-04-11fix Layout struct member naming styleliangyongrui-4/+4
2022-04-08Make non-power-of-two alignments a validity error in `Layout`Scott McMurray-9/+36
Inspired by the zulip conversation about how `Layout` should better enforce `size < isize::MAX as usize`, this uses an N-variant enum on N-bit platforms to require at the validity level that the existing invariant of "must be a power of two" is upheld. This was MIRI can catch it, and means there's a more-specific type for `Layout` to store than just `NonZeroUsize`.
2021-06-13update tests involving CTFE validationRémy Rakic-2/+2
2021-03-31Add 32bit.stderr files.Hameer Abbasi-0/+14
2021-03-31Rename stderr->64bit.stderr where needed.Hameer Abbasi-1/+2
2021-03-31Add allocation information to undefined behaviour errors.Hameer Abbasi-0/+3
2021-01-01Enhance some commentsoli-9/+14
2021-01-01Fix cell checks in const fnoli-0/+2
2021-01-01Allow references to interior mutable data behind a feature gateoli-10/+30
2020-11-26Move const ip in ui test to unit testDaiki Ihara-13/+0
2020-11-23Stabilize `IpAddr::is_ipv4` and `is_ipv6` as constChristiaan Dirkx-0/+13
Insta-stabilize the methods `is_ipv4` and `is_ipv6` of `IpAddr`. Possible because of the recent stabilization of const control flow. Also adds a test for these methods in a const context.
2020-09-03Make `Ipv4Addr` and `Ipv6Addr` const tests unit tests under `library`Christiaan Dirkx-111/+0
These tests are about the standard library, not the compiler itself, thus should live in `library`, see #76268.
2020-09-03Rollup merge of #76142 - CDirkx:const-ip, r=ecstatic-morseDylan DPC-0/+58
Make all methods of `std::net::Ipv4Addr` const Make the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature: - `octets` - `is_loopback` - `is_private` - `is_link_local` - `is_global` (unstable) - `is_shared` (unstable) - `is_ietf_protocol_assignment` (unstable) - `is_benchmarking` (unstable) - `is_reserved` (unstable) - `is_multicast` - `is_broadcast` - `is_documentation` - `to_ipv6_compatible` - `to_ipv6_mapped` This would make all methods of `Ipv6Addr` const. Of these methods, `is_global`, `is_broadcast`, `to_ipv6_compatible`, and `to_ipv6_mapped` require a change in implementation. Part of #76205
2020-09-01Make all remaining methods of `std::net::Ipv4Addr` constChristiaan Dirkx-1/+18
Makes the following methods of `std::net::Ipv4Addr` unstable const under the `const_ipv4` feature: - `is_global` - `is_reserved` - `is_broadcast` - `to_ipv6_compatible` - `to_ipv6_mapped` This results in all methods of `Ipv4Addr` being const. Also adds tests for these methods in a const context.
2020-09-01Add test for `Ipv4Addr` methods in a const contextChristiaan Dirkx-0/+41
2020-09-01Add trailing newline to `ipv6.rs`CDirkx-1/+1
2020-09-01Add test for `Ipv6Addr` methods in a const contextCDirkx-0/+53
2020-02-08Test `u8::is_ascii` alongside `char::is_ascii`Dylan MacKenzie-9/+0
2019-09-06Fixed grammar/style in error messages and reblessed tests.Alexander Regueiro-1/+1
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-1/+1
2019-05-14Add ui test for const Layout::from_size_align_uncheckedRichard Wiedenhöft-0/+21
2018-11-10Tidy ♪ all ♪ the ♪ way ♪♪♪♪ with ♪ a ♪ newline ♪ missing ↵Oliver Scherer-4/+4
♪ cry ♪♪
2018-11-10Add a few tests around raw pointers and interior mutabilityOliver Scherer-0/+73