about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-03-11Auto merge of #58784 - oli-obk:accidental_promotion, r=eddybbors-0/+18
Don't promote function calls to nonpromotable things fixes https://github.com/rust-lang/rust/issues/58767 and fixes https://github.com/rust-lang/rust/issues/58634 r? @eddyb should we additionally check the function call return type? It might be a promotable function (or any `const fn` inside a `const fn`), but its return type might contain interior mutability.
2019-03-10Make migrate mode work at item level granularityMatthew Jasper-0/+100
2019-03-10Auto merge of #56732 - Zoxc:rustc-interface, r=oli-obkbors-122/+61
Make the rustc driver and interface demand driven This introduces a new crate `rustc_interface` which is the canonical interface for creating and using the compiler. It allows you to access a `Compiler` type in a closure and that types have methods to run passes on demand. The interesting parts are found [here (defining the queries)](https://github.com/Zoxc/rust/blob/rustc-interface/src/librustc_interface/queries.rs#L78) and [here (methods to create a `Compiler`)](https://github.com/Zoxc/rust/blob/rustc-interface/src/librustc_interface/interface.rs). cc @rust-lang/compiler @rust-lang/dev-tools @rust-lang/rustdoc
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-122/+61
2019-03-10Auto merge of #58498 - euclio:e0432-suggestions, r=estebankbors-48/+96
use structured suggestions for E0432
2019-03-10Fix ICE in MIR pretty printingDan Robertson-0/+18
A `Def::Variant` should be considered as a function in mir pretty printing. Each variant has a constructor that we must print. Given the following enum definition: ``` pub enum TestMe { X(usize), } ``` We will need to generate a constructor for the variant `X` with a signature that looks something like the following: ``` fn TestMe::X(_1: usize) -> TestMe; ```
2019-03-09review commentsEsteban Küber-4/+4
2019-03-09Rollup merge of #58762 - petrochenkov:unwind, r=Mark-SimulacrumMazdak Farrokhzad-0/+51
Mention `unwind(aborts)` in diagnostics for `#[unwind]` Simplify input validation for `#[unwind]`, add tests cc https://github.com/rust-lang/rust/issues/58760 r? @Mark-Simulacrum
2019-03-09Rollup merge of #58750 - TimDiekmann:master, r=oli-obkMazdak Farrokhzad-0/+131
Make `Unique::as_ptr`, `NonNull::dangling` and `NonNull::cast` const
2019-03-09Rollup merge of #58679 - Zoxc:passes-refactor, r=michaelwoeristerMazdak Farrokhzad-22/+127
Refactor passes and pass execution to be more parallel For `syntex_syntax` (with 16 threads and 8 cores): - Cuts `misc checking 1` from `0.096s` to `0.08325s`. - Cuts `misc checking 2` from `0.3575s` to `0.2545s`. - Cuts `misc checking 3` from `0.34625s` to `0.21375s`. - Cuts `wf checking` from `0.3085s` to `0.05025s`. Reduces overall execution time for `syntex_syntax` (with 8 threads and cores) from `4.92s` to `4.34s`. Subsumes https://github.com/rust-lang/rust/pull/58494 Blocked on https://github.com/rust-lang/rust/pull/58250 r? @michaelwoerister
2019-03-09Rollup merge of #58629 - euclio:debug-empty-str, r=alexcrichtonMazdak Farrokhzad-0/+35
rust-lldb: fix crash when printing empty string Fixes #52185. ~Re-enables the pretty-std debuginfo test and tweaks the test as necessary to get it to pass again. This reveals that lldb's formatting of enums is broken (#58492). I also removed the emoji from the test because I couldn't get the docker image's gdb to print the emoji, just octal escapes (https://github.com/rust-lang/rust/pull/53154/files#r208263904).~
2019-03-09Rollup merge of #58626 - QuietMisdreavus:doc-coverage, r=GuillaumeGomezMazdak Farrokhzad-0/+222
rustdoc: add option to calculate "documentation coverage" This PR adds a new flag to rustdoc, `--show-coverage`. When passed, this flag will make rustdoc count the number of items in a crate with documentation instead of generating docs. This count will be output as a table of each file in the crate, like this (when run on my crate `egg-mode`): ``` +-------------------------------------+------------+------------+------------+ | File | Documented | Total | Percentage | +-------------------------------------+------------+------------+------------+ | src/auth.rs | 16 | 16 | 100.0% | | src/common/mod.rs | 1 | 1 | 100.0% | | src/common/response.rs | 9 | 9 | 100.0% | | src/cursor.rs | 24 | 24 | 100.0% | | src/direct/fun.rs | 6 | 6 | 100.0% | | src/direct/mod.rs | 41 | 41 | 100.0% | | src/entities.rs | 50 | 50 | 100.0% | | src/error.rs | 27 | 27 | 100.0% | | src/lib.rs | 1 | 1 | 100.0% | | src/list/fun.rs | 19 | 19 | 100.0% | | src/list/mod.rs | 22 | 22 | 100.0% | | src/media/mod.rs | 27 | 27 | 100.0% | | src/place/fun.rs | 8 | 8 | 100.0% | | src/place/mod.rs | 35 | 35 | 100.0% | | src/search.rs | 26 | 26 | 100.0% | | src/service.rs | 74 | 74 | 100.0% | | src/stream/mod.rs | 49 | 49 | 100.0% | | src/tweet/fun.rs | 15 | 15 | 100.0% | | src/tweet/mod.rs | 73 | 73 | 100.0% | | src/user/fun.rs | 24 | 24 | 100.0% | | src/user/mod.rs | 87 | 87 | 100.0% | +-------------------------------------+------------+------------+------------+ | Total | 634 | 634 | 100.0% | +-------------------------------------+------------+------------+------------+ ``` Trait implementations are not counted because by default they "inherit" the docs from the trait, even though an impl can override those docs. Similarly, inherent impl blocks are not counted at all, because for the majority of cases such docs are not useful. (The usual pattern for inherent impl blocks is to throw all the methods on a type into a single impl block. Any docs you would put on that block would be better served on the type itself.) In addition, `--show-coverage` can be combined with `--document-private-items` to get the coverage counts for everything in the crate, not just public items. The coverage calculation is implemented as a late pass and two new sets of passes which strip out most of the work that rustdoc otherwise does when generating docs. The is because after the new pass is executed, rustdoc immediately closes instead of going on to generate documentation. Many examples of coverage calculations have been included as `rustdoc-ui` tests. r? @rust-lang/rustdoc
2019-03-09use structured suggestions for E0432Andy Russell-48/+96
2019-03-09Auto merge of #57882 - euclio:unused-doc-attributes, r=estebankbors-22/+113
overhaul unused doc comments lint This PR contains a number of improvements to the `unused_doc_comments` lint. - Extends the span to cover the entire comment when using sugared doc comments. - Triggers the lint for all unused doc comments on a node, instead of just the first one. - Triggers the lint on macro expansions, and provides a help note explaining that doc comments must be expanded by the macro. - Adds a label pointing at the node that cannot be documented. Furthermore, this PR fixes any instances in rustc where a macro expansion was erroneously documented.
2019-03-09Auto merge of #59012 - pietroalbini:rollup, r=pietroalbinibors-8/+309
Rollup of 24 pull requests Successful merges: - #58080 (Add FreeBSD armv6 and armv7 targets) - #58204 (On return type `impl Trait` for block with no expr point at last semi) - #58269 (Add librustc and libsyntax to rust-src distribution.) - #58369 (Make the Entry API of HashMap<K, V> Sync and Send) - #58861 (Expand where negative supertrait specific error is shown) - #58877 (Suggest removal of `&` when borrowing macro and appropriate) - #58883 (Suggest appropriate code for unused field when destructuring pattern) - #58891 (Remove stray ` in the docs for the FromIterator implementation for Option) - #58893 (race condition in thread local storage example) - #58906 (Monomorphize generator field types for debuginfo) - #58911 (Regression test for #58435.) - #58912 (Regression test for #58813) - #58916 (Fix release note problems noticed after merging.) - #58918 (Regression test added for an async ICE.) - #58921 (Add an explicit test for issue #50582) - #58926 (Make the lifetime parameters of tcx consistent.) - #58931 (Elide invalid method receiver error when it contains TyErr) - #58940 (Remove JSBackend from config.toml) - #58950 (Add self to mailmap) - #58961 (On incorrect cfg literal/identifier, point at the right span) - #58963 (libstd: implement Error::source for io::Error) - #58970 (delay_span_bug in wfcheck's ty.lift_to_tcx unwrap) - #58984 (Teach `-Z treat-err-as-bug` to take a number of errors to emit) - #59007 (Add a test for invalid const arguments) Failed merges: - #58959 (Add release notes for PR #56243) r? @ghost
2019-03-08When encountetring `||{}()`, suggest the likely intended `(||{})()`Esteban Küber-0/+19
2019-03-08Parse lifetimes that start with a number and give specific errorEsteban Küber-0/+32
2019-03-08Auto merge of #58985 - dlrobertson:fix_58980, r=alexregbors-0/+19
Fix segfaults in release build C-variadic fns `va_start` and `va_end` must be called to initialize/cleanup the "spoofed" `VaList` in a Rust defined C-variadic function even if the `VaList` is not used. r? @alexreg Fixes: #58980
2019-03-08expand unused doc comment diagnosticAndy Russell-29/+100
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
2019-03-08improve unused doc comment diagnostic reportingAndy Russell-6/+26
Report all unused attributes on a given doc comment instead of just the first one, and extend the span of sugared doc comments to encompass the whole comment.
2019-03-08Unit (and regression) tests for warning cycle code.Felix S. Klock II-59/+140
2019-03-08Auto merge of #58915 - ljedrz:deprecate_nodeid_methods, r=Zoxcbors-3/+3
HirIdification: almost there The next iteration of HirIdification (#57578). Replaces a bunch of `NodeId` method calls (mostly `as_local_node_id`) with `HirId` ones. Removes `NodeId` from: - [x] `PathSegment` - [x] `PatKind` - [x] `Destination` (replaces it with `HirId`) In addition this PR also removes `Visitor::visit_def_mention`, which doesn't seem to be doing anything.
2019-03-08Rollup merge of #59007 - varkor:invalid-const-arg-test, r=petrochenkovPietro Albini-0/+12
Add a test for invalid const arguments Closes https://github.com/rust-lang/rust/issues/58811.
2019-03-08Rollup merge of #58984 - estebank:multi-treat-err-as-bug, r=oli-obkPietro Albini-1/+1
Teach `-Z treat-err-as-bug` to take a number of errors to emit `-Z treat-err-as-bug` will cause `rustc` to panic after the first error is reported, like previously. `-Z treat-err-as-bug=2` will cause `rustc` to panic after 2 errors have been reported. Fix #58983.
2019-03-08Rollup merge of #58970 - pnkfelix:issue-58158-size-of-assoc-type-ice, ↵Pietro Albini-0/+40
r=petrochenkov delay_span_bug in wfcheck's ty.lift_to_tcx unwrap Fix #58158
2019-03-08Rollup merge of #58961 - estebank:issue-58462, r=varkorPietro Albini-4/+4
On incorrect cfg literal/identifier, point at the right span CC #58462
2019-03-08Rollup merge of #58931 - estebank:elide-receiver-tyerr, r=varkorPietro Albini-0/+30
Elide invalid method receiver error when it contains TyErr Fix #58712.
2019-03-08Rollup merge of #58921 - cuviper:issue-50582, r=varkorPietro Albini-0/+15
Add an explicit test for issue #50582 This code no longer ICEs, and @yodaldevoid found that it was fixed by commit fe5710a. While that added a similar test, we can explicitly test this reproducer too. Closes #50582.
2019-03-08Rollup merge of #58918 - gilescope:async-await-issue-testcase, r=petrochenkovPietro Albini-0/+28
Regression test added for an async ICE. Regression test for #57084 (as suggested in issue).
2019-03-08Rollup merge of #58912 - pnkfelix:issue-58813-incr-comp-regress-test, ↵Pietro Albini-0/+14
r=petrochenkov Regression test for #58813 Fix #58813
2019-03-08Rollup merge of #58911 - pnkfelix:issue-58435-regression-test, r=alexcrichtonPietro Albini-0/+17
Regression test for #58435. Fix #58435
2019-03-08Rollup merge of #58906 - Nemo157:generator-state-debug-info, r=ZoxcPietro Albini-0/+27
Monomorphize generator field types for debuginfo Fixes #58888 r? @Zoxc
2019-03-08Rollup merge of #58883 - estebank:unused-closure-arg, r=varkorPietro Albini-0/+40
Suggest appropriate code for unused field when destructuring pattern Fix #56472.
2019-03-08Rollup merge of #58877 - estebank:macro-borrow, r=davidtwcoPietro Albini-3/+45
Suggest removal of `&` when borrowing macro and appropriate Fix #58815.
2019-03-08Rollup merge of #58861 - estebank:fix-negative-traits, r=petrochenkovPietro Albini-0/+15
Expand where negative supertrait specific error is shown Fix #58857. r? @petrochenkov
2019-03-08Rollup merge of #58369 - nox:sync-hash-map-entry, r=AmanieuPietro Albini-0/+1
Make the Entry API of HashMap<K, V> Sync and Send Fixes #45219
2019-03-08Rollup merge of #58204 - estebank:impl-trait-semi, r=zackmdavisPietro Albini-0/+20
On return type `impl Trait` for block with no expr point at last semi Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo. ``` error[E0277]: the trait bound `(): Bar` is not satisfied --> $DIR/impl-trait-return-trailing-semicolon.rs:3:13 | LL | fn foo() -> impl Bar { | ^^^^^^^^ the trait `Bar` is not implemented for `()` LL | 5; | - consider removing this semicolon | = note: the return type of a function must have a statically known size ``` Partially addresses #54771.
2019-03-08Auto merge of #58903 - estebank:forgetful-delims, r=petrochenkovbors-33/+130
Always emit unclosed delimiter diagnostics Fix #58886.
2019-03-08Auto merge of #58013 - Zoxc:stable-hash-macro-simple, r=oli-obkbors-0/+63
Create a derive macro for HashStable and allow proc macros in rustc A combination of https://github.com/rust-lang/rust/pull/56864 and https://github.com/rust-lang/rust/pull/56795. There were complications with using `serde_derive` as rustc doesn't know which crate to use for the host when there is a serde_derive in the sysroot and cargo passes another on the command line built from crates.io. r? @eddyb (for proc macro changes) @alexcrichton (for rustbuild changes) @michaelwoerister (for the macro itself)
2019-03-07Add a test for invalid const argumentsvarkor-0/+12
2019-03-07update treat-err-as-bug testEsteban Küber-1/+1
2019-03-07Add more details to elseless if errorEsteban Küber-3/+56
2019-03-07address review commentsEsteban Küber-8/+12
2019-03-08Improve recovery for missing trait in a trait implVadim Petrochenkov-5/+4
2019-03-07Point at coercion reason for if exprs without else clauseEsteban Küber-0/+30
``` error[E0317]: if may be missing an else clause --> $DIR/if-without-else-as-fn-expr.rs:2:5 | LL | fn foo(bar: usize) -> usize { | ----- found `usize` because of this return type LL | / if bar % 5 == 0 { LL | | return 3; LL | | } | |_____^ expected (), found usize | = note: expected type `()` found type `usize` = note: `if` expressions without `else` must evaluate to `()` ```
2019-03-07Adds diagnostic message and UI test.Wesley Norris-0/+15
2019-03-07Fix segfaults in release build C-variadic fnsDan Robertson-0/+19
`va_start` and `va_end` must be called to initialize/cleanup the "spoofed" `VaList` in a Rust defined C-variadic function even if the `VaList` is not used.
2019-03-07HirIdification: replace NodeId method callsljedrz-3/+3
2019-03-06Add regression test for #58886Esteban Küber-0/+53
2019-03-06Collect unclosed delimiters in parent parserEsteban Küber-31/+32