about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-02-03Auto merge of #68772 - matthewjasper:relate-opt, r=davidtwcobors-0/+23
Avoid exponential behaviour when relating types When equating bound types we check subtyping in both directions. Since closures are invariant in their substs, we end up comparing the two types an exponential number of times. If there are no bound variables this isn't needed. Closes #68061
2020-02-03Auto merge of #68756 - JohnTitor:fix-ice-save-analysis-2, r=davidtwcobors-1/+3
Fix ICE with save-analysis Fixes #68749 It should be fine since it's the same way as `visit_expr`.
2020-02-03Auto merge of #68735 - JohnTitor:fix-ice-0202, r=estebankbors-0/+0
Use `next_point` to avoid ICE Fixes #68730 r? @estebank (I think you're familiar with that)
2020-02-02Rollup merge of #68764 - Centril:self-semantic, r=petrochenkovMazdak Farrokhzad-17/+387
parser: syntactically allow `self` in all `fn` contexts Part of https://github.com/rust-lang/rust/pull/68728. `self` parameters are now *syntactically* allowed as the first parameter irrespective of item context (and in function pointers). Instead, semantic validation (`ast_validation`) is used. r? @petrochenkov
2020-02-02Rollup merge of #68763 - JohnTitor:do-not-sugg-dup-bounds, r=estebankMazdak Farrokhzad-13/+26
Do not suggest duplicate bounds Fixes #68205 Fixes #68695 r? @estebank
2020-02-02Rollup merge of #68760 - Tyg13:compile_fail_ui_test, r=CentrilMazdak Farrokhzad-194/+165
Issue error on `compile-fail` header in UI test Fixes #68732 r? @Centril
2020-02-02parser: address review comments re. `self`.Mazdak Farrokhzad-87/+107
2020-02-02Avoid exponential behaviour when relating typesMatthew Jasper-0/+23
2020-02-02Do not suggest duplicate boundsYuki Okushi-13/+26
2020-02-02parser: move restrictions re. `self` to `ast_validation`.Mazdak Farrokhzad-6/+356
2020-02-02pretty: print attrs in struct exprMazdak Farrokhzad-0/+16
2020-02-02compiletest: error if `compile-fail` header in ui test.Tyler Lanphear-194/+165
2020-02-02Auto merge of #68672 - jonas-schievink:dedup-witness, r=Zoxcbors-3/+3
Deduplicate types in the generator witness For the `await-call-tree` benchmark this often reduces the types inside the witness from 12 to 2.
2020-02-02Fix ICE with save-analysisYuki Okushi-1/+3
2020-02-02Rollup merge of #68740 - JohnTitor:do-not-sugg-underscore, r=CentrilYuki Okushi-0/+30
Do not suggest things named underscore Fixes #68719 r? @estebank
2020-02-02Rollup merge of #68727 - ↵Yuki Okushi-6/+0
xfix:remove-comment-about-pretty-printer-in-format-tests, r=jonas-schievink Remove a comment about pretty printer in formatting tests rustc is now using rustfmt, not the old formatter.
2020-02-02Rollup merge of #68681 - bobrippling:fix-matched-angle-brackets, r=CentrilYuki Okushi-0/+46
Suggest path separator for single-colon typos This commit adds guidance for when a user means to type a path, but ends up typing a single colon, such as `<<Impl as T>:Ty>`. This change seemed pertinent as the current error message is particularly misleading, emitting `error: unmatched angle bracket`, despite the angle bracket being matched later on, leaving the user to track down the typo'd colon.
2020-02-02Do not suggest things named underscoreYuki Okushi-0/+30
2020-02-01Improve wording and docs for qualified path recoveryRob Pilling-3/+3
2020-02-01Deduplicate generator interior typesJonas Schievink-3/+3
2020-02-01Auto merge of #68133 - Centril:slimmer-syntax, r=petrochenkovbors-4/+8
Slimmer syntax High-level summary of changes: - The `syntax::node_count` pass is moved into `rustc_ast_passes`. This works towards improving #65031 by making compiling `syntax` go faster. - The `syntax::{GLOBALS, with_globals, ..}` business is consolidated into `syntax::attr` for cleaner code and future possible improvements. - The pretty printer loses its dependency on `ParseSess`, opting to use `SourceMap` & friends directly instead. - Some drive by cleanup of `syntax::attr::HasAttr` happens. - Builtin attribute logic (`syntax::attr::builtin`) + `syntax::attr::allow_internal_unstable` is moved into a new `rustc_attr` crate. More logic from `syntax::attr` should be moved into that crate over time. This also means that `syntax` loses all mentions of `ParseSess`, which enables the next point. - The pretty printer `syntax::print` is moved into a new crate `rustc_ast_pretty`. - `rustc_session::node_id` is moved back as `syntax::node_id`. As a result, `syntax` gets to drop dependencies on `rustc_session` (and implicitly `rustc_target`), `rustc_error_codes`, and `rustc_errors`. Moreover `rustc_hir` gets to drop its dependency on `rustc_session` as well. At this point, these crates are mostly "pure data crates", which is approaching a desirable end state. - We should consider renaming `syntax` to `rustc_ast` now.
2020-02-01fix fallout in testsMazdak Farrokhzad-4/+8
2020-02-02Use `next_point` to avoid ICEYuki Okushi-0/+0
2020-02-01Auto merge of #68180 - ajpaverd:cfguard-rust, r=nagisabors-0/+30
Add support for Control Flow Guard on Windows. LLVM now supports Windows Control Flow Guard (CFG): https://github.com/llvm/llvm-project/commit/d157a9bc8ba1085cc4808c6941412322a7fd884e This patch adds support for rustc to emit the required LLVM module flags to enable CFG metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.
2020-02-01Remove a comment about pretty printer in formatting testsKonrad Borowski-6/+0
rustc is now using rustfmt, not the old formatter.
2020-02-01Auto merge of #68698 - tmiasko:catch-panic, r=Amanieubors-0/+26
Remove incorrect debug assertions from catch_unwind Previously the debug assertions in the implementation of catch_unwind used to verify consistency of the panic count by checking that the count is zero just before leaving the function. This incorrectly assumed that no panic was in progress when entering `catch_unwind`. Fixes #68696.
2020-01-31Auto merge of #68633 - JohnTitor:avoid-ice-in-diagnostics, r=estebankbors-5/+4
Avoid ICE in macro's diagnostics Fixes #68629 r? @estebank
2020-01-31Auto merge of #68080 - varkor:declared-here, r=petrochenkovbors-427/+427
Address inconsistency in using "is" with "declared here" "is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout. r? @Centril
2020-01-31Auto merge of #68685 - Dylan-DPC:rollup-rkbo05z, r=Dylan-DPCbors-9/+83
Rollup of 6 pull requests Successful merges: - #68588 (check_unsafety: more code reuse) - #68638 (Add missing links for cmp traits) - #68660 (Fix typo.) - #68669 (suggest adding space in accidental doc comments) - #68670 (clarify "incorrect issue" error) - #68680 (Add `#![doc(html_playground_url = ...)]` to alloc crate) Failed merges: r? @ghost
2020-01-31Rollup merge of #68670 - euclio:invalid-issue, r=estebankDylan DPC-9/+13
clarify "incorrect issue" error Changes the message to be more precise, shrinks the span and adds a label specifying why the `issue` field is incorrect.
2020-01-31Auto merge of #67878 - Others:opt-3, r=Mark-Simulacrumbors-1/+1
Change opt-level from 2 back to 3 In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is hopefully no longer needed? I tried a little bit to replicate the original problem, and could not. I think running this through CI is the best way to smoke test this :) Even if things break dramatically, the comment should be updated to reflect that things are still broken with LLVM 9. I'm just getting started playing with the compiler, so apologies if I've missed an obvious problem here. fixes #52378 (possibly relevant is the [current update to LLVM 10](https://github.com/rust-lang/rust/pull/67759))
2020-01-31Remove incorrect debug assertions from catch_unwindTomasz Miąsko-0/+26
Previously the debug assertions in the implementation of catch_unwind used to verify consistency of the panic count by checking that the count is zero just before leaving the function. This incorrectly assumed that no panic was in progress when entering `catch_unwind`.
2020-01-30Suggest path separator for single-colon typosRob Pilling-0/+46
This commit adds guidance for when a user means to type a path, but ends up typing a single colon, such as `<<Impl as T>:Ty>`. This change seemed pertinent as the current error message is particularly misleading, emitting `error: unmatched angle bracket`, despite the angle bracket being matched later on, leaving the user to track down the typo'd colon.
2020-01-30Change opt-level from 2 back to 3Gregor Peach-1/+1
In Cargo.toml, the opt-level for `release` and `bench` was overridden to be 2. This was to work around a problem with LLVM 7. However, rust no longer uses LLVM 7, so this is no longer needed. This creates a small compile time regression in MIR constant eval, so I've added a #[inline(always)] on the `step` function used in const eval Also creates a binary size increase in wasm-stringify-ints-small, so I've bumped the limit there.
2020-01-30clarify "incorrect issue" errorAndy Russell-9/+13
2020-01-30suggest adding space in accidental doc commentsAndy Russell-0/+70
2020-01-30Auto merge of #68325 - faern:move-numeric-consts-to-associated-consts-step1, ↵bors-21/+14
r=LukasKalbertodt Move numeric consts to associated consts step1 A subset of #67913. Implements the first step of RFC https://github.com/rust-lang/rfcs/pull/2700 This PR adds the new constants as unstable constants and defines the old ones in terms of the new ones. Then fix a tiny bit of code that started having naming collisions because of the new assoc consts. Removed a test that did not seem relevant any longer. Since doing just `u8::MIN` should now indeed be valid.
2020-01-29Fix revision annotations in borrowck-feature-nll-overrides-migrateTomasz Miąsko-2/+2
2020-01-29Auto merge of #68635 - JohnTitor:rollup-jsc34ac, r=JohnTitorbors-11/+36
Rollup of 7 pull requests Successful merges: - #67722 (Minor: note how Any is an unsafe trait in SAFETY comments) - #68586 (Make conflicting_repr_hints a deny-by-default c-future-compat lint) - #68598 (Fix null synthetic_implementors error) - #68603 (Changelog: Demonstrate final build-override syntax) - #68609 (Set lld flavor for MSVC to link.exe) - #68611 (Correct ICE caused by macros generating invalid spans.) - #68627 (Document that write_all will not call write if given an empty buffer) Failed merges: r? @ghost
2020-01-29Rollup merge of #68586 - Centril:repr-deny, r=pnkfelixYuki Okushi-11/+36
Make conflicting_repr_hints a deny-by-default c-future-compat lint Closes https://github.com/rust-lang/rust/issues/68428. cc https://github.com/rust-lang/rust/issues/68585. r? @petrochenkov @pnkfelix
2020-01-29Avoid ICE in macro's diagnosticsYuki Okushi-5/+4
2020-01-29Auto merge of #68572 - tmiasko:sanitizer-use-after-scope, r=nikicbors-0/+18
Detect use-after-scope bugs with AddressSanitizer Enable use-after-scope checks by default when using AddressSanitizer. They allow to detect incorrect use of stack objects after their scope have already ended. The detection is based on LLVM lifetime intrinsics. To facilitate the use of this functionality, the lifetime intrinsics are now emitted regardless of optimization level if enabled sanitizer makes use of them.
2020-01-29Rollup merge of #68556 - ollie27:rustdoc_primitive_re-export, r=GuillaumeGomezYuki Okushi-0/+36
rustdoc: Fix re-exporting primitive types * Generate links to the primitive type docs for re-exports. * Don't ICE on cross crate primitive type re-exports. * Make primitive type re-exports show up cross crate. Fixes #67646 Closes #67972 r? @GuillaumeGomez
2020-01-29Rollup merge of #68289 - ↵Yuki Okushi-0/+13
pnkfelix:issue-62649-dont-ice-on-path-collision-in-dep-graph, r=michaelwoerister Don't ICE on path-collision in dep-graph Collisions in the dep-graph due to path-reuse are rare but can occur. So, instead of ICE'ing, just fail to mark green in such cases (for `DepKind::{Hir, HirBody, CrateMetadata}`). Fix #62649.
2020-01-28Add support for Control Flow Guard on Windows.Andrew Paverd-0/+30
This patch enables rustc to emit the required LLVM module flags to enable Control Flow Guard metadata (cfguard=1) or metadata and checks (cfguard=2). The LLVM module flags are ignored on unsupported targets and operating systems.
2020-01-28Auto merge of #68529 - TimDiekmann:rename-alloc, r=Amanieubors-5/+5
Rename `Alloc` to `AllocRef` The allocator-wg has decided to merge this change upstream in https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-577122958. This renames `Alloc` to `AllocRef` because types that implement `Alloc` are a reference, smart pointer, or ZSTs. It is not possible to have an allocator like `MyAlloc([u8; N])`, that owns the memory and also implements `Alloc`, since that would mean, that moving a `Vec<T, MyAlloc>` would need to correct the internal pointer, which is not possible as we don't have move constructors. For further explanation please see https://github.com/rust-lang/wg-allocators/issues/8#issuecomment-489464843 and the comments after that one. Additionally it clarifies the semantics of `Clone` on an allocator. In the case of `AllocRef`, it is clear that the cloned handle still points to the same allocator instance, and that you can free data allocated from one handle with another handle. The initial proposal was to rename `Alloc` to `AllocHandle`, but `Ref` expresses the semantics better than `Handle`. Also, the only appearance of `Handle` in `std` are for windows specific resources, which might be confusing. Blocked on https://github.com/rust-lang/miri/pull/1160
2020-01-28Rollup merge of #68575 - Wind-River:master_2020, r=alexcrichtonYuki Okushi-0/+1
Disable the testcase for Vxworks. r? @alexcrichton
2020-01-28Rollup merge of #68563 - Aaron1011:fix/fn-sig-closure, r=varkorYuki Okushi-0/+26
Don't call `tcx.fn_sig` on closures Fixes #68542
2020-01-28lintify conflicting_repr_hintsMazdak Farrokhzad-11/+36
2020-01-27Rename `Alloc` to `AllocRef`Tim Diekmann-5/+5