about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-05-22Auto merge of #60840 - tmandry:preserve-scope-in-generator-mir, r=cramertjbors-0/+1
Preserve local scopes in generator MIR Part of #52924, depended upon by the generator layout optimization #60187. This PR adds `StorageDead` statements in more places in generators, so we can see when non-`Drop` locals have gone out of scope and recover their storage. The reason this is only done for generators is compiler performance. See https://github.com/rust-lang/rust/pull/60187#issuecomment-485637811 for what happens when we do this for all functions. For `Drop` locals, we modify the `MaybeStorageLive` analysis to use `drop` to indicate that storage is no longer live for the local. Once `drop` returns or unwinds to our function, we implicitly assume that the local is `StorageDead`. Instead of using `drop`, it is possible to emit more `StorageDead` statements in the MIR for `Drop` locals so we can handle all locals the same. I am fine with doing it that way, but this was the simplest approach for my purposes. It is also likely to be more performant. r? @Zoxc (feel free to reassign) cc @cramertj @eddyb @RalfJung @rust-lang/wg-async-await
2019-05-21Move `edition` outside the hygiene lock and avoid accessing itJohn Kåre Alsaker-7/+7
2019-05-21Auto merge of #60950 - taiki-e:arbitrary_self_types-tests, r=Centrilbors-3/+5
Move arbitrary self types's tests into ui/self https://github.com/rust-lang/rust/pull/60944#discussion_r285362006 r? @Centril
2019-05-20Rollup merge of #60823 - oli-obk:used_unused_no_mangle, r=michaelwoeristerMazdak Farrokhzad-7/+11
Fix incremental compilation of cdylib emitting spurious unused_attributes lint fixes #60050
2019-05-20Rollup merge of #60511 - taiki-e:libstd-intra-doc, r=Dylan-DPCMazdak Farrokhzad-0/+3
Fix intra-doc link resolution failure on re-exporting libstd Currently, re-exporting libstd items as below will [occur a lot of failures](https://gist.github.com/taiki-e/e33e0e8631ef47f65a74a3b69f456366). ```rust pub use std::*; ``` Until the underlying issue (#56922) fixed, we can fix that so they don't propagate to downstream crates. Related: https://github.com/rust-lang/rust/pull/56941 (That PR fixed failures that occur when re-exporting from libcore to libstd.) r? @QuietMisdreavus
2019-05-20Auto merge of #60445 - RalfJung:maybe-uninit, r=Centrilbors-2/+1
stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the future (1.40.0). This is part of implementing https://github.com/rust-lang/rfcs/pull/1892. Also expand the documentation a bit. This type is currently primarily useful when dealing with partially initialized arrays. In libstd, it is used e.g. in `BTreeMap` (with some unstable APIs that however can all be replaced, less ergonomically, by stable ones). What we stabilize should also be enough for `SmallVec` (Cc @bluss). Making this useful for structs requires https://github.com/rust-lang/rfcs/pull/2582 or a commitment that references to uninitialized data are not insta-UB.
2019-05-20stabilize core parts of MaybeUninit and deprecate mem::uninitialized in the ↵Ralf Jung-2/+1
future Also expand the documentation a bit
2019-05-20Auto merge of #60921 - cuviper:remove-mpsc_select, r=SimonSapinbors-37/+0
Remove the unstable and deprecated mpsc_select This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`, which were all unstable and have been deprecated since 1.32. Closes #27800 r? @SimonSapin
2019-05-20Rollup merge of #60908 - GuillaumeGomez:errors, r=oli-obkMazdak Farrokhzad-7/+76
Fix lints handling in rustdoc Part of #60664: now lints are handled just like any other lints you would setup in rustc. Still remains to handle `missing code examples` and `missing_docs` as part of the same group. r? @oli-obk
2019-05-20Rollup merge of #60745 - wesleywiser:const_prop_into_terminators, r=oli-obkMazdak Farrokhzad-6/+44
Perform constant propagation into terminators Perform constant propagation into MIR `Assert` and `SwitchInt` `Terminator`s which in some cases allows them to be removed by the branch simplification pass. r? @oli-obk
2019-05-20Rollup merge of #60590 - petertodd:2018-test-union-nonzero, ↵Mazdak Farrokhzad-0/+94
r=nikomatsakis,Centril Test interaction of unions with non-zero/niche-filling optimization Notably this nails down part of the behavior that MaybeUninit assumes, e.g. that a Option<MaybeUninit<&u8>> does not take advantage of non-zero optimization, and thus is a safe construct. It also verifies the status quo: that even unions that could theoretically take advantage of niches don't. (relevant: https://github.com/rust-lang/rust/issues/36394)
2019-05-19[const-prop] Support propagating into SwitchInt's `discr` OperandWesley Wiser-4/+42
2019-05-19[const-prop] Support propagating into Assert's `cond` OperandWesley Wiser-2/+2
2019-05-19Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27bors-4/+18
rustdoc: set the default edition when pre-parsing a doctest Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point) When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block. This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`) I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.
2019-05-19Move run-pass/self/* to ui/selfTaiki Endo-3/+3
2019-05-19Auto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboybors-0/+30
Fix display of const generics in rustdoc <img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png"> Part of #60737. cc @varkor r? @badboy
2019-05-19Move arbitrary_self_types's tests into ui/selfTaiki Endo-0/+2
2019-05-18Make clear that status quo ≠ guaranteePeter Todd-2/+3
2019-05-19Rollup merge of #60924 - estebank:try-msg, r=petrochenkovMazdak Farrokhzad-0/+3
Explain that ? converts the error type using From Fix #60917.
2019-05-19Rollup merge of #60370 - Richard-W:const-layout-construction, r=sfacklerMazdak Farrokhzad-0/+21
Mark core::alloc::Layout::from_size_align_unchecked const Makes it possible (pending stabilization of #57563 (`const_fn`)) to rewrite code like ```rust const BUFFER_SIZE: usize = 0x2000; const BUFFER_ALIGN: usize = 0x1000; fn foo() { let layout = std::alloc::Layout::from_size_align(BUFFER_SIZE, BUFFER_ALIGN) .unwrap(); let buffer = std::alloc::alloc(layout); } ``` to ```rust const BUFFER_LAYOUT: std::alloc::Layout = unsafe { std::alloc::Layout::from_size_align_unchecked(0x2000, 0x1000) }; fn foo() { let buffer = std::alloc::alloc(BUFFER_LAYOUT); } ``` which (although `unsafe` is used) looks somewhat cleaner and is easier to read.
2019-05-18Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearthbors-2/+2
Fix attrs pos Fixes #60042. Screenshot: <img width="438" alt="Screenshot 2019-05-12 at 15 02 25" src="https://user-images.githubusercontent.com/3050060/57582606-1455ec00-74c7-11e9-9d4e-5ec4da4de7dd.png"> r? @rust-lang/rustdoc
2019-05-18Auto merge of #60252 - davidtwco:issue-57672, r=Mark-Simulacrumbors-51/+47
Don't suggest changing extern crate w/ alias to use. Fixes #57672.
2019-05-18Fix display of const generics in rustdocGuillaume Gomez-0/+30
2019-05-18Update rustdoc-ui testsGuillaume Gomez-8/+38
2019-05-18Fix lints handling in rustdocGuillaume Gomez-0/+39
2019-05-18Auto merge of #60386 - Goirad:sgx-ignore-tests, r=nikomatsakisbors-20/+113
Added ignore-sgx for appropriate tests in src/test These are all the tests that make sense to ignore when targeting fortanix-unknonw-sgx, at least in test/runpass. Other suites not yet covered.
2019-05-17Auto merge of #49799 - hdhoang:46205_deny_incoherent_fundamental_impls, ↵bors-5/+2
r=nikomatsakis lint: convert incoherent_fundamental_impls into hard error *Summary for affected authors:* If your crate depends on one of the following crates, please upgrade to a newer version: - gtk-rs: upgrade to at least 0.4 - rusqlite: upgrade to at least 0.14 - nalgebra: upgrade to at least 0.15, or the last patch version of 0.14 - spade: upgrade or refresh the Cargo.lock file to use version 1.7 - imageproc: upgrade to at least 0.16 (newer versions no longer use nalgebra) implement #46205 r? @nikomatsakis
2019-05-17Explain that ? converts the error type using FromEsteban Küber-0/+3
2019-05-17Remove the unstable and deprecated mpsc_selectJosh Stone-37/+0
This removes macro `select!` and `std::sync::mpsc::{Handle, Select}`, which were all unstable and have been deprecated since 1.32.
2019-05-17Rollup merge of #60901 - estebank:str-str-str, r=CentrilManish Goregaokar-11/+170
Handle more string addition cases with appropriate suggestions
2019-05-17Account for &String + StringEsteban Küber-2/+2
2019-05-17Auto merge of #60171 - matthewjasper:full-nll-compare-mode, r=pnkfelixbors-962/+5201
Use -Zborrowck=mir for NLL compare mode closes #56993 r? @pnkfelix
2019-05-17Auto merge of #60892 - davidtwco:issue-60622, r=oli-obkbors-0/+45
Checking generic args after late bound region err. Fixes #60622. This PR fixes an ICE that occurs when a late bound region error is emitted and that resulted in the rest of the generic arguments of a function not being checked. For example, you could specify a generic type parameter `T` in a function call `foo<'_, T>()` to a function that doesn't have a generic type parameter. Since an error wasn't emitted from the function, compilation continued to parts of typeck that didn't expect a generic type argument in a call for a function that didn't have any generic type arguments.
2019-05-17Checking generic args after late bound region err.David Wood-0/+45
This commit fixes an ICE that occurs when a late bound region error is emitted and that resulted in the rest of the generic arguments of a function not being checked. For example, you could specify a generic type parameter `T` in a function call `foo<'_, T>()` to a function that doesn't have a generic type parameter. Since an error wasn't emitted from the function, compilation continued to parts of typeck that didn't expect a generic type argument in a call for a function that didn't have any generic type arguments.
2019-05-16review commentsEsteban Küber-13/+13
2019-05-16Fix binop spanEsteban Küber-12/+9
2019-05-16Handle more string addition cases with appropriate suggestionsEsteban Küber-4/+166
2019-05-17Rollup merge of #60873 - estebank:bad-await, r=CentrilMazdak Farrokhzad-27/+334
Parse alternative incorrect uses of await and recover Fix #60613. r? @Centril
2019-05-16Fix span for await macro callEsteban Küber-1/+1
2019-05-16reverted changed cfg test casesDario Gonzalez-8/+7
2019-05-16fixed issues relating to line numbers being shiftedDario Gonzalez-17/+17
2019-05-16Fixed tidy errorsDario Gonzalez-7/+2
2019-05-16Added ignore-sgx for appropriate testsDario Gonzalez-7/+106
2019-05-16Review commentsEsteban Küber-13/+13
- Change wording of suggestion - Move recovery logic to `diagnostics.rs` - Reduce ammount of code duplication
2019-05-16readd match await test caseEsteban Küber-2/+31
2019-05-16Point at enclosing fn/closure when it's not asyncEsteban Küber-32/+53
2019-05-16tidy fixEsteban Küber-1/+1
2019-05-16Simplify span usage for incorrect awaitEsteban Küber-42/+20
2019-05-16Parse alternative incorrect uses of await and recoverEsteban Küber-27/+306
2019-05-16Rollup merge of #60597 - wesleywiser:const_prop, r=oli-obkManish Goregaokar-0/+125
Do some simple constant propagation in the ConstProp pass r? @oli-obk I added a few test cases. Let me know if you think there should be more.