about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2020-10-14Auto merge of #77741 - JohnTitor:add-tests, r=matthewjasperbors-0/+225
Add some regression tests They're fixed since nightly-2020-10-07: Closes #52843 Closes #53448 Closes #54108 Closes #65581 Closes #65934 Closes #70292 Closes #71443
2020-10-14Auto merge of #77926 - Dylan-DPC:rollup-wttr8a1, r=Dylan-DPCbors-37/+37
Rollup of 8 pull requests Successful merges: - #77765 (Add LLVM flags to limit DWARF version to 2 on BSD) - #77788 (BTreeMap: fix gdb provider on BTreeMap with ZST keys or values) - #77795 (Codegen backend interface refactor) - #77808 (Moved the main `impl` for FnCtxt to its own file.) - #77817 (Switch rustdoc from `clean::Stability` to `rustc_attr::Stability`) - #77829 (bootstrap: only use compiler-builtins-c if they exist) - #77870 (Use intra-doc links for links to module-level docs) - #77897 (Move `Strip` into a separate rustdoc pass) Failed merges: - #77879 (Provide better documentation and help messages for x.py setup) - #77902 (Include aarch64-pc-windows-msvc in the dist manifests) r? `@ghost`
2020-10-14Rollup merge of #77795 - bjorn3:codegen_backend_interface_refactor, r=oli-obkDylan DPC-32/+26
Codegen backend interface refactor This moves several things away from the codegen backend to rustc_interface. There are a few behavioral changes where previously the incremental cache (incorrectly) wouldn't get finalized, but now it does. See the individual commit messages.
2020-10-14Rollup merge of #77788 - ssomers:btree_cleanup_gdb, r=Mark-SimulacrumDylan DPC-5/+11
BTreeMap: fix gdb provider on BTreeMap with ZST keys or values Avoid error when gdb is asked to inspect a BTreeMap or BTreeSet with a zero-sized type as key or value. And clean up. r? @Mark-Simulacrum
2020-10-14Auto merge of #77135 - Aaron1011:pretty-ignore-paren, r=petrochenkovbors-0/+220
Refactor AST pretty-printing to allow skipping insertion of extra parens Fixes #75734 Makes progress towards #43081 Unblocks PR #76130 When pretty-printing an AST node, we may insert additional parenthesis to ensure that precedence is properly preserved in code we output. However, the proc macro implementation relies on comparing a pretty-printed AST node to the captured `TokenStream`. Inserting extra parenthesis changes the structure of the reparsed `TokenStream`, making the comparison fail. This PR refactors the AST pretty-printing code to allow skipping the insertion of additional parenthesis. Several freestanding methods are moved to trait methods on `PrintState`, which keep track of an internal `insert_extra_parens` flag. This flag is normally `true`, but we expose a public method which allows pretty-printing a nonterminal with `insert_extra_parens = false`. To avoid changing the public interface of `rustc_ast_pretty`, the freestanding `_to_string` methods are changed to delegate to a newly-crated `State`. The main pretty-printing code is moved to a new `state` module to ensure that it does not accidentally call any of these public helper functions (instead, the internal functions with the same name should be used).
2020-10-13Auto merge of #77917 - JohnTitor:rollup-e47h2qt, r=JohnTitorbors-177/+177
Rollup of 14 pull requests Successful merges: - #77239 (Enable building Cargo for aarch64-apple-darwin) - #77569 (BTreeMap: type-specific variants of node_as_mut and cast_unchecked) - #77719 (Remove unnecessary rustc_const_stable attributes.) - #77722 (Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).) - #77725 (Add regression issue template) - #77776 ( Give an error when running `x.py test --stage 0 src/test/ui`) - #77786 (Mention rustdoc in `x.py setup`) - #77825 (`min_const_generics` diagnostics improvements) - #77868 (Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component) - #77884 (Use Option::unwrap_or instead of open-coding it) - #77886 (Replace trivial bool matches with the `matches!` macro) - #77892 (Replace absolute paths with relative ones) - #77895 (Include aarch64-apple-darwin in the dist manifests) - #77909 (bootstrap: set correct path for the build-manifest binary) Failed merges: - #77902 (Include aarch64-pc-windows-msvc in the dist manifests) r? `@ghost`
2020-10-14Rollup merge of #77825 - ethanboxx:min_const_generics_diagnostic, r=lcnrYuki Okushi-177/+177
`min_const_generics` diagnostics improvements As disscussed in [zulip/project-const-generics/non-trivial anonymous constant](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/non-trivial.20anonymous.20constants). This is my first PR on the compiler. @lcnr is mentoring me on this PR. Related to #60551.
2020-10-14switch the test to an actual MCVEDing Xiang Fei-14/+9
2020-10-14rustfmtDing Xiang Fei-1/+1
2020-10-14test derived from #74961Ding Xiang Fei-0/+29
2020-10-13Auto merge of #76196 - r-52:r-coverage-allow-missing-docs, r=jyn514bors-0/+68
rustdoc: skip #[allow(missing docs)] for docs in coverage report During the document coverage reporting with: ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report counts code that is marked with `#[allow(missing_docs)]` for the calculation, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Right now I'm not sure how this can be tested (CI)? (I verified it by hand and ran the unit tests) r? `@jyn514` **Reference:** Fixes #76121
2020-10-13Auto merge of #76830 - Artoria2e5:tune, r=nagisabors-0/+21
Pass tune-cpu to LLVM I think this is how it should work... See https://internals.rust-lang.org/t/expose-tune-cpu-from-llvm/13088 for the background. Or the documentation diff.
2020-10-12Bless expected errorsEthan Brierley-132/+132
2020-10-12Extend test to ensure that items inherit lint level from the parentGuillaume Gomez-0/+2
2020-10-12Apply same treatment to MISSING_DOC_CODE_EXAMPLESGuillaume Gomez-0/+20
2020-10-12Inherit lint level from parentsGuillaume Gomez-2/+10
2020-10-12rustdoc: skip allow missing doc in cover. reportRoman-0/+38
During the document coverage reporting with ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report also includes parts of the code that are marked with `#[allow(missing_docs)]`, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-12Auto merge of #75956 - jonas-schievink:lto-opt-sz, r=tmiaskobors-0/+14
Fix -Clinker-plugin-lto with opt-levels s and z Pass s and z as `-plugin-opt=O2` to the linker. This is what `-Os` and `-Oz` correspond to, apparently. Fixes https://github.com/rust-lang/rust/issues/75940
2020-10-12Auto merge of #77790 - jyn514:undivided, r=ollie27bors-2/+23
Show summary lines on cross-crate re-exports See my write-up in https://github.com/rust-lang/rust/issues/77783#issuecomment-706551743 for what's going on here. Fixes https://github.com/rust-lang/rust/issues/77783 r? `@ollie27`
2020-10-11Show summary lines on cross-crate re-exportsJoshua Nelson-2/+23
This removes the unnecessary `DocFragmentKind::Divider` in favor of just using the logic I actually want in `collapse_docs`.
2020-10-12Use no-prefer-dynamicJonas Schievink-0/+2
2020-10-12Fix -Clinker-plugin-lto with opt-levels s and zJonas Schievink-0/+12
2020-10-11Auto merge of #76859 - Aaron1011:fix/llvm-cgu-reuse, r=davidtwco,nikicbors-2/+53
Use llvm::computeLTOCacheKey to determine post-ThinLTO CGU reuse During incremental ThinLTO compilation, we attempt to re-use the optimized (post-ThinLTO) bitcode file for a module if it is 'safe' to do so. Up until now, 'safe' has meant that the set of modules that our current modules imports from/exports to is unchanged from the previous compilation session. See PR #67020 and PR #71131 for more details. However, this turns out be insufficient to guarantee that it's safe to reuse the post-LTO module (i.e. that optimizing the pre-LTO module would produce the same result). When LLVM optimizes a module during ThinLTO, it may look at other information from the 'module index', such as whether a (non-imported!) global variable is used. If this information changes between compilation runs, we may end up re-using an optimized module that (for example) had dead-code elimination run on a function that is now used by another module. Fortunately, LLVM implements its own ThinLTO module cache, which is used when ThinLTO is performed by a linker plugin (e.g. when clang is used to compile a C proect). Using this cache directly would require extensive refactoring of our code - but fortunately for us, LLVM provides a function that does exactly what we need. The function `llvm::computeLTOCacheKey` is used to compute a SHA-1 hash from all data that might influence the result of ThinLTO on a module. In addition to the module imports/exports that we manually track, it also hashes information about global variables (e.g. their liveness) which might be used during optimization. By using this function, we shouldn't have to worry about new LLVM passes breaking our module re-use behavior. In LLVM, the output of this function forms part of the filename used to store the post-ThinLTO module. To keep our current filename structure intact, this PR just writes out the mapping 'CGU name -> Hash' to a file. To determine if a post-LTO module should be reused, we compare hashes from the previous session. This should unblock PR #75199 - by sheer chance, it seems to have hit this issue due to the particular CGU partitioning and optimization decisions that end up getting made.
2020-10-11`min_const_generics` diagnostics improvementsEthan Brierley-174/+174
2 3
2020-10-11Add hack to keep `actix-web` and `actori-web` compilingAaron Hill-0/+60
This extends the existing `ident_name_compatibility_hack` to handle the `tuple_from_req` macro defined in `actix-web` (and its fork `actori-web`).
2020-10-11Allow skipping extra paren insertion during AST pretty-printingAaron Hill-0/+160
Fixes #74616 Makes progress towards #43081 Unblocks PR #76130 When pretty-printing an AST node, we may insert additional parenthesis to ensure that precedence is properly preserved in code we output. However, the proc macro implementation relies on comparing a pretty-printed AST node to the captured `TokenStream`. Inserting extra parenthesis changes the structure of the reparsed `TokenStream`, making the comparison fail. This PR refactors the AST pretty-printing code to allow skipping the insertion of additional parenthesis. Several freestanding methods are moved to trait methods on `PrintState`, which keep track of an internal `insert_extra_parens` flag. This flag is normally `true`, but we expose a public method which allows pretty-printing a nonterminal with `insert_extra_parens = false`. To avoid changing the public interface of `rustc_ast_pretty`, the freestanding `_to_string` methods are changed to delegate to a newly-crated `State`. The main pretty-printing code is moved to a new `state` module to ensure that it does not accidentally call any of these public helper functions (instead, the internal functions with the same name should be used).
2020-10-10Fix hotplug_codegen_backend testbjorn3-32/+26
2020-10-10Re-enable test caseDániel Buga-2/+1
2020-10-10Apply suggestions from code reviewDániel Buga-1/+20
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-11Auto merge of #77774 - petrochenkov:floatuple, r=estebankbors-12/+12
rustc_parse: More precise spans for `tuple.0.0` This should help with https://github.com/rust-lang/rustfmt/issues/4355, but I haven't verified, cc `@calebcartwright.`
2020-10-11Auto merge of #77649 - dash2507:replace_run_compiler, r=matthewjasperbors-8/+3
Replace run_compiler with RunCompiler builder pattern Fixes #77286. Replaces rustc_driver:run_compiler with RunCompiler builder pattern.
2020-10-11rustc_parse: More precise spans for `tuple.0.0`Vadim Petrochenkov-12/+12
2020-10-10Auto merge of #77087 - estebank:issue-45817, r=matthewjasperbors-8/+292
Provide structured suggestions when finding structs when expecting a trait When finding an ADT in a trait object definition provide some solutions. Fix #45817. Given `<Param as Trait>::Assoc: Ty` suggest `Param: Trait<Assoc = Ty>`. Fix #75829.
2020-10-10Auto merge of #76934 - camelid:rustdoc-allow-generic-params, r=jyn514bors-1/+181
Allow generic parameters in intra-doc links Fixes #62834. --- The contents of the generics will be mostly ignored (except for warning if fully-qualified syntax is used, which is currently unsupported in intra-doc links - see issue #74563). * Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>` * Allow links like `Vec::<T>::new()` * Warn on * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`) * Missing type to apply generics to (`<T>` or `<Box<T>>`) * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`) * Invalid path separator (`Vec:<T>:new`) * Too many angle brackets (`Vec<<T>>`) * Empty angle brackets (`Vec<>`) Note that this implementation *does* allow some constructs that aren't valid in the actual Rust syntax, for example `Box::<T>new()`. That may not be supported in rustdoc in the future; it is an implementation detail.
2020-10-10Auto merge of #77337 - lzutao:asm-mips64, r=Amanieubors-54/+100
Add asm! support for mips64 - [x] Updated `src/doc/unstable-book/src/library-features/asm.md`. - [ ] No vector type support. I don't know much about those types. cc #76839
2020-10-10Auto merge of #77771 - nagisa:revert-77023, r=Mark-Simulacrumbors-24/+0
Revert "Assume slice len is bounded by allocation size" https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379 suggests that the original PR introduced a significant perf regression. This reverts commit e44784b8750016a695361c990024750e037d8f9f / #77023. cc `@HeroicKatora`
2020-10-10BTreeMap: fix gdb introspection of BTreeMap with ZST keys or valuesStein Somers-5/+11
2020-10-09address review commentsEsteban Küber-1/+71
2020-10-09Move `@has` checks closer to corresponding doc commentsCamelid-15/+19
2020-10-10Revert "Assume slice len is bounded by allocation size"Simonas Kazlauskas-24/+0
https://github.com/rust-lang/rust/pull/77023#issuecomment-703987379 suggests that the original PR introduced a significant perf regression. This reverts commit e44784b8750016a695361c990024750e037d8f9f / #77023.
2020-10-09Given `<T as Trait>::A: Ty` suggest `T: Trait<A = Ty>`Esteban Küber-0/+32
Fix #75829
2020-10-09Suggest removing bounds even when potential typoEsteban Küber-1/+17
2020-10-09Tweak output and add test casesEsteban Küber-11/+171
2020-10-09Point out why a trait is expected on `Struct + 'lt`Esteban Küber-0/+6
2020-10-09Remove unneeded ImportItem on glob onesGuillaume Gomez-15/+2
2020-10-09Simplify included import items handlingGuillaume Gomez-0/+11
2020-10-09Add test to ensure that external items aren't lint-checkedGuillaume Gomez-2/+14
2020-10-09Add test for reexported items lintsGuillaume Gomez-0/+31
2020-10-09Add a regression test for issue-71443Yuki Okushi-0/+31
2020-10-09Add a regression test for issue-70292Yuki Okushi-0/+21