about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2020-04-11Auto merge of #69573 - pnkfelix:issue-53114-add-tests, r=Centrilbors-0/+300
tests encoding current behavior for various cases of "binding" to _. The `_` binding form is special, in that it encodes a "no-op": nothing is actually bound, and thus nothing is moved or borrowed in this scenario. Usually we do the "right" thing in all such cases. The exceptions are explicitly pointed out in this test case, so that we keep track of whether they are eventually fixed. Cc #53114. (This does not close the aforementioned issue; it just adds the tests encoding the current behavior, which we hope to eventually fix.)
2020-04-10--bless youMazdak Farrokhzad-8/+8
2020-04-10Rollup merge of #70938 - tmiasko:thread-test-case, r=hanna-kruppeMazdak Farrokhzad-0/+57
Add ThreadSanitizer test case
2020-04-10Rollup merge of #69745 - estebank:predicate-obligations-3, r=nikomatsakis,eddybMazdak Farrokhzad-351/+442
Use `PredicateObligation`s instead of `Predicate`s Keep more information about trait binding failures. Use more specific spans by pointing at bindings that introduce obligations. Subset of #69709. r? @eddyb
2020-04-10copy test cases to `if let` as well.Felix S. Klock II-2/+59
2020-04-10Update src/test/ui/binding/issue-53114-safety-checks.rsFelix S Klock II-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-04-10Update src/test/ui/binding/issue-53114-borrow-checks.rsFelix S Klock II-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-04-10tests encoding current behavior for various cases of "binding" to _.Felix S. Klock II-0/+243
The `_` binding form is special, in that it encodes a "no-op": nothing is actually bound, and thus nothing is moved or borrowed in this scenario. Usually we do the "right" thing in all such cases. The exceptions are explicitly pointed out in this test case, so that we keep track of whether they are eventually fixed.
2020-04-10Add ThreadSanitizer test caseTomasz Miąsko-0/+57
2020-04-10Rollup merge of #70913 - eddyb:rc-arc-diagnostic-items, r=matthewjasperMazdak Farrokhzad-7/+7
Replace "rc"/"arc" lang items with Rc/Arc diagnostic items. `Rc`/`Arc` should have no special semantics, so it seems appropriate for them to not be lang items. r? @matthewjasper
2020-04-10Rollup merge of #70784 - estebank:suggest-type-fundamental-method, ↵Mazdak Farrokhzad-2/+16
r=matthewjasper Consider methods on fundamental `impl` when method is not found on numeric type Fix #47759.
2020-04-09Consider methods on fundamental `impl` when method is not found on numeric typeEsteban Küber-2/+16
Fix #47759.
2020-04-09Rollup merge of #70939 - varkor:const-generics-regression-tests, r=CentrilMazdak Farrokhzad-0/+64
Add two const generics regression tests Closes https://github.com/rust-lang/rust/issues/66596. Closes https://github.com/rust-lang/rust/issues/61522.
2020-04-09Add regression test for #61522varkor-0/+40
2020-04-09Add regression test for #66596varkor-0/+24
2020-04-09Rollup merge of #70916 - Centril:track-caller-ffi, r=eddybMazdak Farrokhzad-21/+78
Support `#[track_caller]` on functions in `extern "Rust" { ... }` Fixes https://github.com/rust-lang/rust/issues/70830 which is the follow-up to @eddyb's suggestion in https://github.com/rust-lang/rust/pull/69251#discussion_r380791634 to allow `#[track_caller]` on `fn`s in FFI imports, that is, on functions in `extern "Rust" { ... }` blocks. This requires that the other side, the FFI export, also have the `#[track_caller]` attribute. Otherwise, undefined behavior is triggered and the blame lies, as usual, with the `unsafe { ... }` block which called the FFI imported function. After this PR, all forms of `fn` items with the right ABI (`"Rust"`) support `#[track_caller]`. As a drive-by, the PR also hardens the check rejecting `#[naked] #[track_caller]` such that methods and other forms of `fn` items are also considered. r? @eddyb cc @rust-lang/lang
2020-04-09Rollup merge of #70822 - jonas-schievink:curse-of-the-recursion, ↵Mazdak Farrokhzad-0/+18
r=ecstatic-morse Don't lint for self-recursion when the function can diverge Fixes https://github.com/rust-lang/rust/issues/54444
2020-04-09Rollup merge of #70367 - nikomatsakis:issue-69307, r=Aaron1011Mazdak Farrokhzad-0/+53
save/restore `pessimistic_yield` when entering bodies This flag is used to make the execution order around `+=` operators pessimistic. Failure to save/restore the flag was causing independent async blocks to effect one another, leading to strange ICEs and failed assumptions. Fixes #69307 r? @Zoxc
2020-04-09track_caller: support on FFI importsMazdak Farrokhzad-18/+50
2020-04-08Small tweaks to required bound spanEsteban Küber-321/+318
2020-04-08Use `PredicateObligation`s instead of `Predicate`sEsteban Küber-91/+185
Keep more information about trait binding failures.
2020-04-08Rollup merge of #70912 - estebank:reduce-type-param-sugg-verbosity, r=davidtwcoDylan DPC-8/+0
Do not suggest adding type param when `use` is already suggested Fix #70365, cc #70572.
2020-04-08Rollup merge of #70906 - gizmondo:66107, r=estebankDylan DPC-25/+56
Suggest move for closures and async blocks in more cases. Fixes #66107, also improves #67577 Related PR https://github.com/rust-lang/rust/pull/65166
2020-04-08Rollup merge of #70789 - lcnr:macros, r=varkorDylan DPC-22/+49
remove false positives of unused_braces fixes #70717 We could potentially be more aggressive when linting let bindings by checking if there are any explicit `ref`s. I have been unable to create a snippet which compiles when using braces but has a borrowck error without them. The closes I've gotten is [the following (playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=4a1552ebe9648cb13fcb8dd969189a6c). r? @eddyb
2020-04-08Suggest move for closures and async blocks in more cases.Alex Aktsipetrov-25/+56
2020-04-08Replace "rc"/"arc" lang items with Rc/Arc diagnostic items.Eduard-Mihai Burtescu-7/+7
2020-04-08track_caller: harden naked interactionsMazdak Farrokhzad-3/+28
2020-04-07Do not suggest adding type param when `use` is already suggestedEsteban Küber-8/+0
Fix #70365, cc #70572.
2020-04-07remove false positives of unused_bracesBastian Kauschke-22/+49
2020-04-07Rollup merge of #70857 - faern:use-assoc-int-float-consts, r=dtolnayDylan DPC-1/+1
Don't import integer and float modules, use assoc consts 2 Follow up to #70777. I missed quite a lot of places. Partially because I wanted to keep the size of the last PR down, and partially because my regexes were not good enough :) r? @dtolnay
2020-04-07Auto merge of #70164 - eddyb:walk-generic-arg, r=nikomatsakisbors-2/+2
ty/walk: iterate `GenericArg`s instead of `Ty`s. Before this PR, `Ty::walk` only iterated over `Ty`s, but that's becoming an increasing problem with `const` generics, as `ty::Const`s in `Substs` are missed by it. By working with `GenericArg` instead, we can handle both `Ty`s and `ty::Const`s, but also `ty::Region`s, which used to require ad-hoc mechanisms such as `push_regions`. I've also removed `TraitRef::input_types`, as it's both long obsolete, and easy to misuse.
2020-04-07Use assoc integer constants in librustc_*Linus Färnstrand-1/+1
2020-04-06traits/coherence: stop using `Ty::walk_shallow`.Eduard-Mihai Burtescu-2/+2
2020-04-06add nested regression testNiko Matsakis-0/+30
2020-04-06Auto merge of #70771 - RalfJung:ctfe-loop, r=oli-obkbors-0/+14
Miri terminator handling: only do progress sanity check for 'Call' terminator This will still catch mistakes in bad intrinsic/foreign-item shims, which is the main source of errors here. Fixes https://github.com/rust-lang/rust/issues/70723 r? @oli-obk
2020-04-06tweak rustc_layout debug outputRalf Jung-10/+10
2020-04-06Rollup merge of #70827 - estebank:shorten-sugg-span-add-lt, r=ecstatic-morseMazdak Farrokhzad-1/+1
Use smaller span for suggestion restricting lifetime
2020-04-06Rollup merge of #70739 - Centril:fix-70736, r=petrochenkovMazdak Farrokhzad-0/+85
def_collector, visit_fn: account for no body Fixes #70736 r? @petrochenkov
2020-04-06Rollup merge of #70519 - estebank:constraints-before-args-spans, r=CentrilMazdak Farrokhzad-43/+72
Tweak output of type params and constraints in the wrong order r? @Centril @varkor
2020-04-05Reduce the visual clutterEsteban Küber-54/+20
Using a single label for constraints and generic arguments.
2020-04-06Move sanitize-inline-always test to sanitize directoryTomasz Miąsko-2/+2
2020-04-05Use smaller span for suggestion restricting lifetimeEsteban Küber-1/+1
2020-04-06Rollup merge of #70798 - estebank:satisfy, r=CentrilMazdak Farrokhzad-18/+18
"cannot resolve" → "cannot satisfy" CC #66523 r? @Centril
2020-04-06Don't lint for self-recursion when the function can divergeJonas Schievink-0/+18
2020-04-05add testRalf Jung-0/+14
2020-04-05"cannot resolve" → "cannot satisfy"Esteban Küber-18/+18
2020-04-05Rollup merge of #70815 - RalfJung:layout-debug, r=jonas-schievinkDylan DPC-6/+45
Enable layout debugging for `impl Trait` type aliases I also made it print the actual type name that the alias picks under the hood.
2020-04-05also print type typeRalf Jung-5/+5
2020-04-05also print rustc_layout on impl trait type aliasesRalf Jung-2/+41
2020-04-05Rollup merge of #70806 - RalfJung:miri-assignment-check, r=eddybDylan DPC-0/+10
fix Miri assignment sanity check Thanks @eddyb for pointing me to the right APIs! r? @eddyb Fixes https://github.com/rust-lang/rust/issues/70804