about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-11-22Auto merge of #79319 - m-ou-se:rollup-d9n5viq, r=m-ou-sebors-3/+81
Rollup of 10 pull requests Successful merges: - #76941 (Add f{32,64}::is_subnormal) - #77697 (Split each iterator adapter and source into individual modules) - #78305 (Stabilize alloc::Layout const functions) - #78608 (Stabilize refcell_take) - #78793 (Clean up `StructuralEq` docs) - #79267 (BTreeMap: address namespace conflicts) - #79293 (Add test for eval order for a+=b) - #79295 (BTreeMap: fix minor testing mistakes in #78903) - #79297 (BTreeMap: swap the names of NodeRef::new and Root::new_leaf) - #79299 (Stabilise `then`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-22Rollup merge of #79293 - Havvy:test-eval-order-compound-assign, ↵Mara Bos-0/+76
r=Mark-Simulacrum Add test for eval order for a+=b Yes, the order of evaluation *does* change depending on the types of the operands. Cursed, I know. I've elected to place this test into `expr/compound-assignment` creating both the `expr` directory and the `compound-assignment` directory. I plan in a future PR to also move the `if` directory and the loose `if` tests into `expr/if` and other similar cleanups of the `test/ui` directory. Future work: Test more than just `+=`, but all operators. I don't know if using a macro to generate these tests cases would be okay or not, but it'd be boilerplatey without it. I'm also confident you cannot change the evaluation order of one operator without changing all of them. Future work: Additionally, test more than just `i32 += i32` for the primitive version. I don't actually know the full set of primitive implementations, but I imagine there's enough to cause a combinatorial explosion with the previous future work item. Somewhere on the order of one to two hundred individual functions.
2020-11-22Rollup merge of #77697 - WaffleLapkin:iter_split_adaptors, r=m-ou-seMara Bos-3/+5
Split each iterator adapter and source into individual modules This PR creates individual modules for each iterator adapter and iterator source. This is done to enhance the readability of corresponding modules (`adapters/mod.rs` and `sources.rs`) which were hard to navigate and read because of lots of repeated lines (e.g.: `adapters/mod.rs` was 3k lines long). This is also in line with some adapters which already had their own modules (`Flatten`, `FlatMap`, `Chain`, `Zip`, `Fuse`). This PR also makes `Take`s adapter fields private (I have no idea why they were `pub(super)` before). r? ``@LukasKalbertodt``
2020-11-22Auto merge of #79219 - shepmaster:beta-bump, r=Mark-Simulacrumbors-1/+1
Bump bootstrap compiler version r? `@Mark-Simulacrum` /cc `@pietroalbini`
2020-11-22Auto merge of #79243 - Nadrieril:consolidate-tests, r=varkorbors-665/+907
Consolidate exhaustiveness-related tests I hunted for tests that only exercised the match exhaustiveness algorithm and regrouped them. I also improved integer-range tests since I had found them lacking while hacking around. The interest is mainly so that one can pass `--test-args patterns` and catch most relevant tests. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-11-22Rollup merge of #79302 - est31:issue_73899_test, r=lcnrGuillaume Gomez-0/+21
Add regression test for issue 73899 Closes #73899
2020-11-22Rollup merge of #79300 - GuillaumeGomez:hidden-feature-info, r=jyn514Guillaume Gomez-2/+8
Prevent feature information to be hidden if it's on the impl directly Fixes #79279. So when a `#[doc(cfg...)]` is used on a trait impl directly, it's not hidden by the toggle. ![Screenshot from 2020-11-22 14-40-11](https://user-images.githubusercontent.com/3050060/99905528-997fab00-2cd1-11eb-83be-ed06b0cb97df.png) r? `@jyn514`
2020-11-22Rollup merge of #78670 - sasurau4:test/check-pass-incremental, r=jyn514Guillaume Gomez-6/+6
Remove FIXME comment in some incremental test suite Helps with #62277 I removed FIXME comment in some incremental tests with [rustc_partition_codegened](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_incremental/assert_module_sources/index.html). This seems using codegen process. So it uses intentionally `build-pass`
2020-11-22Prevent feature information to be hidden if it's on the impl directlyGuillaume Gomez-2/+8
2020-11-22Add regression test for issue 73899est31-0/+21
Adds regression test for https://github.com/rust-lang/rust/issues/73899
2020-11-22Add test for eval order for a+=bHavvy (Ryan Scheel)-0/+76
Yes, the order of evaluation *does* change depending on the types of the operands. Cursed, I know. I've elected to place this test into `expr/compound-assignment` creating both the `expr` directory and the `compound-assignment` directory. I plan in a future PR to also move the `if` directory and the loose `if` tests into `expr/if` and other similar cleanups of the `test/ui` directory. Future work: Test more than just `+=`, but all operators. I don't know if using a macro to generate these tests cases would be okay or not, but it'd be boilerplatey without it. I'm also confident you cannot change the evaluation order of one operator without changing all of them. Future work: Additionally, test more than just `i32 += i32` for the primitive version. I don't actually know the full set of primitive implementations, but I imagine there's enough to cause a combinatorial explosion with the previous future work item. Somewhere on the order of one to two hundred individual functions.
2020-11-22Auto merge of #78752 - jyn514:html-diff, r=GuillaumeGomezbors-10/+146
Give a better error when rustdoc tests fail - Run the default rustdoc against the current rustdoc - Diff output recursively - Colorize diff output Closes https://github.com/rust-lang/rust/issues/78750. ## Resolved questions - Should this be opt-in instead of on by default? + No - Should this call through to `delta`? That's not a very common program to have installed, but I'm not sure how to do diffs after the fact. Maybe `compiletest` can take a `--syntax-highlighter` parameter or something? + I decided to use `delta` if available and `diff --color` otherwise. It prints a warning if delta isn't installed so you know you can get nicer diffs ## Open questions. - What version of rustdoc would this compare against? Ideally it would compare against `$(git merge-base HEAD origin/master)` - maybe that's feasible if we install those artifacts from CI? - Does it always make sense to compare the tests? Especially for new tests, I'm not sure how useful it would be ... but then again, one of the questions I want to know most as a reviewer is 'did it break before?'. r? `@GuillaumeGomez` cc `@Mark-Simulacrum`
2020-11-22Fix UI testsWaffle-3/+5
Some UI tests started failing after moving iterator adapters to different modules.
2020-11-21Auto merge of #78461 - TimDiekmann:vec-alloc, r=Amanieubors-14/+17
Add support for custom allocators in `Vec` This follows the [roadmap](https://github.com/rust-lang/wg-allocators/issues/7) of the allocator WG to add custom allocators to collections. r? `@Amanieu` This pull request requires a crater run. ### Prior work: - #71873: Crater-test to solve rust-lang/wg-allocators#1 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
2020-11-21Rollup merge of #79272 - tmiasko:array-clone, r=jonas-schievinkDylan DPC-0/+13
Support building clone shims for arrays with generic size Fixes #79269.
2020-11-21Rollup merge of #79264 - jyn514:less-doctree, r=GuillaumeGomezDylan DPC-375/+182
Get rid of some doctree items They can be derived directly from the `hir::Item`, there's no special logic. - TypeDef - OpaqueTy - Constant - Static - TraitAlias - Enum - Union - Struct Part of #78082 (the easiest part, I'm still debugging some other changes). r? `@GuillaumeGomez`
2020-11-21Rollup merge of #79231 - wusyong:issue-79137, r=lcnrDylan DPC-0/+52
Exhaustively match in variant count instrinsic Fix #79137
2020-11-21Rollup merge of #79182 - lochsh:78777-fix-extern-types-ref, r=jyn514Dylan DPC-1/+26
Fix links to extern types in rustdoc (fixes #78777) r? `@jyn514` Fixes #78777. The initial fix we tried was: ```diff diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index 8be9482acff..c4b7086fdb1 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs `@@` -433,8 +433,9 `@@` impl<'a, 'tcx> LinkCollector<'a, 'tcx> { Res::PrimTy(prim) => Some( self.resolve_primitive_associated_item(prim, ns, module_id, item_name, item_str), ), - Res::Def(DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::TyAlias, did) => { + Res::Def(kind, did) if kind.ns() == Some(Namespace::TypeNS) => { debug!("looking for associated item named {} for item {:?}", item_name, did); + // Checks if item_name belongs to `impl SomeItem` let assoc_item = cx .tcx ``` However, this caused traits to be matched, resulting in a panic when `resolve_associated_trait_item` is called further down in this function. This PR also adds an error message for that panic. Currently it will look something like: ```rust thread 'rustc' panicked at 'Not a type: DefIndex(8624)', compiler/rustc_metadata/src/rmeta/decoder.rs:951:32 ``` I wasn't sure how to get a better debug output than `DefIndex(...)`, and am open to suggestions.
2020-11-21x.py test --blessJoshua Nelson-93/+93
2020-11-21Auto merge of #79115 - cuviper:rust-description, r=Mark-Simulacrumbors-1/+11
x.py: allow a custom string appended to the version This adds `rust.description` to the config as a descriptive string to be appended to `rustc --version` output, which is also used in places like debuginfo `DW_AT_producer`. This may be useful for supplementary build information, like distro-specific package versions. For example, in Fedora 33, `gcc --version` outputs: gcc (GCC) 10.2.1 20201016 (Red Hat 10.2.1-6) With this change, we can add similar vendor info to `rustc --version`.
2020-11-21Fix wrong names when inliningJoshua Nelson-12/+17
2020-11-21Add more tests for renamed itemsJoshua Nelson-0/+12
2020-11-21Get rid of some doctree itemsJoshua Nelson-281/+71
They can be derived directly from the `hir::Item`, there's no special logic. - TypeDef - OpaqueTy - Constant - Static - TraitAlias - Enum - Union - Struct
2020-11-21Auto merge of #77805 - JohnTitor:non-standard-char-sugg, r=Dylan-DPCbors-0/+56
lint: Do not provide suggestions for non standard characters Fixes #77273 Only provide suggestions if the case-fixed result is different than the original.
2020-11-21Auto merge of #79250 - RalfJung:miri, r=RalfJungbors-8/+8
update miri Fixes https://github.com/rust-lang/rust/issues/79226 Cc `@rust-lang/miri` r? `@ghost`
2020-11-21Auto merge of #79003 - petrochenkov:innertest, r=estebankbors-3/+20
rustc_expand: Mark inner `#![test]` attributes as soft-unstable Custom inner attributes are feature gated (https://github.com/rust-lang/rust/issues/54726) except for attributes having name `test` literally, which are not gated for historical reasons. `#![test]` is an inner proc macro attribute, so it has all the issues described in https://github.com/rust-lang/rust/issues/54726 too. This PR gates it with the `soft_unstable` lint.
2020-11-21Fix comments of toogeneris testNgo Iok Ui-5/+3
2020-11-20Move from bash to rustJoshua Nelson-40/+33
2020-11-21Improve integer range testsNadrieril-665/+907
2020-11-21Support building clone shims for arrays with generic sizeTomasz Miąsko-0/+13
2020-11-21update miriRalf Jung-8/+8
2020-11-20rustc_expand: Mark inner `#![test]` attributes as soft-unstableVadim Petrochenkov-3/+20
2020-11-20Auto merge of #78104 - ssomers:btree_root_redux, r=Mark-Simulacrumbors-35/+36
BTreeMap: replace Root with NodeRef<Owned, ...> `NodeRef<marker::Owned, …>` already exists as a representation of root nodes, and it makes more sense to alias `Root` to that than to reuse the space-efficient `BoxedNode` that is oblivious to height, where height is required. r? `@Mark-Simulacrum`
2020-11-20Exhaustively match in variant count instrinsicNgo Iok Ui-0/+54
2020-11-20Remove FIXME comment from incrementalDaiki Ihara-6/+6
2020-11-20Auto merge of #79192 - tmiasko:naked-noinline, r=oli-obkbors-0/+30
Never inline naked functions The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level. Closes #60919.
2020-11-20Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebankbors-141/+160
Add lint for panic!("{}") This adds a lint that warns about `panic!("{}")`. `panic!(msg)` invocations with a single argument use their argument as panic payload literally, without using it as a format string. The same holds for `assert!(expr, msg)`. This lints checks if `msg` is a string literal (after expansion), and warns in case it contained braces. It suggests to insert `"{}", ` to use the message literally, or to add arguments to use it as a format string. ![image](https://user-images.githubusercontent.com/783247/96643867-79eb1080-1328-11eb-8d4e-a5586837c70a.png) This lint is also a good starting point for adding warnings about `panic!(not_a_string)` later, once [`panic_any()`](https://github.com/rust-lang/rust/pull/74622) becomes a stable alternative.
2020-11-19Bump bootstrap compiler versionJake Goulding-1/+1
2020-11-20Never inline naked functionsTomasz Miąsko-0/+30
The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level.
2020-11-19Rollup merge of #79193 - tmiasko:revert-78969-normalize, r=davidtwcoDylan DPC-14/+8
Revert #78969 "Normalize function type during validation" Closes #79066. Reopens #78442.
2020-11-19Rollup merge of #79185 - petrochenkov:derattr2, r=Aaron1011Dylan DPC-267/+204
expand/resolve: Pre-requisites to "Turn `#[derive]` into a regular macro attribute" Miscellaneous refactorings and error reporting changes extracted from https://github.com/rust-lang/rust/pull/79078. Unlike https://github.com/rust-lang/rust/pull/79078 this PR doesn't make any observable changes to the language or library. r? ```@Aaron1011```
2020-11-19Rollup merge of #79183 - cuviper:compiletest-test-sysroot, r=Mark-SimulacrumDylan DPC-1/+4
Make compiletest testing use the local sysroot We already set `compiletest` to use the local sysroot in #68019, but that missed the configuration for testing `compiletest` itself.
2020-11-19Rollup merge of #79181 - aDotInTheVoid:provided-method-source-link, ↵Dylan DPC-42/+55
r=jyn514,GuillaumeGomez rustdoc: add [src] links to methods on a trait's page Closes #45150 ![image](https://user-images.githubusercontent.com/28781354/99565541-aba4d500-29c3-11eb-99c7-11c1f91584e9.png) ### Caveats - The way I've implemented it, links are also provided for required methods, that just link to the signature in the code. I'm not sure if this is the desired behaviour. ![image](https://user-images.githubusercontent.com/28781354/99566222-849ad300-29c4-11eb-9897-08cc5842954f.png) - I'm not sure if the css changes are correct. I inspected them visualy on firefox on desktop, and they seem to be fine. - I can't tell how `src/librustdoc/html/render/mod.rs` is structured, so I probably
2020-11-19Rollup merge of #79177 - fanzier:drop-order-test, r=RalfJungDylan DPC-0/+44
Test drop order for (destructuring) assignments Add a test that checks whether the drop order of `let` bindings is consistent with the drop order of the corresponding destructuring assignments. Thanks to ```@RalfJung``` for the suggesting this test ([here](https://github.com/rust-lang/rust/pull/79016#issuecomment-727608732)) and an implementation! r? ```@RalfJung```
2020-11-19Regroup many usefulness-related test in the same folderNadrieril-0/+0
2020-11-19Clippy: Match on assert!() expansions without an inner block.Mara Bos-2/+5
2020-11-19Remove the clippy::panic-params lint.Mara Bos-134/+4
Rustc itself now warns for all cases that triggered this lint.
2020-11-19Auto merge of #79200 - Dylan-DPC:rollup-su689pq, r=Dylan-DPCbors-575/+370
Rollup of 14 pull requests Successful merges: - #78961 (Make bad "rust-call" arguments no longer ICE) - #79082 (Improve the diagnostic for when an `fn` contains qualifiers inside an `extern` block.) - #79090 (libary: Forward compiler-builtins "asm" and "mangled-names" feature) - #79094 (Add //ignore-macos to pretty-std-collections.rs) - #79101 (Don't special case constant operands when lowering intrinsics) - #79102 (Add two regression tests) - #79110 (Remove redundant notes in E0275) - #79116 (compiletest: Fix a warning in debuginfo tests on windows-gnu) - #79117 (add optimization fuel checks to some mir passes) - #79147 (Highlight MIR as Rust on GitHub) - #79149 (Move capture lowering from THIR to MIR) - #79155 (fix handling the default config for profiler and sanitizers) - #79156 (Allow using `download-ci-llvm` from directories other than the root) - #79164 (Permit standalone generic parameters as const generic arguments in macros) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-11-19expand: Stop derive expansion un unexpected targets earlyVadim Petrochenkov-63/+6
Collect derive placeholders using `collect` instead of `push`
2020-11-19resolve: Centralize some error reporting for unexpected macro resolutionsVadim Petrochenkov-196/+196