about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2021-10-15Use more lowered spans in for loopCameron Steffen-3/+3
2021-10-15Don't mark for loop head span with desugaringCameron Steffen-1/+1
2021-10-15Auto merge of #89884 - Mark-Simulacrum:revert-enum-discr, r=wesleywiserbors-8/+114
Revert enum discriminants Reverts stabilization of arbitrary enum discriminants per https://github.com/rust-lang/rust/issues/88621#issuecomment-929482371. Reopens #60553.
2021-10-14Auto merge of #89882 - matthiaskrgr:rollup-1dh7pz8, r=matthiaskrgrbors-16/+46
Rollup of 6 pull requests Successful merges: - #89390 (Fix incorrect Box::pin suggestion) - #89433 (Fix ctrl-c causing reads of stdin to return empty on Windows.) - #89823 (Switch order of terms to prevent overflow) - #89865 (Allow static linking LLVM with ThinLTO) - #89873 (Add missing word to `FromStr` trait documentation) - #89878 (Fix missing remaining compiler specific cfg information) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-14Revert "Stabilize `arbitrary_enum_discriminant`"Mark Rousskov-8/+114
This reverts commit 7a62f29f3171767090949778ce0f161e930706b9.
2021-10-14Rollup merge of #89390 - tmandry:issue-72117, r=estebankMatthias Krüger-16/+46
Fix incorrect Box::pin suggestion The suggestion checked if `Pin<Box<T>>` could be coeerced to the expected type, but did not check predicates created by the coercion. We now look for predicates that definitely cannot be satisfied before giving the suggestion. The suggestion is still marked MaybeIncorrect because we allow predicates that are still ambiguous and can't be proven. Fixes #72117.
2021-10-14Auto merge of #88698 - Noble-Mushtak:master, r=nikomatsakis,oli-obkbors-0/+60
Add check that live_region is live in sanitize_promoted This pull request fixes #88434 by adding a check in `sanitize_promoted` to ensure that only regions which are actually live are added to the `liveness_constraints` of the `BorrowCheckContext`. To implement this change, I needed to add a method to `LivenessValues` which gets the elements contained by a region: /// Returns an iterator of all the elements contained by the region `r` crate fn get_elements(&self, row: N) -> impl Iterator<Item = Location> + '_ Then, inside `sanitize_promoted`, we check whether the iterator returned by this method is non-empty to ensure that the region is actually live at at least one location before adding that region to the `liveness_constraints` of the `BorrowCheckContext`. This is my first pull request to the Rust repo, so any feedback on how I can improve this pull request or if there is a better way to fix this issue would be very appreciated.
2021-10-14Auto merge of #89247 - fee1-dead:const-eval-select, r=oli-obkbors-0/+213
Add `const_eval_select` intrinsic Adds an intrinsic that calls a given function when evaluated at compiler time, but generates a call to another function when called at runtime. See https://github.com/rust-lang/const-eval/issues/7 for previous discussion. r? `@oli-obk.`
2021-10-14fix codegen testDeadbeef-2/+2
2021-10-14Fix const stabilityDeadbeef-0/+30
2021-10-14Avoid tupling at the calleeDeadbeef-30/+32
2021-10-14Auto merge of #89815 - GuillaumeGomez:associated-consts-sidebar, r=notriddlebors-0/+31
Associated consts sidebar Fixes #89354. A screenshot with `f32`: ![Screenshot from 2021-10-12 15-07-57](https://user-images.githubusercontent.com/3050060/136962078-5faf7b87-7ea5-4d7a-99a4-b2afd77b78e2.png)
2021-10-13Auto merge of #89858 - matthiaskrgr:rollup-evsnr2e, r=matthiaskrgrbors-0/+65
Rollup of 6 pull requests Successful merges: - #89347 (suggestion for typoed crate or module) - #89670 (Improve `std::thread::available_parallelism` docs) - #89757 (Use shallow clones for submodules) - #89759 (Assemble the compiler when running `x.py build`) - #89846 (Add `riscv32imc-esp-espidf` to 1.56 changelog) - #89853 (Update the 1.56.0 release header for consistency) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-13Move misplaced commentTyler Mandry-4/+4
2021-10-13Always check predicates in can_coerceTyler Mandry-12/+6
This only changed two tests and I consider both changes an improvement.
2021-10-13Fix incorrect Box::pin suggestionTyler Mandry-0/+36
The suggestion checked if Pin<Box<T>> could be coeerced to the expected type, but did not check predicates created by the coercion. We now look for predicates that definitely cannot be satisfied before giving the suggestion. The suggestion is marked MaybeIncorrect because we allow predicates that are still ambiguous and can't be proven.
2021-10-13Rollup merge of #89347 - TaKO8Ki:crate-or-module-typo, r=estebankMatthias Krüger-0/+65
suggestion for typoed crate or module Previously, the compiler didn't suggest similarly named crates or modules. This pull request adds a suggestion for typoed crates or modules. #76208 before: ``` error[E0433]: failed to resolve: use of undeclared type or module `chono` --> src/main.rs:2:5 | 2 | use chono::prelude::*; | ^^^^^ use of undeclared type or module `chono` ``` after: ``` error[E0433]: failed to resolve: use of undeclared type or module `chono` --> src/main.rs:2:5 | 2 | use chono::prelude::*; | ^^^^^ | | | use of undeclared crate or module `chono` | help: a similar crate or module exists: `chrono` ```
2021-10-13Auto merge of #89555 - oli-obk:nll_member_constraint_diag, r=estebankbors-354/+350
Remove textual span from diagnostic string This is an unnecessary repetition, as the diagnostic prints the span anyway in the source path right below the message. I further removed the identification of the node, as that does not give any new information in any of the cases that are changed in tests. EDIT: also inserted a suggestion that other diagnostics were already emitting
2021-10-13Auto merge of #89822 - tmiasko:overflap-duplicates, r=cjgillotbors-0/+19
Deduplicate regions ids before merging them The merging code does not expect to see any duplicates. Fixes #89820. r? `@cjgillot`
2021-10-13Auto merge of #89847 - JohnTitor:rollup-xfymeo4, r=JohnTitorbors-1/+189
Rollup of 12 pull requests Successful merges: - #89768 (add some more testcases) - #89777 (Edit explanation of test for nested type ascriptions) - #89781 (Add missing words in `Infallible` docs) - #89782 (Improve CJK font in rustdoc) - #89794 (Add #[must_use] to to_value conversions) - #89814 (Fix uppercase/lowercase error) - #89816 (Fix invalid rules in .gitignore) - #89817 (Add #[inline] to int log10 functions.) - #89818 (Use Option::map_or instead of open coding it) - #89828 (Fix config.toml overflow-checks options) - #89840 (fix the stage0 tools config file path in `config.toml.example`) - #89845 (Add davidtwco to the `.mailmap`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-13Rollup merge of #89777 - pierwill:fix-88233, r=Mark-SimulacrumYuki Okushi-1/+1
Edit explanation of test for nested type ascriptions Fixes typo ("an ascribing") and removes extra. Closes #88233.
2021-10-13Rollup merge of #89768 - hellow554:tests, r=Mark-SimulacrumYuki Okushi-0/+188
add some more testcases resolves #52893 resolves #68295 resolves #87750 resolves #88071 All these issues have been fixed according to glacier. Just adding a test so it can be closed. Can anybody tell me why the github keywords do not work? 🤔 Please edit this post if you can fix it.
2021-10-13Bless nll testsOli Scherer-10/+12
2021-10-13Re-use logic for adding a suggestion when a lifetime bound is missing on an ↵Oli Scherer-0/+15
impl trait
2021-10-13Remove explicit -Zborrowck=mir which does not affect test anymoreOli Scherer-6/+2
2021-10-13Remove a feature attribute for an accepted featureOli Scherer-5/+3
2021-10-13Use a label instead of a note for member constraint errorsOli Scherer-26/+11
2021-10-13Remove textual span from diagnostic stringOli Scherer-319/+319
2021-10-13Auto merge of #89587 - camelid:all-candidates, r=petrochenkovbors-2/+108
Include rmeta candidates in "multiple matching crates" error Only dylib and rlib candidates were included in the error. I think the reason is that at the time this error was originally implemented, rmeta crate sources were represented different from dylib and rlib sources. I wrote up more detailed analysis in [this comment][1]. The new version of the code is also a bit easier to read and should be more robust to future changes since it uses `CrateSources::paths()`. I also changed the code to sort the candidates to make the output deterministic; added full stderr tests for the error; and added a long error code explanation. [1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436 cc `@Mark-Simulacrum` `@jyn514`
2021-10-13suggestion for typoed crate or moduleTakayuki Maeda-0/+65
avoid suggesting the same name sort candidates fix a message use `opt_def_id` instead of `def_id` move `find_similarly_named_module_or_crate` to rustc_resolve/src/diagnostics.rs
2021-10-13Deduplicate regions ids before merging themTomasz Miąsko-0/+19
The merging code does not expect to see any duplicates.
2021-10-12Auto merge of #89105 - DevinR528:reachable-fix, r=Nadrierilbors-56/+337
Fix: non_exhaustive_omitted_patterns by filtering unstable and doc hidden variants Fixes: #89042 Now that #86809 has been merged there are cases (std::io::ErrorKind) where unstable feature gated variants were included in warning/error messages when the feature was not turned on. This filters those variants out of the return of `SplitWildcard::new`. Variants marked `doc(hidden)` are filtered out of the witnesses list in `Usefulness::apply_constructor`. Probably worth a perf run :shrug: since this area can be sensitive.
2021-10-12Work around different filenames for DLLsNoah Lev-2/+2
2021-10-12Add long explanation for E0464Noah Lev-1/+49
The test is copied from `src/test/ui/crate-loading/crateresolve1.rs` and its auxiliary tests. I added it to the `compile_fail` code example check exemption list since it's hard if not impossible to reproduce this error in a standalone code example.
2021-10-12Include rmeta candidates in "multiple matching crates" errorNoah Lev-0/+3
Only dylib and rlib candidates were included in the error. I think the reason is that at the time this error was originally implemented, rmeta crate sources were represented different from dylib and rlib sources. I wrote up more detailed analysis in [this comment][1]. The new version of the code is also a bit easier to read and should be more robust to future changes since it uses `CrateSources::paths()`. [1]: https://github.com/rust-lang/rust/pull/88675#issuecomment-935282436
2021-10-12Add test for showing rmeta candidates in errorNoah Lev-0/+39
2021-10-12Test crate loading error stderrNoah Lev-2/+18
And remove E0464 from test-exemption list, since it now has a full test.
2021-10-12Add test for associated constants in the sidebarGuillaume Gomez-0/+31
2021-10-12Filter unstable and doc hidden variants in usefulness checkingDevin Ragotzy-56/+337
Add test cases for unstable variants Add test cases for doc hidden variants Move is_doc_hidden to method on TyCtxt Add unstable variants test to reachable-patterns ui test Rename reachable-patterns -> omitted-patterns
2021-10-12Auto merge of #89770 - jkugelman:must-use-from-and-into, r=joshtriplettbors-1/+2
Add #[must_use] to From::from and Into::into Risk of churn: **High** Magic 8-Ball says: **Outlook not so good** I figured I'd put this out there. If we don't do it now maybe we save it for a rainy day. Parent issue: #89692 r? `@joshtriplett`
2021-10-12add some more testcasesMarcel Hellwig-0/+188
2021-10-12Add const_eval_select intrinsicDeadbeef-0/+181
2021-10-12Auto merge of #89791 - matthiaskrgr:rollup-1lhxh5b, r=matthiaskrgrbors-23/+54
Rollup of 9 pull requests Successful merges: - #89471 (Use Ancestory to check default fn in const impl instead of comparing idents) - #89643 (Fix inherent impl overlap check.) - #89651 (Add `Poll::ready` and revert stabilization of `task::ready!`) - #89675 (Re-use TypeChecker instead of passing around some of its fields ) - #89710 (Add long explanation for error E0482) - #89756 (Greatly reduce amount of debuginfo compiled for bootstrap itself) - #89760 (Remove hack ignoring unused attributes for stage 0 std) - #89772 (Fix function-names test for GDB 10.1) - #89785 (Fix ICE when compiling nightly std/rustc on beta compiler) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-10-11Add #[must_use] to From::from and Into::intoJohn Kugelman-1/+2
2021-10-11Rollup merge of #89772 - michaelwoerister:fix-function-names-test-gdb, ↵Matthias Krüger-15/+16
r=Mark-Simulacrum Fix function-names test for GDB 10.1 This PR updates the test output in `src/test/debuginfo/function-names.rs` for GDB 10.1. This should fix issue https://github.com/rust-lang/rust/issues/89750 -- but not the underlying problem of CI ignoring tests if not viable debugger happens to be present.
2021-10-11Rollup merge of #89471 - nbdd0121:const3, r=fee1-deadMatthias Krüger-8/+38
Use Ancestory to check default fn in const impl instead of comparing idents Fixes https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Const.20trait.20impl.20inside.20macro
2021-10-11Auto merge of #89648 - nbdd0121:issue-89606, r=nikomatsakisbors-0/+40
Ignore type of projections for upvar capturing Fix #89606 Ignore type of projections for upvar capturing. Originally HashMap is used, and the hash/eq implementation of Place takes the type of projections into account. These types may differ by lifetime which causes #89606 to ICE. I originally considered erasing regions but `place.ty()` is used when creating upvar tuple type, more than just serving as a key type, so I switched to a linear comparison with custom eq (`compare_place_ignore_ty`) instead. r? `@wesleywiser` `@rustbot` label +T-compiler
2021-10-11Edit explanation of test for nested type ascriptionspierwill-1/+1
Closes #88233
2021-10-11Split impl-with-default-fn test into a pass test and a fail testGary Guo-8/+38
2021-10-11Auto merge of #83908 - Flying-Toast:master, r=davidtwcobors-1/+166
Add enum_intrinsics_non_enums lint There is a clippy lint to prevent calling [`mem::discriminant`](https://doc.rust-lang.org/std/mem/fn.discriminant.html) with a non-enum type. I think the lint is worthy of being included in rustc, given that `discriminant::<T>()` where `T` is a non-enum has an unspecified return value, and there are no valid use cases where you'd actually want this. I've also made the lint check [variant_count](https://doc.rust-lang.org/core/mem/fn.variant_count.html) (#73662). closes #83899