about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-07-21Expand test to cover type_name and monomorphic useGary Guo-15/+77
2020-07-19Guard against non-monomorphized type_id intrinsic callGary Guo-0/+40
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-22/+255
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-18Rollup merge of #74459 - canova:const-unreachable-unchecked, r=oli-obkManish Goregaokar-0/+81
Make unreachable_unchecked a const fn This PR makes `std::hint::unreachable_unchecked` a const fn so we can use it inside a const function. r? @RalfJung Fixes #53188.
2020-07-18Rollup merge of #74445 - lcnr:const-generic-ty-decl, r=Dylan-DPCManish Goregaokar-0/+48
add test for #62878 forgot to push this as part of #74159 r? @Dylan-DPC
2020-07-18Rollup merge of #74071 - petrochenkov:cload3, r=matthewjasperManish Goregaokar-34/+7
rustc_metadata: Make crate loading fully speculative Instead of reporting `span_err`s on the spot crate loading errors are now wrapped into the `CrateError` enum and returned, so they are reported only at the top level `resolve_crate` call, and not reported at all if we are resolving speculatively with `maybe_resolve_crate`. As a result we can attempt loading crates for error recovery (e.g. import suggestions) without any risk of producing extra errors. Also, this means better separation between error reporting and actual logic. Fixes https://github.com/rust-lang/rust/issues/55103 Fixes https://github.com/rust-lang/rust/issues/56590
2020-07-18rustc_metadata: Make crate loading fully speculativeVadim Petrochenkov-34/+7
2020-07-17Rollup merge of #74449 - tmiasko:cmpxchg-test, r=nikomatsakisManish Goregaokar-0/+60
Test codegen of compare_exchange operations Add a codegen test for compare_exchange to verify that rustc emits expected LLVM IR.
2020-07-17Rollup merge of #74448 - davidtwco:improper-ctypes-definitions-boxes, ↵Manish Goregaokar-63/+46
r=davidtwco improper_ctypes_definitions: allow `Box` Addresses https://github.com/rust-lang/rust/pull/72700#issuecomment-659449386. This PR stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. cc @alexcrichton @CryZe
2020-07-17Rollup merge of #74444 - Alexendoo:test-69414, r=nikomatsakisManish Goregaokar-2/+5
Add regression test for #69414 Closes #69414 (no longer ICEs after #74159)
2020-07-17Rollup merge of #74069 - erikdesjardins:bad-niche, r=nikomatsakisManish Goregaokar-3/+28
Compare tagged/niche-filling layout and pick the best one Finishes up #71045, and so fixes #63866. cc @eddyb r? @nikomatsakis (since @eddyb wrote the first commit)
2020-07-18Update UB test to fail during build with contant errorsNazım Can Altınova-5/+34
2020-07-17Rollup merge of #74452 - Manishearth:module-type-ns, r=jyn514Manish Goregaokar-0/+18
intra-doc links: resolve modules in the type namespace Fixes https://github.com/rust-lang/rust/issues/62830 Modules actually live in the type namespace, not all three, and it's not possible to clash a type with a module.
2020-07-17Rollup merge of #74438 - RalfJung:uninit-lint, r=davidtwcoManish Goregaokar-36/+73
warn about uninitialized multi-variant enums Fixes https://github.com/rust-lang/rust/issues/73608
2020-07-17Rollup merge of #74411 - jonas-schievink:unbreak-mir, r=matthewjasperManish Goregaokar-7/+0
Don't assign `()` to `!` MIR locals Implements the fix described in https://github.com/rust-lang/rust/issues/73860#issuecomment-651731893. Fixes https://github.com/rust-lang/rust/issues/73860 r? @matthewjasper
2020-07-17Rollup merge of #74364 - lcnr:lazy-norm-tests, r=nikomatsakisManish Goregaokar-0/+36
add lazy normalization regression tests We previously didn't have simple tests which fail if we aren't careful around lazy normalization. We now do.
2020-07-17Rollup merge of #74288 - haraldh:test_aslr, r=petrochenkovManish Goregaokar-1/+1
Fix src/test/run-make/static-pie/test-aslr.rs Might be subject to the birthday paradox occasionally, causing spurious failures. Addresses: https://github.com/rust-lang/rust/pull/70740#pullrequestreview-430981320
2020-07-17Rollup merge of #74056 - fusion-engineering-forks:fmt-arguments-as-str, ↵Manish Goregaokar-285/+273
r=Amanieu Add Arguments::as_str(). There exist quite a few macros in the Rust ecosystem which use `format_args!()` for formatting, but special case the one-argument case for optimization: ```rust #[macro_export] macro_rules! some_macro { ($s:expr) => { /* print &str directly, no formatting, no buffers */ }; ($s:expr, $($tt:tt)*) => { /* use format_args to write to a buffer first */ } } ``` E.g. [here](https://github.com/rust-embedded/cortex-m-semihosting/blob/7a961f0fbe6eb1b29a7ebde4bad4b9cf5f842b31/src/macros.rs#L48-L58), [here](https://github.com/rust-lang-nursery/failure/blob/20f9a9e223b7cd71aed541d050cc73a747fc00c4/src/macros.rs#L9-L17), and [here](https://github.com/fusion-engineering/px4-rust/blob/7b679cd6da9ffd95f36f6526d88345f8b36121da/px4/src/logging.rs#L45-L52). The problem with these is that a forgotten argument such as in `some_macro!("{}")` will not be diagnosed, but just prints `"{}"`. With this PR, it is possible to handle the no-arguments case separately *after* `format_args!()`, while simplifying the macro. Then these macros can give the proper error about a missing argument, just like `print!("{}")` does, while still using the same optimized implementation as before. This is even more important with [RFC 2795](https://github.com/rust-lang/rfcs/pull/2795), to make sure `some_macro!("{some_variable}")` works as expected.
2020-07-17Rollup merge of #74009 - mati865:mingw-tests-implib, r=nikomatsakisManish Goregaokar-54/+40
Fix MinGW `run-make-fulldeps` tests `compiler-rt-works-on-mingw` and `libs-search-path` were not ran because `only-mingw` doesn't match any target. Enabled and verified few ignored tests with `windows-gnu` toolchain. They are still ignored on MSVC since I'm not experienced with this target.
2020-07-17Rollup merge of #73930 - a1phyr:feature_const_option, r=dtolnayManish Goregaokar-0/+14
Make some Option methods const Tracking issue: #67441 Constantify the following methods of `Option`: - `as_ref` - `is_some` - `is_none` - `iter` (not sure about this one, but it is possible, and will be useful when const traits are a thing) cc @rust-lang/wg-const-eval @rust-lang/libs
2020-07-17Add test for module ambiguityManish Goregaokar-0/+18
2020-07-17Add a test for const unsafe_unreachable that triggers UBNazım Can Altınova-0/+35
2020-07-17Add a passing test for const unsafe_unreachableNazım Can Altınova-0/+17
2020-07-17Generating the coverage mapRich Kadel-22/+255
rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example: $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main 1| 1|pub fn will_be_called() { 2| 1| println!("called"); 3| 1|} 4| | 5| 0|pub fn will_not_be_called() { 6| 0| println!("should not have been called"); 7| 0|} 8| | 9| 1|fn main() { 10| 1| let less = 1; 11| 1| let more = 100; 12| 1| 13| 1| if less < more { 14| 1| will_be_called(); 15| 1| } else { 16| 1| will_not_be_called(); 17| 1| } 18| 1|}
2020-07-17Fix various tests to run on windows-gnuMateusz Mikuła-42/+39
2020-07-17Auto merge of #72983 - Lezzz:rename-typeck, r=nikomatsakisbors-234/+234
Rename TypeckTables to TypeckResults. Originally suggested by @eddyb.
2020-07-17improper_ctypes_definitions: allow `Box`David Wood-63/+46
This commit stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. Signed-off-by: David Wood <david@davidtw.co>
2020-07-17Remove invalid testMateusz Mikuła-11/+0
When ran on Windows `cp` will follow symlink: `checkout/build/<target>/<stage>/lib/rustlib/src/rust`. It points to `checkout` which means the test will get stuck in copying loop until there is no space left.
2020-07-17Create implib for dlls when testing MinGW targetsMateusz Mikuła-1/+1
2020-07-17Make fmt::Arguments::as_str() return a 'static str.Mara Bos-285/+273
2020-07-17add test for #62878Bastian Kauschke-0/+48
2020-07-17document test changesErik Desjardins-4/+12
2020-07-17compare tagged/niche-filling layout and pick the best oneErik Desjardins-3/+20
2020-07-17Add regression test for #69414Alex Macleod-2/+5
Closes #69414 (no longer ICEs after #74159)
2020-07-17warn about uninit multi-variant enumsRalf Jung-36/+73
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-234/+234
2020-07-16Update src/test/rustdoc/intra-doc-crate/auxiliary/hidden.rsManish Goregaokar-2/+2
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-07-16Add test for doc(hidden) intra-doc cross-crate reexportsManish Goregaokar-0/+29
2020-07-16Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, ↵Manish Goregaokar-4/+6
r=Mark-Simulacrum Do not render unstable items for rustc doc See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782 Before: ![image](https://user-images.githubusercontent.com/15225902/87501971-9cff8780-c68a-11ea-93b4-ea53ce18a77b.png) After: ![image](https://user-images.githubusercontent.com/15225902/87501985-a7218600-c68a-11ea-81c0-a6b5b120832c.png) Nothing changes in unstable items of std: Before: ![image](https://user-images.githubusercontent.com/15225902/87502004-b7d1fc00-c68a-11ea-9224-a27a1d2a81d6.png) After: ![image](https://user-images.githubusercontent.com/15225902/87502018-c0c2cd80-c68a-11ea-9773-4c63158025cb.png) Closes #54682
2020-07-16Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogbManish Goregaokar-5/+2
Enable some timeouts in SGX platform This would partially resolve https://github.com/fortanix/rust-sgx/issues/31 cc @jethrogb and @Goirad
2020-07-17Test codegen of compare_exchange operationsTomasz Miąsko-0/+60
2020-07-16Fix invalid lintJoshua Nelson-12/+12
intra_doc_resolution_failure is not a lint.
2020-07-16Add (broken and ignored) test for #73829Joshua Nelson-2/+4
2020-07-16Support intra-doc links on trait and module re-exportsJoshua Nelson-0/+46
Trait implementations are treated the same as modules for the purposes of intra-doc links.
2020-07-16Support intra-doc links on macro re-exportsJoshua Nelson-0/+42
This includes both `macro_rules!` and proc-macros.
2020-07-16rand -> my_randJoshua Nelson-4/+4
This fixes a failure in stage2 rustdoc tests.
2020-07-16 #![deny(intra_doc_resolution_failure)]Joshua Nelson-0/+12
2020-07-16Add test for submodules in inner crateJoshua Nelson-3/+20
2020-07-16Add test for documenting the re-exportJoshua Nelson-0/+13
2020-07-16Add test for re-exportsJoshua Nelson-0/+28
I had a hard time getting this to work without the `extern crate`, suggestions are welcome.