about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-03-21Rollup merge of #70184 - Centril:include-mod-relativism, r=petrochenkovMazdak Farrokhzad-0/+13
expand_include: set `.directory` to dir of included file. Resolves the regression noted in https://github.com/rust-lang/rust/pull/69838/#discussion_r395217057. r? @petrochenkov cc @eddyb @Mark-Simulacrum
2020-03-21Rollup merge of #70176 - rylev:ice-tests, r=CentrilMazdak Farrokhzad-0/+651
Add tests for #58319 and #65131 Fixes #58319 and fixes #65131
2020-03-21Rollup merge of #70165 - matthewjasper:erase-more, r=nikomatsakisMazdak Farrokhzad-17/+24
Remove the erase regions MIR transform We now ensure that MIR never contains unerased regions in the first place.
2020-03-21Rollup merge of #70111 - Mark-Simulacrum:btree-no-shared, r=cuviperMazdak Farrokhzad-7/+17
BTreeMap: remove shared root This replaces the shared root with `Option`s in the BTreeMap code, and then slightly cleans up the node manipulation code taking advantage of the removal of the shared root. I expect that further simplification is possible, but wanted to get this posted for initial review. Note that `BTreeMap::new()` continues to not allocate. Benchmarks seem within the margin of error/unaffected, as expected for an entirely predictable branch. ``` name alloc-bench-a ns/iter alloc-bench-b ns/iter diff ns/iter diff % speedup btree::map::iter_mut_20 20 21 1 5.00% x 0.95 btree::set::clone_100 1,360 1,439 79 5.81% x 0.95 btree::set::clone_100_and_into_iter 1,319 1,434 115 8.72% x 0.92 btree::set::clone_10k 143,515 150,991 7,476 5.21% x 0.95 btree::set::clone_10k_and_clear 142,792 152,916 10,124 7.09% x 0.93 btree::set::clone_10k_and_into_iter 146,019 154,561 8,542 5.85% x 0.94 ```
2020-03-21Rollup merge of #70058 - Centril:fix-70050, r=petrochenkovMazdak Farrokhzad-1/+37
can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs. Make `can_begin_literal_or_bool` (renamed to `can_begin_literal_maybe_minus`) accept `NtLiteral(e) | NtExpr(e)` where `e` is either a literal or a negated literal. Fixes https://github.com/rust-lang/rust/issues/70050. r? @petrochenkov
2020-03-21Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJungMazdak Farrokhzad-0/+22
Remove the call that makes miri fail Fixes the concern raised in https://github.com/rust-lang/rust/pull/69645/files#r392884274 cc @RalfJung
2020-03-21Rollup merge of #69033 - jonas-schievink:resume-with-context, r=tmandryMazdak Farrokhzad-2/+15
Use generator resume arguments in the async/await lowering This removes the TLS requirement from async/await and enables it in `#![no_std]` crates. Closes https://github.com/rust-lang/rust/issues/56974 I'm not confident the HIR lowering is completely correct, there seem to be quite a few undocumented invariants in there. The `async-std` and tokio test suites are passing with these changes though.
2020-03-20Auto merge of #69509 - RalfJung:debug-assert-write, r=eddybbors-9/+5
debug-assert ptr sanity in ptr::write This is a re-submission of the parts that we removed from https://github.com/rust-lang/rust/pull/69208 due to ["interesting" test failures](https://github.com/rust-lang/rust/pull/69208#issuecomment-591310437). Fixes https://github.com/rust-lang/rust/issues/53871 r? @Mark-Simulacrum @eddyb
2020-03-20expand_include: set `.directory` to dir of included file.Mazdak Farrokhzad-0/+13
2020-03-20Fix debugger pretty printing of BTreesMark Rousskov-7/+17
2020-03-20can_begin_literal_maybe_minus: `true` on `"-"? lit` NTs.Mazdak Farrokhzad-1/+37
2020-03-20Add tests for #58319 and #65131Ryan Levick-0/+651
2020-03-20Update const_forget.rsDutchGhost-1/+1
2020-03-20Rollup merge of #70131 - Aaron1011:fix/issue-55099-test, r=nikomatsakisYuki Okushi-0/+28
Add regression test for TAIT lifetime inference (issue #55099) Fixes #55099 The minimized reproducer in issue #55099 now compiles successfully. This commit adds a regression test for it.
2020-03-19Use erased regions in MIRMatthew Jasper-17/+24
2020-03-19Auto merge of #69402 - GuillaumeGomez:extend-search, r=kinnisonbors-0/+20
Extend search I realized that when looking for "struct:String" in the rustdoc search for example, the "in arguments" and "returned" tabs were always empty. After some investigation, I realized it was because we only provided the name, and not the type, making it impossible to pass the "type filtering" check. To resolve this, I added the type alongside the name. Note for the future: we could improve this by instead only registering the path id and use the path dictionary directly. The only problem with that solution (which I already tested) is that it becomes complicated for types in other crates. It'd force us to handle both case with an id and a case with `(name, type)`. I found the current PR big enough to not want to provide it directly. However, I think this is definitely worth it to make it work this way in the future. About the two tests I added: they don't have much interest except checking that we actually have something returned in the search in the cases of a type filtering with and without literal search. I also had to update a bit the test script to add the new locally global (haha) variable I created (`NO_TYPE_FILTER`). I added this variable to make the code easier to read than just "-1". r? @kinnison cc @ollie27
2020-03-19Rollup merge of #69959 - alexcrichton:fix-panic-in-print, r=Mark-SimulacrumMazdak Farrokhzad-0/+48
std: Don't abort process when printing panics in tests This commit fixes an issue when using `set_print` and friends, notably used by libtest, to avoid aborting the process if printing panics. This previously panicked due to borrowing a mutable `RefCell` twice, and this is worked around by borrowing these cells for less time, instead taking out and removing contents temporarily. Closes #69558
2020-03-19Rollup merge of #69814 - jonas-schievink:gen-ret-unw, r=ZoxcMazdak Farrokhzad-0/+34
Smaller and more correct generator codegen This removes unnecessary panicking branches in the resume function when the generator can not return or unwind, respectively. Closes https://github.com/rust-lang/rust/issues/66100 It also addresses the correctness concerns wrt poisoning on unwind. These are not currently a soundness issue because any operation *inside* a generator that could possibly unwind will result in a cleanup path for dropping it, ultimately reaching a `Resume` terminator, which we already handled correctly. Future MIR optimizations might optimize that out, though. r? @Zoxc
2020-03-19Add regression test for TAIT lifetime inference (issue #55099)Aaron Hill-0/+28
Fixes #55099 The minimized reproducer in issue #55099 now compiles successfully. This commit adds a regression test for it.
2020-03-18Properly handle Spans that reference imported SourceFilesAaron Hill-0/+44
Previously, metadata encoding used DUMMY_SP to represent any spans that referenced an 'imported' SourceFile - e.g. a SourceFile from an upstream dependency. These leads to sub-optimal error messages in certain cases (see the included test). This PR changes how we encode and decode spans in crate metadata. We encode spans in one of two ways: * 'Local' spans, which reference non-imported SourceFiles, are encoded exactly as before. * 'Foreign' spans, which reference imported SourceFiles, are encoded with the CrateNum of their 'originating' crate. Additionally, their 'lo' and 'high' values are rebased on top of the 'originating' crate, which allows them to be used with the SourceMap data encoded for that crate. The `ExternalSource` enum is renamed to `ExternalSourceKind`. There is now a struct called `ExternalSource`, which holds an `ExternalSourceKind` along with the original line number information for the file. This is used during `Span` serialization to rebase spans onto their 'owning' crate.
2020-03-18Move the const-forget test into ui testsDutchGhost-0/+22
2020-03-18Rollup merge of #70075 - GuillaumeGomez:fix-repr-display, r=petrochenkovMazdak Farrokhzad-19/+18
Fix repr pretty display Fixes #70027. r? @varkor
2020-03-18Rollup merge of #69920 - Centril:hir-cleanup, r=ZoxcMazdak Farrokhzad-8/+8
Remove some imports to the rustc crate - When we have `NestedVisitorMap::None`, we use `type Map = dyn intravisit::Map<'v>;` instead of the actual map. This doesn't actually result in dynamic dispatch (in the future we may want to use an associated type default to simplify the code). - Use `rustc_session::` imports instead of `rustc::{session, lint}`. r? @Zoxc
2020-03-18Rollup merge of #69839 - RalfJung:miri-error-cleanup, r=oli-obkMazdak Farrokhzad-81/+81
Miri error reform Some time ago we started moving Miri errors into a few distinct categories, but we never classified all the old errors. That's what this PR does. ~~This is on top of https://github.com/rust-lang/rust/pull/69762; [relative diff](https://github.com/RalfJung/rust/compare/validity-errors...RalfJung:miri-error-cleanup).~~ r? @oli-obk Fixes https://github.com/rust-lang/const-eval/issues/4
2020-03-18Rollup merge of #69838 - Centril:expand-module, r=petrochenkovMazdak Farrokhzad-46/+114
Expansion-driven outline module parsing After this PR, the parser will not do any conditional compilation or loading of external module files when `mod foo;` is encountered. Instead, the parser only leaves `mod foo;` in place in the AST, with no items filled in. Expansion later kicks in and will load the actual files and do the parsing. This entails that the following is now valid: ```rust #[cfg(FALSE)] mod foo { mod bar { mod baz; // `foo/bar/baz.rs` doesn't exist, but no error! } } ``` Fixes https://github.com/rust-lang/rust/issues/64197. r? @petrochenkov
2020-03-18Rollup merge of #69837 - jonas-schievink:gen-discr-opt, r=tmandryMazdak Farrokhzad-24/+158
Use smaller discriminants for generators Closes https://github.com/rust-lang/rust/issues/69815 I'm not yet sure about the runtime performance impact of this, so I'll try running this on some benchmarks (if I can find any). (Update: No impact on the benchmarks I've measured on) * [x] Add test with a generator that has exactly 256 total states * [x] Add test with a generator that has more than 256 states so that it needs to use a u16 discriminant * [x] Add tests for the size of `Option<[generator]>` * [x] Add tests for the `discriminant_value` intrinsic in all cases
2020-03-18Rollup merge of #69189 - matthewjasper:erase-the-world, r=nikomatsakisMazdak Farrokhzad-89/+110
Erase regions in writeback Regions in `TypeckTables` (except canonicalized user annotations) are now erased. Further, we no longer do lexical region solving on item bodies with `-Zborrowck=mir`. cc #68261 r? @nikomatsakis
2020-03-18Rollup merge of #69139 - GuillaumeGomez:cleanup-e0308, r=Dylan-DPCMazdak Farrokhzad-36/+52
clean up E0308 explanation r? @Dylan-DPC
2020-03-18--bless windows testMazdak Farrokhzad-5/+13
2020-03-18fix pre-expansion linting infraMazdak Farrokhzad-11/+27
2020-03-18use pretty-compare-only in a testMazdak Farrokhzad-0/+1
2020-03-18tweak outline module parsing spansMazdak Farrokhzad-24/+29
2020-03-18add test for stripped nested outline moduleMazdak Farrokhzad-0/+13
2020-03-18de-fatalize outline module parsingMazdak Farrokhzad-6/+34
2020-03-18submod_path: use id.spanMazdak Farrokhzad-9/+6
2020-03-18std: Don't abort process when printing panics in testsAlex Crichton-0/+48
This commit fixes an issue when using `set_print` and friends, notably used by libtest, to avoid aborting the process if printing panics. This previously panicked due to borrowing a mutable `RefCell` twice, and this is worked around by borrowing these cells for less time, instead taking out and removing contents temporarily. Closes #69558
2020-03-18increase stack slack for x86_64-pc-windows-gnuRalf Jung-3/+4
2020-03-17Test that async/await compiles with `#![no_std]`Jonas Schievink-0/+13
2020-03-17Make async/await lowering use resume argumentsJonas Schievink-2/+2
2020-03-17Update rustdoc test and remove TODO commentGuillaume Gomez-1/+1
2020-03-17Update pretty testsGuillaume Gomez-18/+17
2020-03-17Auto merge of #69519 - 12101111:remove-proc-macro-check, r=nagisabors-0/+16
Don't use static crt by default when build proc-macro Don't check value of `crt-static` when build proc-macro crates, since they are always built dynamically. For more information, see https://github.com/rust-lang/cargo/issues/7563#issuecomment-591965320 I hope this will fix issues about compiling `proc_macro` crates on musl host without bring more issues. Fix https://github.com/rust-lang/cargo/issues/7563
2020-03-17Rollup merge of #69922 - RalfJung:less-intrinsic, r=oli-obkMazdak Farrokhzad-48/+11
implement zeroed and uninitialized with MaybeUninit This is the second attempt of doing such a change (first PR: https://github.com/rust-lang/rust/pull/62150). The last change [got reverted](https://github.com/rust-lang/rust/pull/63343) because it [caused](https://github.com/rust-lang/rust/issues/62825) some [issues](https://github.com/rust-lang/rust/issues/52898#issuecomment-512182438) in [code that incorrectly used these functions](https://github.com/erlepereira/x11-rs/issues/99). Since then, the [problematic code has been fixed](https://github.com/erlepereira/x11-rs/pull/101), and rustc [gained a lint](https://github.com/rust-lang/rust/pull/63346) that is able to detect many misuses of these functions statically and a [dynamic check that panics](https://github.com/rust-lang/rust/pull/66059) instead of causing UB for some incorrect uses. Fixes https://github.com/rust-lang/rust/issues/62825
2020-03-17Rollup merge of #68746 - matthewjasper:metahygiene, r=petrochenkovMazdak Farrokhzad-0/+53
Make macro metavars respect (non-)hygiene This makes them more consistent with other name resolution while not breaking any code on crater.
2020-03-17Update tests for erasing regions in typeckMatthew Jasper-89/+110
2020-03-17Rollup merge of #70000 - petrochenkov:rawkeypars, r=davidtwcoMazdak Farrokhzad-6/+28
resolve: Fix regression in resolution of raw keywords in paths Fixes https://github.com/rust-lang/rust/issues/63882.
2020-03-17Rollup merge of #69881 - Centril:fix-69485, r=oli-obkMazdak Farrokhzad-0/+18
VariantSizeDifferences: bail on SizeOverflow Fixes #69485. r? @oli-obk
2020-03-17Rollup merge of #69870 - petrochenkov:cfgacc, r=matthewjasperMazdak Farrokhzad-0/+186
expand: Implement something similar to `#[cfg(accessible(path))]` cc https://github.com/rust-lang/rust/issues/64797 The feature is implemented as a `#[cfg_accessible(path)]` attribute macro rather than as `#[cfg(accessible(path))]` because it needs to wait until `path` becomes resolvable, and `cfg` cannot wait, but macros can wait. Later we can think about desugaring or not desugaring `#[cfg(accessible(path))]` into `#[cfg_accessible(path)]`. This implementation is also incomplete in the sense that it never returns "false" from `cfg_accessible(path)`, it requires some tweaks to resolve, which is not quite ready to answer queries like this during early resolution. However, the most important part of this PR is not `cfg_accessible` itself, but expansion infrastructure for retrying expansions. Before this PR we could say "we cannot resolve this macro path, let's try it later", with this PR we can say "we cannot expand this macro, let's try it later" as well. This is a pre-requisite for - turning `#[derive(...)]` into a regular attribute macro, - properly supporting eager expansion for macros that cannot yet be resolved like ``` fn main() { println!(not_available_yet!()); } macro_rules! make_available { () => { #[macro_export] macro_rules! not_available_yet { () => { "Hello world!" } }} } make_available!(); ```
2020-03-17Rollup merge of #69811 - petrochenkov:privdiag2, r=estebankMazdak Farrokhzad-6/+46
resolve: Print import chains on privacy errors A part of https://github.com/rust-lang/rust/pull/67951 that doesn't require hacks. r? @estebank
2020-03-17Ignore wasm3212101111-0/+1