about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-03-05Fix procedural_mbe_matching test case after libsyntax change.Michael Woerister-1/+1
2018-03-05incr.comp.: Add regression test for detecting feature gate changes.Michael Woerister-0/+23
2018-03-04Auto merge of #48592 - spastorino:borrowed_value_error, r=nikomatsakisbors-12/+167
[NLL] Avoid borrowed value must be valid for lifetime '_#2r..." in errors Closes #48428 - [x] If NLL is enabled, [do not invoke `note_and_explain_region`](https://github.com/rust-lang/rust/issues/48428#issuecomment-367691123) - [x] Modify `-Zdump-nll-cause` to not print [the overwhelming debug output here](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/borrow_check/nll/region_infer/mod.rs#L1288-L1299). This way we should I believe at least get nice-ish output for [our original example](https://github.com/rust-lang/rust/issues/48428#issue-299364536). - [x] Extend `explain_why_borrow_contains_point` to also work for "universal lifetimes" like the `'a` in [the example at the end of this comment](https://github.com/rust-lang/rust/issues/48428#issuecomment-367691123). - [ ] Figure out how to enable causal information all the time (but that is https://github.com/rust-lang/rust/issues/46590).
2018-03-04Auto merge of #47832 - fintelia:vec-index, r=kennytmbors-7/+8
Have Vec use slice's implementations of Index<I> and IndexMut<I> This PR simplifies the implementation of Index and IndexMut on Vec, and in the process enables indexing Vec by any user types that implement SliceIndex. The stability annotations probably need to be changed, but I wasn't sure of the right way to do that. It also wasn't completely clear to me if this change could break any existing code.
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-25/+1
This commit imports the LLD project from LLVM to serve as the default linker for the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently removed along with "binaryen linker" support in rustc. Moving to LLD brings with it a number of benefits for wasm code: * LLD is itself an actual linker, so there's no need to compile all wasm code with LTO any more. As a result builds should be *much* speedier as LTO is no longer forcibly enabled for all builds of the wasm target. * LLD is quickly becoming an "official solution" for linking wasm code together. This, I believe at least, is intended to be the main supported linker for native code and wasm moving forward. Picking up support early on should help ensure that we can help LLD identify bugs and otherwise prove that it works great for all our use cases! * Improvements to the wasm toolchain are currently primarily focused around LLVM and LLD (from what I can tell at least), so it's in general much better to be on this bandwagon for bugfixes and new features. * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which means a postprocessor is no longer needed to show off Rust's "small wasm binary size". LLD is added in a pretty standard way to rustc right now. A new rustbuild target was defined for building LLD, and this is executed when a compiler's sysroot is being assembled. LLD is compiled against the LLVM that we've got in tree, which means we're currently on the `release_60` branch, but this may get upgraded in the near future! LLD is placed into rustc's sysroot in a `bin` directory. This is similar to where `gcc.exe` can be found on Windows. This directory is automatically added to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd` linker which implements the interface that `wasm-ld`, LLD's frontend, expects. Like Emscripten the LLD target is currently only enabled for Tier 1 platforms, notably OSX/Windows/Linux, and will need to be installed manually for compiling to wasm on other platforms. LLD is by default turned off in rustbuild, and requires a `config.toml` option to be enabled to turn it on. Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD has a native option for controlling this. [gc]: https://reviews.llvm.org/D42511
2018-03-02Rollup merge of #48641 - alexcrichton:no-hash-l-paths, r=michaelwoeristerManish Goregaokar-10/+68
Fixes #47311. r? @nrc
2018-03-02Rollup merge of #48338 - estebank:match-missing-comma, r=petrochenkovManish Goregaokar-6/+68
Fixes #47311. r? @nrc
2018-03-02Don't have Vec<T> delegate to [T]'s bounds for indexingJonathan Behrens-1/+1
2018-03-02Update compile fail test error messagesJonathan Behrens-4/+4
2018-03-02Update UI testJonathan Behrens-3/+4
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-3/+4
2018-03-01rustc: More stable hashes of command line argumentsAlex Crichton-10/+68
Currently rustc isn't always the best at producing deterministic builds of a crate when the source directory of a crate is changed. This is happening due to what appears two different sources: * First the `-L` paths passed to rustc are hashed into the crate hash. These paths through Cargo are typically absolute paths that can vary if the build directory changes. * Next the paths passed to `--extern` are also hashed which like `-L` can change if the build directory changes. This commit fixes these two sources of nondeterminism by ensuring that avoiding tracking the hashes of these arguments on the command line. For `-L` paths they're either related to loading crates (whose hashes are tracked elsewhere) or native librarise used in the linking phase (which isn't incremental). The `--extern` paths are similar in that they're related to crate resolution which is already tracked independently of the command line arguments. Closes #48019
2018-03-01Make explain borrow work for Universal lifetimesSantiago Pastorino-12/+84
2018-03-01Rollup merge of #48610 - ishitatsuyuki:ishitatsuyuki-patch-1, r=nikomatsakisManish Goregaokar-0/+43
Add regression test for #48551 [Issue link](https://github.com/rust-lang/rust/issues/48551)
2018-03-01Rollup merge of #48585 - stjepang:stabilize-localkey-try_with, r=alexcrichtonManish Goregaokar-7/+5
Stabilize LocalKey::try_with The `LocalKey::try_with` method is now stabilized. `LocalKey::state` and `LocalKeyState` marked as deprecated. Although, is there any reason to keep them - should we perhaps remove them completely? Closes #27716 r? @alexcrichton
2018-03-01Rollup merge of #48572 - alexcrichton:noexcept-msvc2, r=eddybManish Goregaokar-0/+73
rustc: Tweak funclet cleanups of ffi functions This commit is targeted at addressing #48251 by specifically fixing a case where a longjmp over Rust frames on MSVC runs cleanups, accidentally running the "abort the program" cleanup as well. Added in #46833 `extern` ABI functions in Rust will abort the process if Rust panics, and currently this is modeled as a normal cleanup like all other destructors. Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the same mechanism used to implement panics in Rust. This means that `longjmp` over Rust frames will run Rust cleanups (even though we don't necessarily want it to). Notably this means that if you `longjmp` over a Rust stack frame then that probably means you'll abort the program because one of the cleanups will abort the process. After some discussion on IRC it turns out that `longjmp` doesn't run cleanups for *caught* exceptions, it only runs cleanups for cleanup pads. Using this information this commit tweaks the codegen for an `extern` function to a catch-all clause for exceptions instead of a cleanup block. This catch-all is equivalent to the C++ code: try { foo(); } catch (...) { bar(); } and in fact our codegen here is designed to match exactly what clang emits for that C++ code! With this tweak a longjmp over Rust code will no longer abort the process. A longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC. Other non-MSVC platforms will not rust destructors with a longjmp, so we'll probably still recommend "don't have destructors on the stack", but in any case this is a more surgical fix than #48567 and should help us stick to standard personality functions a bit longer.
2018-03-01Rollup merge of #48522 - ↵Manish Goregaokar-0/+44
etaoins:fix-find-width-of-character-at-span-bounds-check, r=estebank Fix find_width_of_character_at_span bounds check Commit 0bd96671f0 added bounds checking of our current target byte position to prevent infinite loops. Unfortunately it was comparing the file-relative `target` versus the global `file_start_pos` and `file_end_pos`. The result is failing to detect multibyte characters unless their file-relative offset fit within their global offset. This causes other parts of the compiler to generate spans pointing to the middle of a multibyte character which will ultimately panic in `bytepos_to_file_charpos`. Fix by comparing the `target` to the total file size when moving forward and doing checked subtraction when moving backwards. This should preserve the intent of the bounds check while removing the offset confusion. cc @davidtwco Fixes #48508
2018-03-01Rollup merge of #48500 - petrochenkov:parpat, r=nikomatsakisManish Goregaokar-3/+29
Support parentheses in patterns under feature gate This is a prerequisite for any other extensions to pattern syntax - `|` with multiple patterns, type ascription, `..PAT` in slice patterns. Closes https://github.com/rust-lang/rfcs/issues/554
2018-03-01Rollup merge of #48446 - mark-i-m:e0245, r=mark-i-mManish Goregaokar-2/+9
Remove E0245; improve E0404 Fix #36337 Somehow this is currently breaking --explain, but I don't understand how. r? @estebank
2018-03-01Auto merge of #46785 - leodasvacas:type-check-defaults-at-declaration, ↵bors-0/+143
r=nikomatsakis [Underspecified semantics] Type check defaults at declaration. Fixes #46669. See the test for code that compiles on stable but will no longer compile. This falls under a "Underspecified language semantics" fix. **Needs crater**. On type and trait declarations, we currently allow anything that name checks as a type parameter default. That allows the user to write a default that can never be applied, or even a default that may conditionally be applied depending on the type of another parameter. Mostly this just defers the error to use sites, but also allows clever hacks such as `Foo<T, U = <T as Iterator>::Item>` where `U` will be able to apply it's default only when `T: Iterator`. Maybe that means this bug is a feature, but it's a fiddly behaviour that seems undesirable. This PR validates defaults at declaration sites by ensuring all predicates on the parameter are valid for the default. With the exception of `Self: Sized` which we don't want to check to allow things like `trait Add<RHS = Self>`.
2018-03-01Add ignore-pretty for issue-48506.rsRyan Cumming-0/+1
The out-of-line module #37195
2018-02-28Rollup merge of #48461 - Manishearth:epoch-dyn-trait, r=nmatsakisManish Goregaokar-0/+1
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48380 - nikomatsakis:issue-48251-master, r=acrichtoManish Goregaokar-1/+4
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48359 - jsgf:remap-path-prefix, r=sanxiynManish Goregaokar-3/+3
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48355 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakisManish Goregaokar-0/+25
Fixes #47311. r? @nrc
2018-03-01Support parentheses in patterns under feature gateVadim Petrochenkov-3/+29
Improve recovery for trailing comma after `..`
2018-02-28rustc: Tweak funclet cleanups of ffi functionsAlex Crichton-0/+73
This commit is targeted at addressing #48251 by specifically fixing a case where a longjmp over Rust frames on MSVC runs cleanups, accidentally running the "abort the program" cleanup as well. Added in #46833 `extern` ABI functions in Rust will abort the process if Rust panics, and currently this is modeled as a normal cleanup like all other destructors. Unfortunately it turns out that `longjmp` on MSVC is implemented with SEH, the same mechanism used to implement panics in Rust. This means that `longjmp` over Rust frames will run Rust cleanups (even though we don't necessarily want it to). Notably this means that if you `longjmp` over a Rust stack frame then that probably means you'll abort the program because one of the cleanups will abort the process. After some discussion on IRC it turns out that `longjmp` doesn't run cleanups for *caught* exceptions, it only runs cleanups for cleanup pads. Using this information this commit tweaks the codegen for an `extern` function to a catch-all clause for exceptions instead of a cleanup block. This catch-all is equivalent to the C++ code: try { foo(); } catch (...) { bar(); } and in fact our codegen here is designed to match exactly what clang emits for that C++ code! With this tweak a longjmp over Rust code will no longer abort the process. A longjmp will continue to "accidentally" run Rust cleanups (destructors) on MSVC. Other non-MSVC platforms will not rust destructors with a longjmp, so we'll probably still recommend "don't have destructors on the stack", but in any case this is a more surgical fix than #48567 and should help us stick to standard personality functions a bit longer.
2018-02-28Fix a few run-pass testsStjepan Glavina-8/+5
2018-02-28fix rebaseEsteban Küber-4/+4
2018-02-28Remove E0245; improve E0404 explanationMark Mansi-2/+9
2018-02-28Update issue-48551.rsNiko Matsakis-0/+3
2018-02-28Update UI testleonardo.yvens-10/+11
2018-02-28Check only concrete defaults for well formednessleonardo.yvens-26/+15
2018-02-28Check only predicates with a single param with a concrete default.leonardo.yvens-60/+18
This is the most conservative possible and should be always correct.
2018-02-28Add tests for dependent defaults.leonardo.yvens-1/+16
2018-02-28Check WF of predicates with defaults only if all params have defaultsleonardo.yvens-19/+35
2018-02-28Check WF of predicate with defaults only if all in LHS have defaultleonardo.yvens-51/+31
Given a trait predicate, if all params appearing in the LHS have defaults then it should be a backwards compatible predicate. We verify that by checking the WF of predicate with all defaults substituted simultaneously.
2018-02-28Expand comments, address nits.leonardo.yvens-5/+38
2018-02-28Go back to checking only the LHS of trait predicates.leonardo.yvens-19/+42
2018-02-28default WF: Substitute defaults individually in the clauses.leonardo.yvens-1/+25
2018-02-28Check WF of defaults even when there are no bounds.leonardo.yvens-15/+25
2018-02-28Type check defaults.leonardo.yvens-0/+94
And refactor duplicated code.
2018-02-28Do not report _#nr lifetimes names in errorsSantiago Pastorino-0/+83
2018-02-28Add regression test for #48551Tatsuyuki Ishi-0/+40
2018-02-28Stabilize LocalKey::try_withStjepan Glavina-0/+1
2018-02-28Rollup merge of #48548 - alexcrichton:msvc-linker-utf16, r=alexcrichtonkennytm-9/+37
Encode linker arguments as UTF-16 on MSVC platforms This is a forward-port of #48455 to the master branch
2018-02-28Rollup merge of #48541 - varkor:inlined-main, r=michaelwoeristerkennytm-0/+12
Ensure main() always has external linkage This ensures that the entry function is never elided due to inlining, even with `inline(always)`. Fixes #47783. There were a couple of possible ways of addressing this issue; I simply picked the one that seemed most direct. A warning could be appropriate, but considering using inlining hints in other places it doesn't apply also throws no warnings, and it seems like an edge case anyway, I haven't added one for now.
2018-02-28Rollup merge of #48497 - scottmcm:more-restricted-termination, r=nikomatsakiskennytm-2/+5
Restrict the Termination impls to simplify stabilization Make a minimal commitment in preparation for stabilization. More impls, or broader ones, are likely in future, but are not necessary at this time and are more controversial. cc https://github.com/rust-lang/rust/issues/48453#issuecomment-368155082 r? @nikomatsakis
2018-02-28Rollup merge of #48484 - glaubitz:powerpcspe-linux, r=alexcrichtonkennytm-0/+2
Add support for powerpc-unknown-linux-gnuspe This PR adds support for the embedded PowerPC variant "e500". On Linux, this architecture is usually called "powerpcspe", it is a 32-bit PowerPC architecture. The main difference between normal 32-bit PowerPC and PowerPCSPE is the lack of Altivec instructions and the additional SPE instruction set. This architecture is supported in Debian through an unofficial port.
2018-02-28Rollup merge of #48473 - GuillaumeGomez:rustdoc-auto-trait-impl-fix, ↵kennytm-0/+26
r=QuietMisdreavus Fix auto trait impl rustdoc ice Fixes #48463. r? @QuietMisdreavus