about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-11-18Rollup merge of #78999 - petrochenkov:deprid, r=eddybMara Bos-1/+11
stability: More precise location for deprecation lint on macros One missing piece of https://github.com/rust-lang/rust/pull/73178.
2020-11-18Revert "Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrum"Pietro Albini-18/+29
This was landed on master instead of beta!
2020-11-18Auto merge of #77820 - jyn514:from-inner, r=petrochenkovbors-9/+9
Add `Item::from_def_id_and_kind` to reduce duplication in rustdoc This makes it harder to make typos, and also makes it much more clear what's intentionally different rather than a typo (look for `what_rustc_thinks`). Found this while working on https://github.com/rust-lang/rust/issues/76998, I really didn't want to add `const_visibility` in 20 different places. r? `@GuillaumeGomez`
2020-11-18Auto merge of #79132 - pietroalbini:beta-next, r=Mark-Simulacrumbors-29/+18
Prepare beta 1.49.0 This PR sets everything up for beta 1.49.0, and backports the following PRs to it: * #79107 - build-manifest: strip newline from rustc version * #78986 - Avoid installing external LLVM dylibs * #79074 - Install CI llvm into the library directory * #78364 - Update RELEASES.md for 1.48.0 * #77939 - Ensure that the source code display is working with DOS backline r? `@ghost` cc `@rust-lang/release`
2020-11-17Add `from_def_id_and_kind` reducing duplication in rustdocJoshua Nelson-0/+2
- Add `Item::from_hir_id_and_kind` convenience wrapper - Make name parameter mandatory `tcx.opt_item_name` doesn't handle renames, so this is necessary for any item that could be renamed, which is almost all of them. - Override visibilities to be `Inherited` for enum variants `tcx.visibility` returns the effective visibility, not the visibility that was written in the source code. `pub enum E { A, B }` always has public variants `A` and `B`, so there's no sense printing `pub` again. - Don't duplicate handling of `Visibility::Crate` Instead, represent it as just another `Restricted` path.
2020-11-17Use DefPath for clean::Visibility, not clean::PathJoshua Nelson-9/+7
Visibility needs much less information than a full path, since modules can never have generics. This allows constructing a Visibility from only a DefId. Note that this means that paths are now normalized to their DefPath. In other words, `pub(self)` or `pub(super)` now always shows `pub(in path)` instead of preserving the original text.
2020-11-17Update fulldeps testMark Rousskov-29/+18
2020-11-17Rollup merge of #79130 - lcnr:extend-tes, r=varkorMara Bos-2/+44
extend macro braces test r? `@varkor`
2020-11-17Rollup merge of #79072 - oli-obk:byte_str_pat, r=estebankMara Bos-2/+59
Fix exhaustiveness in case a byte string literal is used at slice type fixes #79048
2020-11-17extend macro braces testBastian Kauschke-2/+44
2020-11-17Fix exhaustiveness in case a byte string literal is used at slice typeoli-2/+59
2020-11-17Rollup merge of #79097 - GuillaumeGomez:code-block-invalid-html-tag-lint, ↵Mara Bos-0/+21
r=jyn514 Code block invalid html tag lint Fixes #79095 r? ``@jyn514``
2020-11-17Rollup merge of #79027 - tmiasko:inline-always-live-locals, r=oli-obkMara Bos-4/+31
Limit storage duration of inlined always live locals Closes #76375.
2020-11-17Rollup merge of #78967 - tmiasko:codegen-tests, r=cuviperMara Bos-9/+17
Make codegen tests compatible with extra inlining
2020-11-17Auto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakisbors-2/+1630
RFC-2229: Implement Precise Capture Analysis ### This PR introduces - Feature gate for RFC-2229 (incomplete) `capture_disjoint_field` - Rustc Attribute to print out the capture analysis `rustc_capture_analysis` - Precise capture analysis ### Description of the analysis 1. If the feature gate is not set then all variables that are not local to the closure will be added to the list of captures. (This is for backcompat) 2. The rest of the analysis is based entirely on how the captured `Place`s are used within the closure. Precise information (i.e. projections) about the `Place` is maintained throughout. 3. To reduce the amount of information we need to keep track of, we do a minimization step. In this step, we determine a list such that no Place within this list represents an ancestor path to another entry in the list. Check rust-lang/project-rfc-2229#9 for more detailed examples. 4. To keep the compiler functional as before we implement a Bridge between the results of this new analysis to existing data structures used for closure captures. Note the new capture analysis results are only part of MaybeTypeckTables that is the information is only available during typeck-ing. ### Known issues - Statements like `let _ = x` will make the compiler ICE when used within a closure with the feature enabled. More generally speaking the issue is caused by `let` statements that create no bindings and are init'ed using a Place expression. ### Testing We removed the code that would handle the case where the feature gate is not set, to enable the feature as default and did a bors try and perf run. More information here: #78762 ### Thanks This has been slowly in the works for a while now. I want to call out `@Azhng` `@ChrisPardy` `@null-sleep` `@jenniferwills` `@logmosier` `@roxelo` for working on this and the previous PRs that led up to this, `@nikomatsakis` for guiding us. Closes rust-lang/project-rfc-2229#7 Closes rust-lang/project-rfc-2229#9 Closes rust-lang/project-rfc-2229#6 Closes rust-lang/project-rfc-2229#19 r? `@nikomatsakis`
2020-11-16Rollup merge of #79032 - lcnr:arg-count, r=varkorMara Bos-199/+123
improve type const mismatch errors Doesn't completely remove `check_generic_arg_count` as that would have required some more complex changes but instead checks type and const params in only one step. Also moved the help added by `@JulianKnodt` in #75611 to `generic_arg_mismatch_err`. r? `@varkor` cc `@petrochenkov`
2020-11-16Rollup merge of #78714 - m-ou-se:simplify-local-streams, r=KodrAusMara Bos-37/+11
Simplify output capturing This is a sequence of incremental improvements to the unstable/internal `set_panic` and `set_print` mechanism used by the `test` crate: 1. Remove the `LocalOutput` trait and use `Arc<Mutex<dyn Write>>` instead of `Box<dyn LocalOutput>`. In practice, all implementations of `LocalOutput` were just `Arc<Mutex<..>>`. This simplifies some logic and removes all custom `Sink` implementations such as `library/test/src/helpers/sink.rs`. Also removes a layer of indirection, as the outermost `Box` is now gone. It also means that locking now happens per `write_fmt`, not per individual `write` within. (So `"{} {}\n"` now results in one `lock()`, not four or more.) 2. Since in all cases the `dyn Write`s were just `Vec<u8>`s, replace the type with `Arc<Mutex<Vec<u8>>>`. This simplifies things more, as error handling and flushing can be removed now. This also removes the hack needed in the default panic handler to make this work with `::realstd`, as (unlike `Write`) `Vec<u8>` is from `alloc`, not `std`. 3. Replace the `RefCell`s by regular `Cell`s. The `RefCell`s were mostly used as `mem::replace(&mut *cell.borrow_mut(), something)`, which is just `Cell::replace`. This removes an unecessary bookkeeping and makes the code a bit easier to read. 4. Merge `set_panic` and `set_print` into a single `set_output_capture`. Neither the test crate nor rustc (the only users of this feature) have a use for using these separately. Merging them simplifies things even more. This uses a new function name and feature name, to make it clearer this is internal and not supposed to be used by other crates. Might be easier to review per commit.
2020-11-16Rollup merge of #78678 - Nemo157:doc-cfg-w-traits, r=jyn514,GuillaumeGomezMara Bos-0/+124
Add tests and improve rendering of cfgs on traits Shows the additional features required to get the trait implementation, suppressing any already shown on the current page. One interesting effect from this is if you have a cfg-ed type, implementing a cfg-ed trait (so the implementation depends on both cfgs), you will get the inverted pair of cfgs shown on each page: ![image](https://user-images.githubusercontent.com/81079/97904671-207bdc00-1d41-11eb-8144-707e8017d2b6.png) ![image](https://user-images.githubusercontent.com/81079/97904700-27a2ea00-1d41-11eb-8b9f-e925ba339044.png) The hidden items on the trait implementation also now get the correct cfgs displayed on them. Tests are blocked on #78673. fixes #68100 cc #43781
2020-11-16Add test to ensure that "invalid HTML tag" lint isn't fired in code blocksGuillaume Gomez-0/+21
2020-11-16improve error message for const ty param mismatchBastian Kauschke-195/+119
2020-11-15Rollup merge of #79016 - fanzier:underscore-expressions, r=petrochenkovJonas Schievink-43/+210
Make `_` an expression, to discard values in destructuring assignments This is the third and final step towards implementing destructuring assignment (RFC: rust-lang/rfcs#2909, tracking issue: #71126). This PR is the third and final part of #71156, which was split up to allow for easier review. With this PR, an underscore `_` is parsed as an expression but is allowed *only* on the left-hand side of a destructuring assignment. There it simply discards a value, similarly to the wildcard `_` in patterns. For instance, ```rust (a, _) = (1, 2) ``` will simply assign 1 to `a` and discard the 2. Note that for consistency, ``` _ = foo ``` is also allowed and equivalent to just `foo`. Thanks to ````@varkor```` who helped with the implementation, particularly around pre-expansion gating. r? ````@petrochenkov````
2020-11-15Rollup merge of #78980 - thiolliere:gui-fix-qpath, r=estebankDylan DPC-0/+16
Fix rustc_ast_pretty print_qpath resulting in invalid macro input related https://github.com/rust-lang/rust/issues/76874 (third case) ### Issue: The input for a procedural macro is incorrect, for the rust code: ```rust mod m { pub trait Tr { type Ts: super::Tu; } } trait Tu { fn dummy() { } } #[may_proc_macro] fn foo() { <T as m::Tr>::Ts::dummy(); } ``` the macro will get the input: ```rust fn foo() { <T as m::Tr>::dummy(); } ``` Thus `Ts` has disappeared. ### Fix: This is due to invalid pretty print of qpath. This PR fix it.
2020-11-15Rollup merge of #78969 - tmiasko:normalize, r=davidtwcoDylan DPC-8/+14
Normalize function type during validation During inlining, the callee body is normalized and has types revealed, but some of locals corresponding to the arguments might come from the caller body which is not. As a result the caller body does not pass validation without additional normalization. Closes #78442.
2020-11-15Rollup merge of #78966 - tmiasko:inline-never, r=oli-obkDylan DPC-39/+219
Never inline C variadics, cold functions, functions with incompatible attributes ... ... and fix generator inlining. Closes #67863. Closes #78859.
2020-11-15Rollup merge of #78962 - poliorcetics:rustdoc-raw-ident-test, r=jyn514Dylan DPC-0/+22
Add a test for r# identifiers I'm not entirely sure I properly ran the test locally (I think so though), waiting for CI to confirm. :) ```````@rustbot``````` modify labels: T-rustdoc r? ```````@jyn514```````
2020-11-15Rollup merge of #78948 - slanterns:master, r=varkorDylan DPC-0/+7
test: add `()=()=()=...` to weird-exprs.rs Idea from https://github.com/rust-lang/rust/pull/71156#discussion_r410953972 😄 Builds on nightly since https://github.com/rust-lang/rust/pull/78748 has been merged.
2020-11-15Rollup merge of #78856 - mark-i-m:fix-or-pat-ice, r=matthewjasperDylan DPC-0/+65
Explicitly checking for or-pattern before test Fixes https://github.com/rust-lang/rust/issues/72680 cc https://github.com/rust-lang/rust/issues/54883 r? ````@varkor````
2020-11-15Rollup merge of #78848 - DevJPM:ci-llvm-9, r=nikicDylan DPC-3/+0
Bump minimal supported LLVM version to 9 This bumps the minimal tested llvm version to 9. This should enable supporting newer LLVM features (and CPU extensions). This was motived by #78361 having to drop features because of LLVM 8 not supporting certain CPU extensions yet. This was declared relatively uncontroversial on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Min.20Supported.20LLVM.20Upgrade.20Process.3F/near/215957859). Paging ````@eddyb```` because there was a comment in the [dockerfile](https://github.com/rust-lang/rust/blob/master/src/ci/docker/host-x86_64/x86_64-gnu-llvm-8/Dockerfile#L42) describing a hack (which I don't quite understand) which was also blocked by not having LLVM 9.
2020-11-15Rollup merge of #78590 - DeveloperC286:issue_60302, r=varkorDylan DPC-1/+1
refactor: removing alloc::collections::vec_deque ignore-tidy-filelength This PR removes the need for ignore-tidy-filelength for alloc::collections::vec_deque which is part of the issue https://github.com/rust-lang/rust/issues/60302 It is probably easiest to review this PR by looking at it commit by commit rather than looking at the overall diff.
2020-11-15Limit storage duration of inlined always live localsTomasz Miąsko-4/+31
2020-11-14Auto merge of #79049 - tmiasko:lower-intrinsics, r=jonas-schievinkbors-5/+263
Lower intrinsics calls: forget, size_of, unreachable, wrapping_* This allows constant propagation to evaluate `size_of` and `wrapping_*`, and unreachable propagation to propagate a call to `unreachable`. The lowering is performed as a MIR optimization, rather than during MIR building to preserve the special status of intrinsics with respect to unsafety checks and promotion. Currently enabled by default to determine the performance impact (no significant impact expected). In practice only useful when combined with inlining since intrinsics are rarely used directly (with exception of `unreachable` and `discriminant_value` used by built-in derive macros). Closes #32716.
2020-11-14Add tests and improve rendering of features on traitsWim Looman-0/+124
2020-11-14Auto merge of #78809 - vn-ki:fix-issue-76064, r=oli-obkbors-130/+42
add error_occured field to ConstQualifs, fix #76064 I wasn't sure what `in_return_place` actually did and not sure why it returns `ConstQualifs` while it's sibling functions return `bool`. So I tried to make as minimal changes to the structure as possible. Please point out whether I have to refactor it or not. r? `@oli-obk` cc `@RalfJung`
2020-11-14Add underscore expressions for destructuring assignmentsFabian Zaiser-43/+210
Co-authored-by: varkor <github@varkor.com>
2020-11-14Style nitWho? Me?!-1/+1
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2020-11-14Lower intrinsics calls: forget, size_of, unreachable, wrapping_*Tomasz Miąsko-5/+263
This allows constant propagation to evaluate `size_of` and `wrapping_*`, and unreachable propagation to propagate a call to `unreachable`. The lowering is performed as a MIR optimization, rather than during MIR building to preserve the special status of intrinsics with respect to unsafety checks and promotion.
2020-11-13Auto merge of #78683 - Nemo157:issue-78673, r=lcnrbors-0/+24
Check predicates from blanket trait impls while testing if they apply fixes #78673
2020-11-13Log closure as wellAman Arora-215/+716
2020-11-13Auto merge of #78888 - richkadel:llvm-coverage-tests, r=tmandrybors-35/+23
Fix and re-enable two coverage tests on MacOS Note, in the coverage-reports test, the comment about MacOS was wrong. The setting is based on config.toml llvm `optimize` setting. There doesn't appear to be any environment variable I can check, and I don't think we should add one. Testing the binary itself is a more reliable way to check anyway. For the coverage-spanview test, I removed the dependency on sed altogether, which is much less ugly than trying to work around the MacOS sed differences. I tested these changes on Linux, Windows, and Mac. r? `@tmandry` FYI `@wesleywiser`
2020-11-13lessen restriction in `check_kind_count`Bastian Kauschke-8/+8
2020-11-13refactor: vec_deque ignore-tidy-filelengthC-1/+1
commit c547d5fabcd756515afa7263ee5304965bb4c497 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 11:22:23 2020 +0000 test: updating ui/hygiene/panic-location.rs expected commit 2af03769c4ffdbbbad75197a1ad0df8c599186be Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 10:43:30 2020 +0000 fix: documentation unresolved link commit c4b0df361ce27d7392d8016229f2e0265af32086 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:58:31 2020 +0000 style: compiling with Rust's style guidelines commit bdd2de5f3c09b49a18e3293f2457fcab25557c96 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:56:31 2020 +0000 refactor: removing ignore-tidy-filelength commit fcc4b3bc41f57244c65ebb8e4efe4cbc9460b5a9 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:51:35 2020 +0000 refactor: moving trait RingSlices to ring_slices.rs commit 2f0cc539c06d8841baf7f675168f68ca7c21e68e Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:46:09 2020 +0000 refactor: moving struct PairSlices to pair_slices.rs commit a55d3ef1dab4c3d85962b3a601ff8d1f7497faf2 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:31:45 2020 +0000 refactor: moving struct Iter to iter.rs commit 76ab33a12442a03726f36f606b4e0fe70f8f246b Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:24:32 2020 +0000 refactor: moving struct IntoIter into into_iter.rs commit abe0d9eea2933881858c3b1bc09df67cedc5ada5 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 02:19:07 2020 +0000 refactor: moving struct IterMut into iter_mut.rs commit 70ebd6420335e1895e2afa2763a0148897963e24 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 01:49:15 2020 +0000 refactor: moved macros into macros.rs commit b08dd2add994b04ae851aa065800bd8bd6326134 Author: C <DeveloperC@protonmail.com> Date: Sat Oct 31 01:05:36 2020 +0000 refactor: moving vec_deque.rs to vec_deque/mod.rs
2020-11-13Rollup merge of #78996 - lcnr:cg-promotion, r=RalfJungGuillaume Gomez-0/+11
add explicit test for const param promotion r? `@RalfJung`
2020-11-13Rollup merge of #78985 - lcnr:cg-drop-test, r=nikomatsakisGuillaume Gomez-28/+61
add dropck test for const params r? `@nikomatsakis` or `@varkor`
2020-11-13Rollup merge of #78984 - GuillaumeGomez:rustdoc-check-option, r=jyn514Guillaume Gomez-0/+143
Rustdoc check option The ultimate goal behind this option would be to have `rustdoc --check` being run when you use `cargo check` as a second step. r? `@jyn514`
2020-11-13Rollup merge of #77151 - rust-lang:LeSeulArtichaut-patch-1, r=pnkfelixGuillaume Gomez-0/+16
Add regression test for issue #76042 Originally posted in https://github.com/rust-lang/rust/issues/76042#issuecomment-683272710. r? `@pnkfelix`
2020-11-13Fix wrong XPathAlexis Bourget-4/+6
2020-11-12Ensure that INVALID_CODEBLOCK_ATTRIBUTES lint is emittedGuillaume Gomez-28/+47
2020-11-12Normalize function type during validationTomasz Miąsko-8/+14
During inlining, the callee body is normalized and has types revealed, but some of locals corresponding to the arguments might come from the caller body which is not. As a result the caller body does not pass validation without additional normalization.
2020-11-12stability: More precise location for deprecation lint on macrosVadim Petrochenkov-1/+11
2020-11-12./x.py test --blessTomasz Miąsko-36/+184