about summary refs log tree commit diff
path: root/src/test/run-pass/consts
AgeCommit message (Collapse)AuthorLines
2019-07-27tests: Move run-pass tests with naming conflicts to uiVadim Petrochenkov-268/+0
2019-07-27tests: Move run-pass tests without naming conflicts to uiVadim Petrochenkov-2167/+0
2019-07-27tests: Add missing run-pass annotationsVadim Petrochenkov-0/+13
2019-07-24Stabilize the type_name intrinsic in core::anySteven Fackler-1/+1
Closes rust-lang/rfcs#1428
2019-07-06while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.Mazdak Farrokhzad-10/+0
2019-06-19Rollup merge of #61701 - RalfJung:const-tests, r=cramertjMazdak Farrokhzad-0/+930
move stray run-pass const tests into const/ folder r? @oli-obk
2019-06-18Auto merge of #61864 - lzutao:ptr-null, r=sfacklerbors-2/+2
Make use of `ptr::null(_mut)` instead of casting zero There are few places that I don't replace the zero casting pointer with `ptr::null` or `ptr::null_mut`: ```bash % git grep -E '[ ([{]0 as \*' src/libcore/ptr/mod.rs:216:pub const fn null<T>() -> *const T { 0 as *const T } src/libcore/ptr/mod.rs:231:pub const fn null_mut<T>() -> *mut T { 0 as *mut T } src/test/run-pass/consts/const-cast-ptr-int.rs:12:static a: TestStruct = TestStruct{x: 0 as *const u8}; src/test/ui/issues/issue-45730.rs:5: let x: *const _ = 0 as *const _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.rs:8: let x = 0 as *const i32 as *const _ as *mut _; //~ ERROR cannot cast src/test/ui/issues/issue-45730.stderr:14:LL | let x: *const _ = 0 as *const _; src/test/ui/issues/issue-45730.stderr:24:LL | let x = 0 as *const i32 as *const _ as *mut _; src/test/ui/lint/lint-forbid-internal-unsafe.rs:15: println!("{}", evil!(*(0 as *const u8))); src/test/ui/order-dependent-cast-inference.rs:5: let mut y = 0 as *const _; src/test/ui/order-dependent-cast-inference.stderr:4:LL | let mut y = 0 as *const _; ``` r? @sfackler
2019-06-17Make use of `ptr::null(_mut)` instead of casting zeroLzu Tao-2/+2
2019-06-10test more variants of enum-int-castingRalf Jung-2/+11
2019-06-09move stray run-pass const tests into const/ folderRalf Jung-0/+930
2019-06-08extra paranoid modeRalf Jung-3/+5
2019-06-08black-box the fn ptr, not the resultRalf Jung-3/+3
2019-06-08remove useless ident() functions in const tests and replace the useful ones ↵Ralf Jung-13/+14
by black_box (with a comment)
2019-05-29Update run-pass test suite to use dynmemoryruins-4/+4
2019-05-12Auto merge of #60244 - SimonSapin:dangling, r=oli-obkbors-2/+0
const-stabilize NonNull::dangling and NonNull::cast
2019-04-28Add test case for labeled break in const assignmentAlexey Shmalko-0/+10
See https://github.com/rust-lang/rust/issues/51350 for more information.
2019-04-25const-stabilize NonNull::dangling and NonNull::castSimon Sapin-2/+0
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-02-28Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` constTim-0/+32
Make `Unique::as_ptr` const without feature attribute as it's unstable Make `NonNull::dangling` and `NonNull::cast` const with `feature = "const_ptr_nonnull"`
2018-12-31const-stabilize const_int_ops + reverse_bitsMazdak Farrokhzad-2/+0
2018-12-25Remove licensesMark Rousskov-750/+0
2018-12-11std: Depend directly on crates.io cratesAlex Crichton-1/+1
Ever since we added a Cargo-based build system for the compiler the standard library has always been a little special, it's never been able to depend on crates.io crates for runtime dependencies. This has been a result of various limitations, namely that Cargo doesn't understand that crates from crates.io depend on libcore, so Cargo tries to build crates before libcore is finished. I had an idea this afternoon, however, which lifts the strategy from #52919 to directly depend on crates.io crates from the standard library. After all is said and done this removes a whopping three submodules that we need to manage! The basic idea here is that for any crate `std` depends on it adds an *optional* dependency on an empty crate on crates.io, in this case named `rustc-std-workspace-core`. This crate is overridden via `[patch]` in this repository to point to a local crate we write, and *that* has a `path` dependency on libcore. Note that all `no_std` crates also depend on `compiler_builtins`, but if we're not using submodules we can publish `compiler_builtins` to crates.io and all crates can depend on it anyway! The basic strategy then looks like: * The standard library (or some transitive dep) decides to depend on a crate `foo`. * The standard library adds ```toml [dependencies] foo = { version = "0.1", features = ['rustc-dep-of-std'] } ``` * The crate `foo` has an optional dependency on `rustc-std-workspace-core` * The crate `foo` has an optional dependency on `compiler_builtins` * The crate `foo` has a feature `rustc-dep-of-std` which activates these crates and any other necessary infrastructure in the crate. A sample commit for `dlmalloc` [turns out to be quite simple][commit]. After that all `no_std` crates should largely build "as is" and still be publishable on crates.io! Notably they should be able to continue to use stable Rust if necessary, since the `rename-dependency` feature of Cargo is soon stabilizing. As a proof of concept, this commit removes the `dlmalloc`, `libcompiler_builtins`, and `libc` submodules from this repository. Long thorns in our side these are now gone for good and we can directly depend on crates.io! It's hoped that in the long term we can bring in other crates as necessary, but for now this is largely intended to simply make it easier to manage these crates and remove submodules. This should be a transparent non-breaking change for all users, but one possible stickler is that this almost for sure breaks out-of-tree `std`-building tools like `xargo` and `cargo-xbuild`. I think it should be relatively easy to get them working, however, as all that's needed is an entry in the `[patch]` section used to build the standard library. Hopefully we can work with these tools to solve this problem! [commit]: https://github.com/alexcrichton/dlmalloc-rs/commit/28ee12db813a3b650a7c25d1c36d2c17dcb88ae3
2018-11-08Fix some tests for wasm32-unknown-emscriptenNikita Popov-1/+1
2018-10-05Stabilize `min_const_fn`Oliver Schneider-12/+0
2018-09-26Add `#![allow(..)]` as necessary to get re-migrated run-pass tests compiling ↵Felix S. Klock II-0/+31
with clean stderr again. Most were added mechanically.
2018-09-26Migrate `src/test/ui/run-pass/*` back to `src/test/run-pass/`.Felix S. Klock II-0/+2184
Fix #54047