about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-07-09Implement #[alloc_error_handler]Simon Sapin-4/+147
This to-be-stable attribute is equivalent to `#[lang = "oom"]`. It is required when using the alloc crate without the std crate. It is called by `handle_alloc_error`, which is in turned called by "infallible" allocations APIs such as `Vec::push`.
2018-07-09Add a test for the default allocation error hookSimon Sapin-0/+28
2018-07-09Auto merge of #52160 - euclio:include-macros, r=oli-obkbors-0/+35
add regression test for #48835 Fixes #48835. The underlying issue was fixed in #51978.
2018-07-08add regression test for #48835Andy Russell-0/+35
Fixes #48835. The underlying issue was fixed in #51978.
2018-07-08Auto merge of #52106 - PramodBisht:issue/52049, r=oli-obkbors-0/+44
Don't suggest `let` bindings if they don't help with borrows @oli-obk I have added a condition to address #52049, right now, this is on WIP because I think code change is also required on `error_reporting.rs`. Plus I need to check if any test cases fail. I will ping you again if everything passes r? @oli-obk
2018-07-08Auto merge of #51955 - zackmdavis:item_semi, r=oli-obkbors-0/+2
clarify why we're suggesting removing semicolon after braced items Previously (issue #46186, pull-request #46258), a suggestion was added to remove the semicolon after we fail to parse an item, but issue #51603 complains that it's still insufficiently obvious why. Let's add a note. Resolves #51603.
2018-07-08Auto merge of #51590 - bjorn3:codegen_llvm_extract, r=alexcrichtonbors-5/+4
Mostly fix metadata_only backend and extract some code out of rustc_codegen_llvm Removes dependency on the `ar` crate and removes the `llvm.enabled` config option in favour of setting `rust.codegen-backends` to `[]`.
2018-07-07Auto merge of #52109 - michaelwoerister:ir-objs, r=alexcrichtonbors-23/+19
When doing linker-plugin based LTO, write LLVM bitcode obj-files instead of embedding the bitcode into the regular object file. This PR makes the compiler emit LLVM bitcode object files instead of regular object files with the IR embed when compiling for linker-plugin-based LTO. The reasoning for switching the strategy is this: - Embedding bitcode in a section of the object file actually makes us save bitcode twice in rlibs and Rust dylibs, once for linker-based LTO and once for rustc-based LTO. That's a waste of space. - When compiling for plugin-based LTO, one usually has no use for the machine code also present in the object file. Generating it is a waste of time. - When compiling for plugin-based LTO, `rustc` will skip running ThinLTO because the linker will do that anyway. This has the side effect of then generating poorly optimized machine code, which makes it even less useful (and may lead to users not knowing why their code is slow instead of getting an error). - Not having machine code available makes it impossible for the linker to silently fall back to not inlining stuff across language boundaries. - This is what Clang does and according to [the documentation](https://llvm.org/docs/BitCodeFormat.html#native-object-file-wrapper-format) is the better supported option. - The current behavior (minus the runtime performance problems) is still available via `-Z embed-bitcode` (we might want to do this for `libstd` at some point). r? @alexcrichton
2018-07-07Added UI testcases for #52049Pramod Bisht-0/+44
2018-07-07Fix testbjorn3-5/+4
2018-07-06Rollup merge of #52083 - spastorino:dont-run-ast-borrowck-on-mir-mode, ↵Mark Rousskov-16/+16
r=nikomatsakis Dont run ast borrowck on mir mode r? @nikomatsakis
2018-07-06Rollup merge of #52067 - csmoe:issue-51167, r=nikomatsakisMark Rousskov-44/+43
Visit the mir basic blocks in reverse-postfix order cc #51167 r? @nikomatsakis
2018-07-06Rollup merge of #52058 - davidtwco:issue-51345, r=nikomatsakisMark Rousskov-0/+35
Use of unimplemented!() causing ICE with NLL Fixes #51345. r? @nikomatsakis
2018-07-06Rollup merge of #51901 - rust-lang:weak-unboxing, r=alexcrichtonMark Rousskov-0/+15
Rc: remove unused allocation and fix segfault in Weak::new() Same as https://github.com/rust-lang/rust/pull/50357 did for `Arc`. Fixes https://github.com/rust-lang/rust/issues/48493
2018-07-07Add a test for Weak::new() not crashing for uninhabited typesSimon Sapin-0/+15
2018-07-06Auto merge of #52021 - nikomatsakis:nll-region-errors, r=estebankbors-121/+193
refactor and cleanup region errors for NLL This is a WIP commit. It simplifies some of the code from https://github.com/rust-lang/rust/pull/51536 and extends a few more steps towards the errors that @davidtwco and I were shooting for. These are intended as a replacement for the general "unable to infer lifetime" messages -- one that is actually actionable. We're certainly not there yet, but the overall shape hopefully gets a bit clearer. I'm thinking about trying to open up an internals thread to sketch out the overall plan and perhaps discuss how to get the wording right, which special cases to handle, etc. r? @estebank cc @davidtwco
2018-07-06Auto merge of #52018 - flip1995:rfc2103, r=oli-obkbors-0/+127
Implementation of tool lints. Tracking issue: #44690
2018-07-06Auto merge of #52010 - toidiu:ak-crossCrateOutlives, r=nikomatsakisbors-0/+32
Fix: infer outlives requirements across crates Fixes https://github.com/rust-lang/rust/issues/51858
2018-07-06Auto merge of #51894 - mikhail-m1:8636, r=nikomatsakisbors-0/+289
fix for issue #8636 r? @nikomatsakis Fix #8636 also fixes #42291
2018-07-06When doing linker-plugin based LTO, write LLVM bitcode obj-filesMichael Woerister-23/+19
instead of embedding the bitcode into the regular object file.
2018-07-06Auto merge of #51953 - japaric:atomic-load-store, r=alexcrichtonbors-5/+5
enable Atomic*.{load,store} for ARMv6-M / MSP430 closes #45085 as proposed in https://github.com/rust-lang/rust/issues/45085#issuecomment-384825434 this commit adds an `atomic_cas` target option and extends the `#[cfg(target_has_atomic)]` attribute to enable a subset of the `Atomic*` API on architectures that don't support atomic CAS natively, like MSP430 and ARMv6-M. r? @alexcrichton
2018-07-06Auto merge of #52088 - kennytm:rollup, r=kennytmbors-16/+16
Rollup of 14 pull requests Successful merges: - #51619 (rust: add initial changes to support powerpc64le musl) - #51793 (Fix variant background color on hover in search results) - #52005 (Update LLVM to bring in a wasm codegen fix) - #52016 (Deduplicate error reports for statics) - #52019 ([cross-lang-lto] Allow the linker to choose the LTO-plugin (which is useful when using LLD)) - #52030 (Any docs preposition change) - #52031 (Strenghten synchronization in `Arc::is_unique`) - #52033 ([Gardening] Update outdated comments: ByVal -> Scalar) - #52055 (Include VS 2017 in error message.) - #52063 (Add a link to the rustc docs) - #52073 (Add a punch card to weird expressions test) - #52080 (Improve dependency deduplication diagnostics) - #52093 (rustc: Update tracking issue for wasm_import_module) - #52096 (Fix typo in cell.rs) Failed merges:
2018-07-06Rollup merge of #52093 - alexcrichton:update-issue, r=kennytmkennytm-1/+1
rustc: Update tracking issue for wasm_import_module It's now https://github.com/rust-lang/rust/issues/52090
2018-07-06Rollup merge of #52073 - xfix:patch-7, r=oli-obkkennytm-0/+13
Add a punch card to weird expressions test
2018-07-05rustc: Update tracking issue for wasm_import_moduleAlex Crichton-1/+1
It's now https://github.com/rust-lang/rust/issues/52090
2018-07-05update run-pass testJorge Aparicio-5/+5
2018-07-06Rollup merge of #52016 - oli-obk:dedup_static_errors, r=estebankkennytm-15/+2
Deduplicate error reports for statics fixes #51970
2018-07-06Auto merge of #51861 - GuillaumeGomez:prevent-some-markdown-short-doc, ↵bors-0/+35
r=QuietMisdreavus Prevent some markdown transformation on short docblocks Before: <img width="1440" alt="screen shot 2018-06-28 at 01 46 01" src="https://user-images.githubusercontent.com/3050060/42005762-7d533bbe-7a76-11e8-8361-027886803399.png"> After: <img width="1440" alt="screen shot 2018-06-28 at 01 46 02" src="https://user-images.githubusercontent.com/3050060/42005768-81bd59a0-7a76-11e8-819b-9b4be72579d6.png"> This is only performed on short doc blocks, not on plain ones. Not all transformations are prevented (you still have a few like urls, code blocks, etc...). cc @nical r? @QuietMisdreavus
2018-07-05Do not run AST borrowck when -Zborrowck=mirSantiago Pastorino-12/+12
2018-07-05fix for issue #8636Mikhail Modin-0/+289
2018-07-05Add a punch card to weird expressions testKonrad Borowski-0/+13
2018-07-05Auto merge of #51967 - varkor:const-body-break-continue, r=estebankbors-17/+112
Fix various issues with control-flow statements inside anonymous constants Fixes #51761. Fixes #51963 (and the host of other reported issues there). (Might be easiest to review per commit, as they should be standalone.) r? @estebank
2018-07-05update testcsmoe-44/+43
2018-07-05Auto merge of #51938 - zackmdavis:and_the_case_of_the_leaking_desugar, ↵bors-0/+65
r=estebank in which we plug the crack where `?`-desugaring leaked into errors Most of the time, it's not a problem that the types of the arm bodies in a desugared-from-`?` match are different (that is, specifically: in `x?` where x is a `Result<A, B>`, the `Ok` arm body is an `A`, whereas the `Err` arm diverges to return a `Result<A, B>`), because they're being assigned to different places. But in tail position, the types do need to match, and our error message was explicitly referring to "match arms", which is confusing when there's no `match` in the sweetly sugared source. It is not without some misgivings that we pollute the clarity-of-purpose of `note_error_origin` with the suggestion to wrap with `Ok` (the other branches are pointing out the odd-arm-out in the HIR that is the origin of the error; the new branch that issues the `Ok` suggestion is serving a different purpose), but it's the natural place to do it given that we're already matching on `ObligationCauseCode::MatchExpressionArm { arm_span, source }` there. Resolves #51632.
2018-07-04Remove rustc_mir_borrowck attribute and use rustc_mir insteadSantiago Pastorino-4/+4
2018-07-05Auto merge of #51964 - matthewjasper:unused-mut-mir-generation, r=nikomatsakisbors-19/+146
[NLL] Fix various unused mut errors Closes #51801 Closes #50897 Closes #51830 Closes #51904 cc #51918 - keeping this one open in case there are any more issues This PR contains multiple changes. List of changes with examples of what they fix: * Change mir generation so that the parameter variable doesn't get a name when a `ref` pattern is used as an argument ```rust fn f(ref y: i32) {} // doesn't trigger lint ``` * Change mir generation so that by-move closure captures don't get first moved into a temporary. ```rust let mut x = 0; // doesn't trigger lint move || { x = 1; }; ``` * Treat generator upvars the same as closure upvars ```rust let mut x = 0; // This mut is now necessary and is not linted against. move || { x = 1; yield; }; ``` r? @nikomatsakis
2018-07-04Ensure that borrows wind up unactivated.David Wood-0/+18
2018-07-04Correctly handle an activation from dead code.David Wood-0/+17
2018-07-04Auto merge of #51611 - QuietMisdreavus:slippery-macros, r=ollie27bors-2/+85
rustdoc: import cross-crate macros alongside everything else The thrilling conclusion of the cross-crate macro saga in rustdoc! After https://github.com/rust-lang/rust/pull/51425 made sure we saw all the namespaces of an import (and prevented us from losing the `vec!` macro in std's documentation), here is the PR to handle cross-crate macro re-exports at the same time as everything else. This way, attributes like `#[doc(hidden)]` and `#[doc(no_inline)]` can be used to control how the documentation for these macros is seen, rather than rustdoc inlining every macro every time. Fixes https://github.com/rust-lang/rust/issues/50647
2018-07-04Improving span of unknown lint tool error messageflip1995-2/+26
2018-07-04Tests for tool_lintsflip1995-0/+103
2018-07-04Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, ↵bors-6/+22
r=scalexm Move self trait predicate to items This is a "reimagination" of @tmandry's PR #50183. The main effect is described in this comment from one of the commits: --- Before we had the following results for `predicates_of`: ```rust trait Foo { // predicates_of: Self: Foo fn bar(); // predicates_of: Self: Foo (inherited from trait) } ``` Now we have removed the `Self: Foo` from the trait. However, we still add it to the trait ITEM. This is because when people do things like `<T as Foo>::bar()`, they still need to prove that `T: Foo`, and having it in the `predicates_of` seems to be the cleanest way to ensure that happens right now (otherwise, we'd need special case code in various places): ```rust trait Foo { // predicates_of: [] fn bar(); // predicates_of: Self: Foo } ``` However, we sometimes want to get the list of *just* the predicates truly defined on a trait item (e.g., for chalk, but also for a few other bits of code). For that, we define `predicates_defined_on`, which does not contain the `Self: Foo` predicate yet, and we plumb that through metadata and so forth. --- I'm assigning @eddyb as the main reviewer, but I thought I might delegate to scalexm for this one in any case. I also want to post an alternative that I'll leave in the comments; it occurred to me as I was writing. =) r? @eddyb cc @scalexm @tmandry @leodasvacas
2018-07-04write code to extract region names and emit new style messageNiko Matsakis-121/+193
2018-07-03Auto merge of #51926 - matthewjasper:Initialization-span, r=nikomatsakisbors-11/+10
[NLL] Use better span for initializing a variable twice Closes #51217 When assigning to a (projection from a) local immutable local which starts initialised (everything except `let PATTERN;`): * Point to the declaration of that local * Make the error message refer to the local, rather than the projection. r? @nikomatsakis
2018-07-03Fix various nll unused mut errorsMatthew Jasper-19/+146
2018-07-03Auto merge of #51450 - estebank:inner-fn-test, r=@pnkfelixbors-0/+45
Add lint warning for inner function marked as `#[test]` Fix #36629.
2018-07-03test for renaming re-exported macrosQuietMisdreavus-0/+6
2018-07-03implement fix for cross crate inferrence and fix testtoidiu-15/+10
2018-07-03Auto merge of #52014 - pietroalbini:rollup, r=pietroalbinibors-0/+74
Rollup of 13 pull requests Successful merges: - #51548 (Initialize LLVM's AMDGPU target machine, if available.) - #51809 (Add read_exact_at and write_all_at methods to FileExt on unix) - #51914 (add outlives annotations to `BTreeMap`) - #51958 (Show known meta items in unknown meta items error) - #51973 (Make Stdio handle UnwindSafe) - #51977 (bootstrap: tests should use rustc from config.toml) - #51978 (Do not suggest changes to str literal if it isn't one) - #51979 (Get rid of `TyImplTraitExistential`) - #51980 (Emit column info in debuginfo for non msvc like targets) - #51982 (incr.comp.: Take names of children into account when computing the ICH of a module's HIR.) - #51997 (add entry for cargo-metadata feature to RELEASES) - #52004 (toolstate: Fixed detection of changed submodule, and other fixes.) - #52006 ( Change --keep-stage to apply more often) Failed merges: r? @ghost
2018-07-03Deduplicate error reports for staticsOliver Schneider-15/+2