about summary refs log tree commit diff
path: root/src/test
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-10Auto merge of #70994 - Centril:rollup-lftv0a3, r=Centrilbors-351/+499
Rollup of 9 pull requests Successful merges: - #69745 (Use `PredicateObligation`s instead of `Predicate`s) - #70938 (Add ThreadSanitizer test case) - #70973 (Use forward traversal for unconditional recursion lint) - #70978 (compiletest: let config flags overwrite -A unused) - #70979 (Follow up on BTreeMap comments) - #70981 (Rearrange BTreeMap::into_iter to match range_mut.) - #70985 (Clean up E0512 explanation) - #70988 (Setup the `@rustbot prioritize` command) - #70991 (fix rustc-dev-guide's url in src/librustc_codegen_ssa) Failed merges: r? @ghost
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-10Auto merge of #66605 - GuillaumeGomez:drop-python2, r=Mark-Simulacrumbors-1/+1
Stop explicitly depending on python 2 This PR revises our previous policy of officially only supporting and testing with python 2 in the CI environment to instead test with python 3. It also changes the defaults to python 3 in our various scripts (usually, by way of `python` rather than `python3` to preserve compatibility with systems that do not have a python 3 available). The effect of this is that we expect all new patches to support python 3 (and will test as such). We explicitly also expect that patches support python 2.7 as well -- and test as such, though only on one builder. This is intended as a temporary, though likely long-lived, measure to preserve compatibility while looking towards the future which is likely to be a python 3 only world. We do not at this point set a timeline for when we'll drop support for python 2.7; it's plausible that this is months or years into the future, depending on how quickly the ecosystem drops support and how painful it is for us to maintain that support over time. Closes #65063 (as far as I can tell; please file explicit and separate issues or PRs if not).
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-10Enforce Python 3 as much as possibleGuillaume Gomez-1/+1
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 #70918 - tobithiel:fix_forbid_override, r=davidtwcoMazdak Farrokhzad-0/+17
rustc_session: forbid lints override regardless of position Addresses the regression reported in #70819 for command line arguments, but does not address the source code flag regression.
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-09Auto merge of #70936 - Dylan-DPC:rollup-2ng3e5h, r=Dylan-DPCbors-34/+93
Rollup of 7 pull requests Successful merges: - #70134 (add basic support of OsStrExt for HermitCore) - #70565 (Add inline attributes for functions used in the query system) - #70828 (rustdoc: Don't try to load source files from external crates) - #70870 (Fix abuses of tykind::err) - #70906 (Suggest move for closures and async blocks in more cases.) - #70912 (Do not suggest adding type param when `use` is already suggested) - #70930 (add tracking issue to `VecDeque::make_contiguous`) Failed merges: r? @ghost
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 #70828 - ollie27:rustdoc_external_macro_src, r=eddybDylan DPC-1/+37
rustdoc: Don't try to load source files from external crates Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead. Part of #70757 r? @GuillaumeGomez cc @eddyb
2020-04-08Auto merge of #70721 - anyska:bless-all-mir-opt, r=oli-obkbors-4139/+10197
--bless all mir-opt tests. r? @oli-obk
2020-04-08Add ignore-wasm32-bare to mir-opt tests that need it.Ana-Maria Mihalache-338/+340
2020-04-08rustdoc: Don't try to load source files from external cratesOliver Middleton-1/+37
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
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-07rustc_session: forbid lints override regardless of positionTobias Thiel-0/+17
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 old mir-opt test format.Ana-Maria Mihalache-80/+2
2020-04-07Normalize away pairs of line:col numbers.Ana-Maria Mihalache-166/+166
2020-04-07Add EMIT_MIR_FOR_EACH_BIT_WIDTH to tests that need it.Ana-Maria Mihalache-488/+1855
2020-04-07--bless more mir-opt tests.Ana-Maria Mihalache-1013/+2254
2020-04-07remove false positives of unused_bracesBastian Kauschke-22/+49
2020-04-07--bless all mir-opt tests.Ana-Maria Mihalache-3046/+6572
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-07Rollup merge of #70846 - tmiasko:compiler-builtins-codegen-units, r=alexcrichtonDylan DPC-0/+40
Keep codegen units unmerged when building compiler builtins Make it possible to control how mono items are partitioned into code generation units, when compiling the compiler builtins, by retaining the original partitioning. Helps with #48625, #61063, #67960, #70489. r? @alexcrichton
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