about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-03-22add key rustc_private for package metadata for rust-analyzer in librustdocNelson J Morais-0/+3
2021-03-22Update the minimum external LLVM to 10Josh Stone-9/+7
2021-03-22:arrow_up: rust-analyzerLaurențiu Nicola-15/+15
2021-03-22rename :pat2018 -> :pat215mark-6/+6
2021-03-22Rollup merge of #83338 - asquared31415:asm-syntax-test-fix, r=Dylan-DPCDylan DPC-8/+9
Fix test for #82270 Fixes a test in #82270 to require the arm llvm component
2021-03-22Auto merge of #82855 - jyn514:no-temporaries, r=GuillaumeGomezbors-18/+30
Avoid temporary allocations in `render_assoc_item` `render_assoc_item` came up as very hot in a profile of rustdoc on `bevy`. This avoids some temporary allocations just to calculate the length of the header. This should be a strict improvement, since all string formatting was done twice before. cc #82845
2021-03-222229 migration: Don't try resolve regions before writebackAman Arora-0/+25
In the analysis use `resolve_vars_if_possible` instead of `fully_resolve`, because we might not have performed regionck yet. Fixes: #83176
2021-03-22Auto merge of #83360 - Dylan-DPC:rollup-17xulpv, r=Dylan-DPCbors-0/+37
Rollup of 9 pull requests Successful merges: - #80193 (stabilize `feature(osstring_ascii)`) - #80771 (Make NonNull::as_ref (and friends) return refs with unbound lifetimes) - #81607 (Implement TrustedLen and TrustedRandomAccess for Range<integer>, array::IntoIter, VecDequeue's iterators) - #82554 (Fix invalid slice access in String::retain) - #82686 (Move `std::sys::unix::platform` to `std::sys::unix::ext`) - #82771 (slice: Stabilize IterMut::as_slice.) - #83329 (Cleanup LLVM debuginfo module docs) - #83336 (Fix ICE with `use clippy::a::b;`) - #83350 (Download a more recent LLVM version if `src/version` is modified) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-21Update testsCamelid-2/+2
These tests were added to master after I made my changes.
2021-03-21Remove redundant docsCamelid-5/+7
...and add docs to the types instead of the fields that hold the types.
2021-03-21Bump rustdoc-json format versionCamelid-1/+1
The rustdoc-json-types renames are breaking changes.
2021-03-21rustdoc-json: Rename `Import.span` to `Import.source`Camelid-5/+5
* It is called `source` in rustc and the rest of rustdoc * It is not a span, rather it is the source of the import
2021-03-21Rename `rustdoc_json_types::Item.source` to `span`Camelid-3/+3
2021-03-21Rename `clean::Span::span()` to `clean::Span::inner()`Camelid-13/+13
Otherwise you get a lot of instances of `item.span.span()`, which is just plain confusing. `item.span.inner()` conveys the correct meaning of "get the type that `clean::Span` wraps".
2021-03-21Rename `clean::Item.source` to `span`Camelid-34/+38
Its type is called `clean::Span`, and also the name in the rest of rustdoc and rustc for this kind of field is `span`.
2021-03-22Rollup merge of #83350 - jyn514:llvm-version, r=Mark-SimulacrumDylan DPC-0/+2
Download a more recent LLVM version if `src/version` is modified When bumping the bootstrap version, the name of the generated LLVM shared object file is changed, even though it's the same contents as before. If bootstrap tries to use an older version, it will get linking errors: ``` Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc) error: linking with `cc` failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" ... lots of args ... = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly clang: error: linker command failed with exit code 1 (use -v to see invocation) error: could not compile `rustdoc-tool` ``` Helps with https://github.com/rust-lang/rust/issues/81930.
2021-03-22Rollup merge of #83336 - camelid:tool-mod-ice, r=petrochenkovDylan DPC-0/+35
Fix ICE with `use clippy::a::b;` Fixes #83317.
2021-03-22Auto merge of #79846 - the8472:inplace-tra, r=m-ou-sebors-0/+14
Use TrustedRandomAccess for in-place iterators where possible This can speed up in-place iterators containing simple casts and transmutes from `Copy` types to any type of same size. `!Copy` types can't be optimized since `TrustedRandomAccess` isn't implemented for those iterators. ``` name on.b ns/iter o1.b ns/iter diff ns/iter diff % speedup vec::bench_transmute 20 (40000 MB/s) 12 (66666 MB/s) -8 -40.00% x 1.67 ```
2021-03-21disable debug assertions in codegen testThe8472-0/+1
2021-03-21rustdoc: Replace pair of `Option`s with an enumCamelid-8/+11
They are never both `None` or both `Some`, so it makes more sense to use an enum so that we "make impossible states impossible".
2021-03-21Fix ICE with `use clippy::a::b;`Camelid-0/+35
2021-03-21Update doc/reference submoduleNikita Popov-0/+0
In particular this pulls in an update to the auto-deref recursion_limit example, to no longer rely on the Freeze query.
2021-03-21Don't compute optimized PointerKind for unoptimized buildsNikita Popov-3/+3
This saves us both the Freeze/Unpin queries, and avoids placing noalias attributes, which have a compile-time impact on LLVM even in optnone builds (due to always_inline functions).
2021-03-21add codegen testThe8472-0/+13
2021-03-21Enable mutable noalias by default for LLVM 12Nikita Popov-3/+3
We don't have any known noalias bugs for LLVM 12 ... yet.
2021-03-21Don't consider !Unpin references as noaliasNikita Popov-0/+15
Such structures may contain self-references, in which case the same location may be accessible through a pointer that is not based-on the noalias pointer. This is still grey area as far as language semantics are concerned, but checking for !Unpin as an indicator for self-referential sturctures seems like a good approach for the meantime.
2021-03-21Download a more recent LLVM version if `src/version` is modifiedJoshua Nelson-0/+2
When bumping the bootstrap version, the name of the generated LLVM shared object file is changed, even though it's the same contents as before. If bootstrap tries to use an older version, it will get linking errors: ``` Building rustdoc for stage1 (x86_64-unknown-linux-gnu) Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc) error: linking with `cc` failed: exit code: 1 | = note: "cc" "-Wl,--as-needed" ... lots of args ... = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly clang: error: linker command failed with exit code 1 (use -v to see invocation) error: could not compile `rustdoc-tool` ```
2021-03-21Auto merge of #83339 - Aaron1011:deep-recollect, r=petrochenkovbors-1/+34
Perform 'deep recollection' in test helper macros Currently, the print helper macro performs 'recollection' by doing `token_stream.into_iter().collect()`. However, this will not affect nonterminals that occur nested inside delimited groups, since the wrapping delimited group will be left untouched. This commit adds 'deep recollection', which recursively recollects every delimited group in the token stream. As with normal recollection, we only print out something if deep recollection results in a different stringified token stream. This is useful for catching bugs where we update the AST of a nonterminal (which affects pretty-printing), but do not update the attatched `TokenStream`
2021-03-21Simplify and fix byte skipping in format! string parserÖmer Sinan Ağacan-0/+16
Fixes '\\' handling in format strings. Fixes #83340
2021-03-21Perform 'deep recollection' in test helper macrosAaron Hill-1/+34
Currently, the print helper macro performs 'recollection' by doing `token_stream.into_iter().collect()`. However, this will not affect nonterminals that occur nested inside delimited groups, since the wrapping delimited group will be left untouched. This commit adds 'deep recollection', which recursively recollects every delimited group in the token stream. As with normal recollection, we only print out something if deep recollection results in a different stringified token stream. This is useful for catching bugs where we update the AST of a nonterminal (which affects pretty-printing), but do not update the attatched `TokenStream`
2021-03-20add arm llvm requirementasquared31415-8/+9
2021-03-21Auto merge of #83333 - Dylan-DPC:rollup-0rdt6sz, r=Dylan-DPCbors-94/+161
Rollup of 6 pull requests Successful merges: - #82707 (const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`) - #83040 (extract `ConstKind::Unevaluated` into a struct) - #83280 (Fix pluralization in keyword docs) - #83289 (Move some tests to more reasonable directories - 5) - #83306 (Extend `proc_macro_back_compat` lint to `js-sys`) - #83327 (Extend comment in `UsedLocals::visit_lhs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-21Rollup merge of #83306 - Aaron1011:js-sys-lint, r=petrochenkovDylan DPC-12/+60
Extend `proc_macro_back_compat` lint to `js-sys` With this PR, we now lint for all cases where we perform some kind of proc-macro back-compat hack. The `js-sys` had an internal fix made to properly handle `None`-delimited groups, so we need to manually check the version in the filename. As a result, we no longer apply the back-compat hack to cases where the version number is missing file the file path. This should not affect any users of the `crates.io` crate.
2021-03-21Rollup merge of #83289 - c410-f3r:tests-tests-tests, r=petrochenkovDylan DPC-2/+2
Move some tests to more reasonable directories - 5 cc #73494 Threshold is 0.95. Next time I promise I will take a look into the special/misclassified directories. - [issues/issue-23208.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-23208.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/23208)</sup>: associated-types 0.951 - [weird-exprs.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/weird-exprs.rs) <sup>unknown</sup>: destructuring-assignment 0.958 - [issues/issue-1701.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-1701.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/1701)</sup>: structs-enums 0.974 - [issues/issue-48508-aux.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-48508-aux.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/48508)</sup>: numbers-arithmetic 0.991 - [fn_must_use.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/fn_must_use.rs) <sup>unknown</sup>: lint 1.000 - [mir_check_nonconst.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/mir_check_nonconst.rs) <sup>unknown</sup>: consts 1.002 - [issues/issue-52060.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52060.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52060)</sup>: consts 1.017 - [issues/issue-45729-unsafe-in-generator.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-45729-unsafe-in-generator.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/45729)</sup>: generator 1.024 - [issues/issue-10392.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10392.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/10392)</sup>: pattern 1.039 - [no-implicit-prelude.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/no-implicit-prelude.rs) <sup>unknown</sup>: resolve 1.071 - [issues/issue-68000-unicode-ident-after-missing-comma.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/68000)</sup>: parser 1.079 - [shadow.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/shadow.rs) <sup>unknown</sup>: binding 1.099 - [issues/issue-65611.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-65611.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/65611)</sup>: consts 1.139 - [concat-rpass.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/concat-rpass.rs) <sup>unknown</sup>: macros 1.194 - [issues/issue-31597.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-31597.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/31597)</sup>: associated-types 1.195 - [issues/issue-78372.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-78372.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/78372)</sup>: resolve 1.426 - [impl-trait-in-bindings-issue-73003.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-trait-in-bindings-issue-73003.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/73003)</sup>: impl-trait 1.471 - [impl-trait-in-bindings.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-trait-in-bindings.rs) <sup>unknown</sup>: impl-trait 2.500 r? `@petrochenkov`
2021-03-21Rollup merge of #83040 - lcnr:unused-ct-substs, r=oli-obkDylan DPC-49/+59
extract `ConstKind::Unevaluated` into a struct r? `@oli-obk`
2021-03-21Rollup merge of #82707 - BoxyUwU:errooaaar, r=oli-obkDylan DPC-31/+40
const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable` Fixes #82279 We don't want to be emitting errors inside of is_const_evaluatable because we may call this during selection where it should be able to fail silently There were two errors being emitted in `is_const_evaluatable`. The one causing the compile error in #82279 was inside the match arm for `FailureKind::MentionsParam` but I moved the other error being emitted too since it made things cleaner imo The `NotConstEvaluatable` enum \*should\* have a fourth variant for when we fail to evaluate a concrete const, e.g. `0 - 1` but that cant happen until #81339 cc `@oli-obk` `@lcnr` r? `@nikomatsakis`
2021-03-20Join test thread to make assertion effective in sym.rs test caseTomasz Miąsko-1/+1
2021-03-20Use a single codegen unit to reduce non-determinism in srcloc.rs testTomasz Miąsko-1/+1
When building with multiple codegen units the test case can fail with only a subset of all errors. Use a single codegen unit as a workaround.
2021-03-20bless mir-opt testslcnr-44/+44
2021-03-20update `const_eval_resolve`lcnr-5/+15
2021-03-20Bump to 1.53.0Mark Rousskov-1/+1
2021-03-20Move some tests to more reasonable directories - 5Caio-2/+2
2021-03-20Auto merge of #83271 - SparrowLii:simd_neg, r=Amanieubors-15/+36
Add simd_neg platform intrinsic Stdarch needs to add simd_neg to support the implementation of vneg neon instructions. Look [here](https://github.com/rust-lang/stdarch/pull/1087)
2021-03-19update testsmark-652/+320
2021-03-19librustdoc: or_patterns are stablemark-1/+1
2021-03-19remove unstable book chaptermark-36/+0
2021-03-19clippy: stabilize or_patterns lintmark-50/+33
2021-03-19coverage bug fixes and optimization supportRich Kadel-133/+2609
Adjusted LLVM codegen for code compiled with `-Zinstrument-coverage` to address multiple, somewhat related issues. Fixed a significant flaw in prior coverage solution: Every counter generated a new counter variable, but there should have only been one counter variable per function. This appears to have bloated .profraw files significantly. (For a small program, it increased the size by about 40%. I have not tested large programs, but there is anecdotal evidence that profraw files were way too large. This is a good fix, regardless, but hopefully it also addresses related issues. Fixes: #82144 Invalid LLVM coverage data produced when compiled with -C opt-level=1 Existing tests now work up to at least `opt-level=3`. This required a detailed analysis of the LLVM IR, comparisons with Clang C++ LLVM IR when compiled with coverage, and a lot of trial and error with codegen adjustments. The biggest hurdle was figuring out how to continue to support coverage results for unused functions and generics. Rust's coverage results have three advantages over Clang's coverage results: 1. Rust's coverage map does not include any overlapping code regions, making coverage counting unambiguous. 2. Rust generates coverage results (showing zero counts) for all unused functions, including generics. (Clang does not generate coverage for uninstantiated template functions.) 3. Rust's unused functions produce minimal stubbed functions in LLVM IR, sufficient for including in the coverage results; while Clang must generate the complete LLVM IR for each unused function, even though it will never be called. This PR removes the previous hack of attempting to inject coverage into some other existing function instance, and generates dedicated instances for each unused function. This change, and a few other adjustments (similar to what is required for `-C link-dead-code`, but with lower impact), makes it possible to support LLVM optimizations. Fixes: #79651 Coverage report: "Unexecuted instantiation:..." for a generic function from multiple crates Fixed by removing the aforementioned hack. Some "Unexecuted instantiation" notices are unavoidable, as explained in the `used_crate.rs` test, but `-Zinstrument-coverage` has new options to back off support for either unused generics, or all unused functions, which avoids the notice, at the cost of less coverage of unused functions. Fixes: #82875 Invalid LLVM coverage data produced with crate brotli_decompressor Fixed by disabling the LLVM function attribute that forces inlining, if `-Z instrument-coverage` is enabled. This attribute is applied to Rust functions with `#[inline(always)], and in some cases, the forced inlining breaks coverage instrumentation and reports.
2021-03-19Auto merge of #83308 - Dylan-DPC:rollup-p2j6sy8, r=Dylan-DPCbors-14/+89
Rollup of 8 pull requests Successful merges: - #79986 (Only build help popup when it's really needed) - #82570 (Add `as_str` method for split whitespace str iterators) - #83244 (Fix overflowing length in Vec<ZST> to VecDeque) - #83254 (Include output stream in `panic!()` documentation) - #83269 (Revert the second deprecation of collections::Bound) - #83277 (Mark early otherwise optimization unsound) - #83285 (Update LLVM to bring in SIMD updates for WebAssembly) - #83297 (Do not ICE on ty::Error as an error must already have been reported) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-03-19Rollup merge of #83297 - oli-obk:why_bug_today_if_you_can_delay_to_tomorrow, ↵Dylan DPC-0/+67
r=petrochenkov Do not ICE on ty::Error as an error must already have been reported fixes #83253