about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-03-07Rollup merge of #67741 - estebank:point-at-pat-def, r=CentrilMazdak Farrokhzad-4/+68
When encountering an Item in a pat context, point at the item def ``` error[E0308]: mismatched types --> $DIR/const-in-struct-pat.rs:8:17 | LL | struct foo; | ----------- `foo` defined here ... LL | let Thing { foo } = t; | ^^^ expected struct `std::string::String`, found struct `foo` | = note: `foo` is interpreted as a unit struct, not a new binding help: you can bind the struct field to a different name | LL | let Thing { foo: other_foo } = t; | ^^^^^^^^^^^^^^ ``` ``` error[E0308]: mismatched types --> $DIR/const.rs:14:9 | LL | const FOO: Foo = Foo{bar: 5}; | ----------------------------- constant defined here ... LL | FOO => {}, | ^^^ | | | expected `&Foo`, found struct `Foo` | `FOO` is interpreted as a constant, not a new binding | help: use different name to introduce a new binding: `other_foo` ``` Fix #55631, fix #48062, cc #42876.
2020-03-06When encountering an Item in a pat context, point at the item defEsteban Küber-4/+68
2020-03-06Auto merge of #69753 - pnkfelix:issue-69191-ice-on-uninhabited-enum-field, r=olibors-0/+91
Do not ICE when matching an uninhabited enum's field Fix #69191
2020-03-06Added oli's multivariant test case (alpha renaming the enum name itself).Felix S. Klock II-3/+63
(And added Ralf's suggested test.) Added my own three-variant multi-variant as well.
2020-03-06Auto merge of #69614 - estebank:ice-age, r=davidtwcobors-0/+41
`delay_span_bug` when codegen cannot select obligation Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-03-05Fix #69191Felix S. Klock II-0/+31
2020-03-05Bumped version number for const_eval_limit in active.rsChristoph Schmidler-14/+38
and renamed 'recursion_limit' in limits.rs to simple 'limit' because it does handle other limits too.
2020-03-05Opt out of CTFE if the 'const_eval_limit' is set to 0Christoph Schmidler-1/+9
2020-03-05Add a new test to reach const_limit setting, although with wrong WARNINGs yetChristoph Schmidler-20/+35
rename feature to const_eval_limit
2020-03-05Disable CTFE if const_limit was set to 0, otherwise use the value set, which ↵Christoph Schmidler-1/+33
defaults to 1_000_000
2020-03-05Prepare const_limit feature gate and attributeChristoph Schmidler-0/+24
2020-03-03Auto merge of #69678 - Dylan-DPC:rollup-yoaueud, r=Dylan-DPCbors-2/+29
Rollup of 6 pull requests Successful merges: - #69565 (miri engine: turn some debug_assert into assert) - #69621 (use question mark operator in a few places.) - #69650 (cleanup more iterator usages (and other things)) - #69653 (use conditions directly) - #69665 (Invoke OptimizerLastEPCallbacks in PreLinkThinLTO) - #69670 (Add explanation for E0379) Failed merges: r? @ghost
2020-03-03Rollup merge of #69665 - tmiasko:new-pass-manager-thin-lto-opt, r=nikicDylan DPC-2/+29
Invoke OptimizerLastEPCallbacks in PreLinkThinLTO The default ThinLTO pre-link pipeline does not include optimizer last extension points. Thus, when using the new LLVM pass manager & ThinLTO & sanitizers on any opt-level different from zero, the sanitizer function passes would be omitted from the pipeline. Add optimizer last extensions points manually to the pipeline, but guard registration with stage check in the case this behaviour changes in the future.
2020-03-03Auto merge of #69506 - Centril:stmt-semi-none, r=petrochenkovbors-22/+14
encode `;` stmt without expr as `StmtKind::Empty` Instead of encoding `;` statements without a an expression as a tuple in AST, encode it as `ast::StmtKind::Empty`. r? @petrochenkov
2020-03-03Auto merge of #69371 - tmiasko:weak-lang-cycle, r=alexcrichtonbors-0/+76
Improve linking of crates with circular dependencies Previously, the code responsible for handling the cycles between crates introduces through weak lang items, would keep a set of missing language items: * extending it with items missing from the current crate, * removing items provided by the current crate, * grouping the crates when the set changed from non-empty back to empty. This could produce incorrect results, if a lang item was missing from a crate that comes after the crate that provides it (in the loop iteration order). In that case the grouping would not take place. The changes here address this specific failure scenario by keeping track of two separate sets of crates. Those that are required to link successfully, and those that are available for linking. Verified using test case from #69368.
2020-03-03Add regression test for linking issue with start-group / end-groupTomasz Miąsko-0/+76
2020-03-03Rollup merge of #69620 - thekuom:doc/61137-add-long-error-code-e0719, ↵Yuki Okushi-0/+2
r=davidtwco doc(librustc_error_codes): add long error explanation for E0719 Reference issue #61137 - Updated error_codes.rs - Added E0719.md in error_codes - Updated necessary test .stderr files
2020-03-03Rollup merge of #69609 - TimDiekmann:excess, r=AmanieuYuki Okushi-17/+17
Remove `usable_size` APIs This removes the usable size APIs: - remove `usable_size` (obv) - change return type of allocating methods to include the allocated size - remove `_excess` API r? @Amanieu closes rust-lang/wg-allocators#17
2020-03-03Fix check for __msan_keep_going in sanitizer-recover testTomasz Miąsko-2/+2
Match `@__msan_keep_going = weak_odr constant i32 1`.
2020-03-03Add test for -Znew-llvm-pass-manager -Clto=thin -Zsanitizer=...Tomasz Miąsko-0/+27
Additionally verify that the current implementation of LLVM version check (which uses lexicographic ordering) is good enough to exclude versions before LLVM 9, where the new LLVM pass manager is unsupported.
2020-03-02Remove chalk integrationCAD97-630/+0
2020-03-03Remove `usable_size` APIsTim Diekmann-17/+17
2020-03-02Auto merge of #69635 - Dylan-DPC:rollup-2oh8uu5, r=Dylan-DPCbors-0/+70
Rollup of 6 pull requests Successful merges: - #68682 (Add documentation to compiler intrinsics) - #69544 (Unrevert "Remove `checked_add` in `Layout::repeat`") - #69617 (constify mem::forget) - #69622 (Rename `syntax` in librustc_ast/README.md) - #69623 (stash API: remove panic to fix ICE.) - #69624 (Toolstate: Don't block beta week on already broken tools.) Failed merges: - #69626 (Toolstate: don't duplicate nightly tool list.) r? @ghost
2020-03-02Rollup merge of #69623 - Centril:fix-69396-tmp, r=petrochenkovDylan DPC-0/+70
stash API: remove panic to fix ICE. Implements the temporary solution suggested in https://github.com/rust-lang/rust/pull/69537#issuecomment-593143975. Fixes https://github.com/rust-lang/rust/issues/69396. r? @petrochenkov
2020-03-02Auto merge of #69257 - RalfJung:layout-visitor, r=eddybbors-28/+28
Adjust Miri value visitor, and doc-comment layout components I realized that I still didn't have quite the right intuition for how our `LayoutDetails` work, so I had to adjust the Miri value visitor to the things I understood better now. I also added some doc-comments to `LayoutDetails` as a hopefully canonical place to note such things. The main visitor change is that we *first* look at all the fields (according to `FieldPlacement`), and *then* check the variants and handle `Multiple` appropriately. I did not quite realize how orthogonal "fields" and "variants" are. I also moved the check for the scalar ABI to *after* checking all the fields; this leads to better (more type-driven) error messages. And it looks like we can finally remove that magic hack for `ty::Generator`. :D r? @oli-obk for the Miri/visitor changes and @eddyb for the layout docs The Miri PR is at: https://github.com/rust-lang/miri/pull/1178
2020-03-02stash API: remove panic to fix ICE.Mazdak Farrokhzad-0/+70
2020-03-01encode `;` stmt w/o expr as `StmtKind::Empty`Mazdak Farrokhzad-22/+14
2020-03-01Fix use of `has_infer_types`Matthew Jasper-14/+14
* Add a new method `has_infer_types_or_consts` that's used instead most of the time, since there's generally no reason to only consider types. * Remove use of `has_closure_types`, because closures are no longer implicitly linked to the `InferCtxt`.
2020-03-01doc(librustc_error_codes): add long error explanation for E0719Matthew Kuo-0/+2
Progresses #61137
2020-03-01`delay_span_bug` when codegen cannot select obligationEsteban Küber-0/+41
Fix #69602, introduced in #60126 by letting the compiler continue past type checking after encountering errors.
2020-03-01Rollup merge of #69598 - ollie27:rustdoc_crate-version_escape, r=GuillaumeGomezDylan DPC-0/+6
rustdoc: HTML escape crate version As `--crate-version` accepts arbitrary strings they need to be escaped. r? @GuillaumeGomez
2020-03-01Rollup merge of #69605 - JohnTitor:opt-def-id, r=petrochenkovYuki Okushi-6/+8
Use `opt_def_id()` over `def_id()` Fixes #69588
2020-03-01Rollup merge of #69583 - LeSeulArtichaut:ice-69378, r=CentrilYuki Okushi-0/+17
Do not ICE on invalid type node after parse recovery Closes #69378. r? @estebank
2020-03-01Use `opt_def_id()` over `def_id()`Yuki Okushi-6/+8
2020-03-01rustdoc: HTML escape crate versionOliver Middleton-0/+6
As `--crate-version` accepts arbitrary strings they need to be escaped.
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-19/+19
2020-02-29Make it build againVadim Petrochenkov-5/+5
2020-02-29Auto merge of #69260 - GuillaumeGomez:create-E0747-error-code, r=varkor,estebankbors-3/+6
Create E0747 error code for unterminated raw strings Reopening of #66035. r? @estebank
2020-02-29Add regression testLeSeulArtichaut-0/+17
2020-02-29Auto merge of #69255 - estebank:e0599-details, r=varkorbors-108/+328
Add more context to E0599 errors Point at the intermediary unfulfilled trait bounds. Fix #52523, fix #61661, cc #36513, fix #68131, fix #64417, fix #61768, cc #57457, cc #9082, fix #57994, cc #64934, cc #65149.
2020-02-28Ignore output for some platforms with diverging test outputEsteban Küber-6/+18
Get around #53081.
2020-02-28Do not suggest implementing traits if present in predicatesEsteban Küber-9/+2
2020-02-28Reword messageEsteban Küber-2/+2
2020-02-28Reduce verbosity when suggesting restricting type paramsEsteban Küber-12/+0
2020-02-28keep predicate order and tweak outputEsteban Küber-74/+118
2020-02-28Review comments: split requirement text to multiple lines for readabilityEsteban Küber-16/+32
2020-02-28Account for arbitrary self types in E0599Esteban Küber-17/+9
2020-02-28Suggest constraining type parametersEsteban Küber-0/+75
2020-02-28Tweak wordingEsteban Küber-24/+24
2020-02-28Mention the full path of the implementing traitEsteban Küber-24/+24