about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-11-15Auto merge of #55974 - pietroalbini:rollup, r=pietroalbinibors-3/+119
Rollup of 17 pull requests Successful merges: - #55182 (Redox: Update to new changes) - #55211 (Add BufWriter::buffer method) - #55507 (Add link to std::mem::size_of to size_of intrinsic documentation) - #55530 (Speed up String::from_utf16) - #55556 (Use `Mmap` to open the rmeta file.) - #55622 (NetBSD: link libstd with librt in addition to libpthread) - #55750 (Make `NodeId` and `HirLocalId` `newtype_index`) - #55778 (Wrap some query results in `Lrc`.) - #55781 (More precise spans for temps and their drops) - #55785 (Add mem::forget_unsized() for forgetting unsized values) - #55852 (Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint) - #55865 (Unix RwLock: avoid racy access to write_locked) - #55901 (fix various typos in doc comments) - #55926 (Change sidebar selector to fix compatibility with docs.rs) - #55930 (A handful of hir tweaks) - #55932 (core/char: Speed up `to_digit()` for `radix <= 10`) - #55956 (add tests for some fixed ICEs) Failed merges: r? @ghost
2018-11-15Rollup merge of #55956 - euclio:issue-55587, r=estebankPietro Albini-0/+35
add tests for some fixed ICEs Fixes #55587. Fixes #54348. Looks like these ICEs are already fixed in nightly, so this PR just adds tests. r? @estebank
2018-11-15Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavisPietro Albini-2/+20
Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint Fixes https://github.com/rust-lang/rust/issues/51043.
2018-11-15Rollup merge of #55781 - ↵Pietro Albini-0/+63
pnkfelix:issue-54382-more-precise-spans-for-temps-and-their-drops, r=davidtwco More precise spans for temps and their drops This PR has two main enhancements: 1. when possible during code generation for a statement (like `expr();`), pass along the span of a statement, and then attribute the drops of temporaries from that statement to the statement's end-point (which will be the semicolon if it is a statement that is terminating by a semicolon). 2. when evaluating a block expression into a MIR temp, use the span of the block's tail expression (rather than the span of whole block including its statements and curly-braces) for the span of the temp. Each of these individually increases the precision of our diagnostic output; together they combine to make a much clearer picture about the control flow through the spans. Fix #54382
2018-11-15Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoeristerPietro Albini-1/+1
Make `NodeId` and `HirLocalId` `newtype_index`
2018-11-15Auto merge of #54906 - qnighy:fix-issue-50452, r=nikomatsakisbors-0/+61
Reattach all grandchildren when constructing specialization graph. Specialization graphs are constructed by incrementally adding impls in the order of declaration. If the impl being added has its specializations in the graph already, they should be reattached under the impl. However, the current implementation only reattaches the one found first. Therefore, in the following specialization graph, ``` Tr1 | I3 / \ I1 I2 ``` If `I1`, `I2`, and `I3` are declared in this order, the compiler mistakenly constructs the following graph: ``` Tr1 / \ I3 I2 | I1 ``` This patch fixes the reattach procedure to include all specializing grandchildren-to-be. Fixes #50452.
2018-11-15Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obkbors-4/+68
Add escape-to-raw MIR statement Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses. ~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
2018-11-14std: Synchronize access to global env during `exec`Alex Crichton-0/+36
This commit, after reverting #55359, applies a different fix for #46775 while also fixing #55775. The basic idea was to go back to pre-#55359 libstd, and then fix #46775 in a way that doesn't expose #55775. The issue described in #46775 boils down to two problems: * First, the global environment is reset during `exec` but, but if the `exec` call fails then the global environment was a dangling pointer into free'd memory as the block of memory was deallocated when `Command` is dropped. This is fixed in this commit by installing a `Drop` stack object which ensures that the `environ` pointer is preserved on a failing `exec`. * Second, the global environment was accessed in an unsynchronized fashion during `exec`. This was fixed by ensuring that the Rust-specific environment lock is acquired for these system-level operations. Thanks to Alex Gaynor for pioneering the solution here! Closes #55775 Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-11-14add test for issue #54348Andy Russell-0/+21
2018-11-14add test for issue #55587Andy Russell-0/+14
2018-11-14Revert "Fixes #46775 -- don't mutate the process's environment in Command::exec"Alex Crichton-12/+0
This reverts commit 36fe3b605a7a7143a14565272140ba1b43c1b041.
2018-11-14Auto merge of #52153 - csmoe:projeq_normal, r=scalexmbors-0/+1
chalk lowering rule: ProjectionEq-Normalize cc #49177 r? @scalexm
2018-11-13Auto merge of #55912 - kennytm:rollup, r=kennytmbors-5/+144
Rollup of 20 pull requests Successful merges: - #55136 (Remove short doc where it starts with a codeblock) - #55711 (Format BtreeMap::range_mut example) - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters) - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err) - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to) - #55805 (Move `static_assert!` into librustc_data_structures) - #55837 (Make PhantomData #[structural_match]) - #55840 (Fix TLS errors when downloading stage0) - #55843 (add FromIterator<A> to Box<[A]>) - #55858 (Small fixes on code blocks in rustdoc) - #55863 (Fix a typo in std::panic) - #55870 (Fix typos.) - #55874 (string: Add documentation for `From` impls) - #55879 (save-analysis: Don't panic for macro-generated use globs) - #55882 (Reference count `crate_inherent_impls`s return value.) - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra) - #55889 (global allocators: add a few comments) - #55896 (Document optimizations enabled by FusedIterator) - #55905 (Change `Lit::short_name` to `Lit::literal_name`.) - #55908 (Fix their/there grammar nit)
2018-11-13Implement `ProjectionEq-Normalize`csmoe-0/+1
2018-11-13Auto merge of #55356 - Aaron1011:fix/rustdoc-negative-auto, r=nikomatsakisbors-0/+27
Check for negative impls when finding auto traits Fixes #55321 When AutoTraitFinder begins examining a type, it checks for an explicit negative impl. However, it wasn't checking for negative impls found when calling 'select' on predicates found from nested obligations. This commit makes AutoTraitFinder check for negative impls whenever it makes a call to 'select'. If a negative impl is found, it immediately bails out. Normal users of SelectioContext don't need to worry about this, since they stop as soon as an Unimplemented error is encountered. However, we add predicates to our ParamEnv when we encounter this error, so we need to handle negative impls specially (so that we don't try adding them to our ParamEnv).
2018-11-13Fix ui testsscalexm-6/+6
2018-11-13Use a dummy outlives requirement for `where Type:,` (see #53696)scalexm-2/+2
A `WF(Type)` predicate was used previously, which did not play well with implied bounds in chalk.
2018-11-13Bypass ppaux for `Outlives` predicatesscalexm-11/+11
2018-11-13Provide program clauses for builtin typesscalexm-0/+2
2018-11-13Pretty print quantified goals and clausesscalexm-64/+51
2018-11-13Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavuskennytm-3/+25
Remove short doc where it starts with a codeblock Fixes #54975.
2018-11-13Rollup merge of #55870 - waywardmonkeys:typo-fixes, r=wesleywiserkennytm-2/+2
Fix typos.
2018-11-13Rollup merge of #55837 - Centril:spökdata-skall-vara-strukturellt-matchbar, ↵kennytm-0/+53
r=eddyb Make PhantomData #[structural_match] fixes https://github.com/rust-lang/rust/issues/55028 This makes `PhantomData<T>` structurally matchable, irrespective of whether `T` is, per the discussion on this week's language team meeting (the general consensus was that this was a bug-fix). All types containing `PhantomData<T>` and which used `#[derive(PartialEq, Eq)]` and were previously not `#[structural_match]` only because of `PhantomData<T>` will now be `#[structural_match]`. r? @nikomatsakis
2018-11-13Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelixkennytm-0/+64
rustdoc: don't inline `pub use some_crate` unless directly asked to cc https://github.com/rust-lang/rust/issues/52509 (fixes it? i'm not sure about my comment summoning the docs team) When rustdoc encounters a `pub use` statement for an item from another crate, it will eagerly inline its contents into your crate. This somewhat clashes with the new paths behavior in Rust 2018, in which crates are implicitly linked and re-exported with `pub use` instead of `pub extern crate`. In rust 2015, `pub extern crate` would only create a single line for its re-export in the docs, so i'm making it do the same with `pub use some_crate;`. The exact new behavior is like this: *If rustdoc sees a `pub use` statement, and the item being imported is the root of another crate, it will only inline it if `#[doc(inline)]` is provided.* I made it only avoid crate roots because otherwise it would stop inlining any module, which may or may not be what people want.
2018-11-13Auto merge of #55589 - oli-obk:min_length_💣, r=pnkfelixbors-1/+1
Add `VariantIdx` type and use instead of `usize`
2018-11-12Auto merge of #55278 - Centril:constification-1, r=alexcrichtonbors-42/+88
Minor standard library constification This PR makes some bits of the standard library into `const fn`s. I've tried to be as aggressive as I possibly could in the constification. The list is rather small due to how restrictive `const fn` is at the moment. r? @oli-obk cc @rust-lang/libs Stable public APIs affected: + [x] `Cell::as_ptr` + [x] `UnsafeCell::get` + [x] `char::is_ascii` + [x] `iter::empty` + [x] `ManuallyDrop::{new, into_inner}` + [x] `RangeInclusive::{start, end}` + [x] `NonNull::as_ptr` + [x] `{[T], str}::as_ptr` + [x] `Duration::{as_secs, subsec_millis, subsec_micros, subsec_nanos}` + [x] `CStr::as_ptr` + [x] `Ipv4Addr::is_unspecified` + [x] `Ipv6Addr::new` + [x] `Ipv6Addr::octets` Unstable public APIs affected: + [x] `Duration::{as_millis, as_micros, as_nanos, as_float_secs}` + [x] `Wrapping::{count_ones, count_zeros, trailing_zeros, rotate_left, rotate_right, swap_bytes, reverse_bits, from_be, from_le, to_be, to_le, leading_zeros, is_positive, is_negative, leading_zeros}` + [x] `core::convert::identity` -------------------------- ## Removed from list in first pass: Stable public APIs affected: + [ ] `BTree{Map, Set}::{len, is_empty}` + [ ] `VecDeque::is_empty` + [ ] `String::{is_empty, len}` + [ ] `FromUtf8Error::utf8_error` + [ ] `Vec<T>::{is_empty, len}` + [ ] `Layout::size` + [ ] `DecodeUtf16Error::unpaired_surrogate` + [ ] `core::fmt::{fill, width, precision, sign_plus, sign_minus, alternate, sign_aware_zero_pad}` + [ ] `panic::Location::{file, line, column}` + [ ] `{ChunksExact, RChunksExact}::remainder` + [ ] `Utf8Error::valid_up_to` + [ ] `VacantEntry::key` + [ ] `NulError::nul_position` + [ ] `IntoStringError::utf8_error` + [ ] `IntoInnerError::error` + [ ] `io::Chain::get_ref` + [ ] `io::Take::{limit, get_ref}` + [ ] `SocketAddrV6::{flowinfo, scope_id}` + [ ] `PrefixComponent::{kind, as_os_str}` + [ ] `Path::{ancestors, display}` + [ ] `WaitTimeoutResult::timed_out` + [ ] `Receiver::{iter, try_iter}` + [ ] `thread::JoinHandle::thread` + [ ] `SystemTimeError::duration` Unstable public APIs affected: + [ ] `core::fmt::Arguments::new_v1` + [ ] `core::fmt::Arguments::new_v1_formatted` + [ ] `Pin::{get_ref, into_ref}` + [ ] `Utf8Lossy::chunks` + [ ] `LocalWaker::as_waker` + [ ] `panic::PanicInfo::{internal_constructor, message, location}` + [ ] `panic::Location::{internal_constructor }` ## Removed from list in 2nd pass: Stable public APIs affected: + [ ] `LinkedList::{new, iter, is_empty, len}` + [ ] `mem::forget` + [ ] `Cursor::{new, get_ref, position}` + [ ] `io::{empty, repeat, sink}` + [ ] `PoisonError::new` + [ ] `thread::Builder::new` + [ ] `process::Stdio::{piped, inherit, null}` Unstable public APIs affected: + [ ] `io::Initializer::{zeroing, should_initialize}`
2018-11-12miri-engine value visitor update to VariantIdxOliver Scherer-1/+1
2018-11-12Fix fulldeps test with NodeIdOliver Scherer-1/+1
2018-11-12Auto merge of #55701 - tromey:ice-fix, r=matthewjasperbors-0/+63
Fix emission of niche-filling discriminant values Bug #55606 points out a regression introduced by #54004; namely that an assertion can erroneously fire when a niche-filling discriminant value is emitted. This fixes the bug by removing the assertion, and furthermore by arranging for the discriminant value to be masked according to the size of the niche. This makes handling the discriminant a bit simpler for debuggers. The test case is from Jonathan Turner. Closes #55606
2018-11-11Auto merge of #55657 - davidtwco:issue-55651, r=pnkfelixbors-25/+51
NLL Diagnostic Review 3: Unions not reinitialized after assignment into field Fixes #55651, #55652. This PR makes two changes: First, it updates the dataflow builder to add an init for the place containing a union if there is an assignment into the field of that union. Second, it stops a "use of uninitialized" error occuring when there is an assignment into the field of an uninitialized union that was previously initialized. Making this assignment would re-initialize the union, as tested in `src/test/ui/borrowck/borrowck-union-move-assign.nll.stderr`. The check for previous initialization ensures that we do not start supporting partial initialization yet (cc #21232, #54499, #54986). This PR also fixes #55652 which was marked as requiring investigation as the changes in this PR add an error that was previously missing (and mentioned in the review comments) and confirms that the error that was present is correct and a result of earlier partial initialization changes in NLL. r? @pnkfelix (due to earlier work with partial initialization) cc @nikomatsakis
2018-11-11Fix typos.Bruce Mitchener-2/+2
2018-11-11Rollup merge of #55630 - petrochenkov:noprelude, r=Centrilkennytm-1/+25
resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition This is a tiny thing. For historical reasons macro prelude (macros from `#[macro_use] extern crate ...`, including `extern crate std`) is still available in modules with `#[no_implicit_prelude]`. This PR provides proper isolation and removes those names from scope. `#[no_implicit_prelude]` modules still have built-in types (`u8`), built-in attributes (`#[inline]`) and built-in macros (`env!("PATH")`) in scope. We can introduce some `#[no_implicit_prelude_at_all]` to remove those as well, but that's a separate issue. The change is done only on 2018 edition for backward compatibility. I'm pretty sure this can be done on 2015 as well because `#[no_implicit_prelude]` is rarely used, but I don't want to go through the crater/deprecation process right now, maybe later. cc https://github.com/rust-lang/rust/issues/53977 r? @ghost
2018-11-11Rollup merge of #55828 - oli-obk:promotion_strikes_again, r=eddybPietro Albini-0/+74
Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value` cc @pnkfelix fixes #55806
2018-11-11Rollup merge of #55822 - davidtwco:issue-55394, r=pnkfelixPietro Albini-0/+37
ICE with #![feature(nll)] and elided lifetimes Fixes #55394. This commit fixes an ICE and determines the correct return span in cases with a method implemented on a struct with an an elided lifetime. r? @pnkfelix
2018-11-11Rollup merge of #55819 - pnkfelix:issue-55810-must-typeck-pats-eagerly, ↵Pietro Albini-0/+23
r=oli-obk Typecheck patterns of all match arms first, so we get types for bindings Fix eventually (after backport to beta) the issue #55810
2018-11-11Rollup merge of #55802 - wesleywiser:inlined_calls_2_electric_boogaloo, r=nagisaPietro Albini-0/+36
Don't inline virtual calls (take 2) When I fixed the previous mis-optimizations, I didn't realize there were actually two different places where we mutate `callsites` and both of them should have the same behavior. As a result, if a function was inlined and that function contained virtual function calls, they were incorrectly being inlined. I also added a test case which covers this.
2018-11-11Rollup merge of #55801 - pnkfelix:update-box-insensitivity-test-for-nll, ↵Pietro Albini-86/+103
r=davidtwco NLL: Update box insensitivity test This is just keeping one of our tests honest with respect to NLL, in two ways: 1. Adds uses of borrows that would otherwise be too short to observe the error that we would have expected to see... 2. ... I say "would have expected" because all of the errors in this file are part of the reversion of rust-lang/rfcs#130 that is attached to NLL (you can see more discussion of this here https://github.com/rust-lang/rust/issues/43234#issuecomment-411017768 )
2018-11-11Rollup merge of #55800 - estebank:abolish-ice-for-lifetime, r=oli-obkPietro Albini-0/+72
Fix ICE in `return_type_impl_trait` Fix #55796.
2018-11-11Rollup merge of #55799 - ↵Pietro Albini-202/+52
pnkfelix:remove-useless-revisions-marker-from-lint-unused-mut-variables, r=davidtwco Removed unneeded instance of `// revisions` from a lint test Removed an unneeded instance of `// revisions`; the compare-mode=nll shows the output is identical now. cc #54528
2018-11-11Rollup merge of #55792 - oli-obk:propsicle, r=RalfJungPietro Albini-0/+28
Prevent ICE in const-prop array oob check fixes https://github.com/rust-lang/rust/issues/55772 fixes https://github.com/rust-lang/rust/issues/54541
2018-11-11Rollup merge of #55687 - alexreg:fix-24010, r=scalexmPietro Albini-51/+158
Take supertraits into account when calculating associated types Fixes #24010 and #23856. Applies to trait aliases too. As a by-product, this PR also makes repeated bindings of the same associated item in the same definition a hard error. This was previously a warning with a note about it becoming a hard error in the future. See #50589 for more info. I talked about this with @nikomatsakis recently, but only very superficially, so this shouldn't stop anyone from assigning it to themself to review and r+. N.B. The "WIP" commits represent imperfect attempts to solve the problem just for trait objects, but I've left them in for reference for the sake of whomever is reviewing this. CC @carllerche @theemathas @durka @mbrubeck
2018-11-10Use non-short suggestion for parenthesised ..=varkor-2/+2
2018-11-10Rewrite `...` as `..=` as a MachineApplicable 2018 idiom lintvarkor-2/+20
2018-11-10Remove short doc where it starts with a codeblockGuillaume Gomez-3/+25
2018-11-10Auto merge of #55637 - ↵bors-0/+31
pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out-of-a-ty-var, r=nikomatsakis Do not attempt to ascribe projections out of a ty var If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types. Fix #55552
2018-11-10Auto merge of #55717 - oli-obk:rustdoc_overflow, r=pnkfelixbors-1/+2
Bubble up an overflow error so that rustdoc can ignore it fixes #54524 Idk how to write a test for this, other than trying to minimize the entire diesel crate. If desirable I will do that. Note that there are many other such overflow errors hiding out there. Should we try to proactively eliminate them or do we just whack-a-mole them? cc @GuillaumeGomez r? @nikomatsakis
2018-11-09Don't inline virtual calls (take 2)Wesley Wiser-0/+36
When I fixed the previous mis-optimizations, I didn't realize there were actually two different places where we mutate `callsites` and both of them should have the same behavior. As a result, if a function was inlined and that function contained virtual function calls, they were incorrectly being inlined. I also added a test case which covers this.
2018-11-10make PhantomData #[structural_match].Mazdak Farrokhzad-0/+53
2018-11-10adjust ui/../mod-static-with-const-fn.rsMazdak Farrokhzad-3/+15
2018-11-10Auto merge of #55626 - nikic:update-emscripten, r=alexcrichtonbors-15/+19
Update emscripten This updates emscripten to 1.38.15, which is based on LLVM 6.0.1 and would allow us to drop code for handling LLVM 4. The main issue I ran into is that exporting statics through `EXPORTED_FUNCTIONS` no longer works. As far as I understand exporting non-functions doesn't really make sense under emscripten anyway, so I've modified the symbol export code to not even try. Closes #52323.