about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-01-04Keep an unoptimized duplicate of `const fn` aroundoli-90/+122
This allows CTFE to reliably detect UB, as otherwise optimizations may hide UB.
2021-01-04Stop optimizing promotedsoli-62/+62
2021-01-04Auto merge of #80688 - ehuss:update-mdbook, r=pietroalbinibors-1/+1
[security] Update mdbook Changelog from 0.4.3 to 0.4.5: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-045
2021-01-04Update mdbookEric Huss-1/+1
2021-01-04Auto merge of #80651 - GroteGnoom:issue-78123-fix, r=Nadrierilbors-0/+29
Add note to non-exhaustive match on reference to empty Rust prints "type `&A` is non-empty" even is A is empty. This is the intended behavior, but can be confusing. This commit adds a note to non-exhaustive pattern errors if they are a reference to something uninhabited. I did not add tests to check that the note is not shown for non-references or inhabited references, because this is already done in other tests. Maybe the added test is superfluous, because `always-inhabited-union-ref` already checks for this case. This does not handle &&Void or &&&void etc. I could add those as special cases as well and ignore people who need quadruple references. Fixes #78123
2021-01-04Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomezbors-31/+53
Cleanup rustdoc handling of associated types This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested. r? `@GuillaumeGomez`
2021-01-04Auto merge of #80554 - GuillaumeGomez:more-js-cleanup, r=jyn514bors-18/+12
More js cleanup Part of #79052 (Same kind as #80515). This one is about some small fixes: * Replacing some loops with `onEachLazy`. * Removing unused function arguments. * Turn `buildHelperPopup` into a variable so it can be "replaced" once the function has been called once so it's not called again. r? `@jyn514`
2021-01-04Auto merge of #80418 - oli-obk:this_could_have_been_so_simple, r=RalfJungbors-55/+126
Allow references to interior mutable data behind a feature gate supercedes #80373 by simply not checking for interior mutability on borrows of locals that have `StorageDead` and thus can never be leaked to the final value of the constant tracking issue: https://github.com/rust-lang/rust/issues/80384 r? `@RalfJung`
2021-01-03Don't clone `type_` unnecessarilyJoshua Nelson-8/+24
2021-01-03Simplify rustdoc handling of type aliases for associated typesJoshua Nelson-31/+37
The logic was very hard to follow before.
2021-01-03Auto merge of #77859 - bugadani:no-duplicate-ref-link-error, r=jyn514bors-67/+175
Rustdoc: only report broken ref-style links once This PR assigns the markdown `LinkType` to each parsed link and passes this information into the link collector. If a link can't be resolved in `resolve_with_disambiguator`, the failure is cached for the link types where we only want to report the error once (namely `Shortcut` and `Reference`). Fixes #77681
2021-01-03Add notes to stderr of non-exhaustive-reference testDaniel Noom-2/+6
2021-01-03Add note on void reference testDaniel Noom-0/+1
This test is also changed by adding a note about uninhabited references still counting as inhabited.
2021-01-03Add note to non-exhaustive match on reference to emptyDaniel Noom-0/+24
Rust prints "type `&A` is non-empty" even is A is empty. This is the intended behavior, but can be confusing. This commit adds a note to non-exhaustive pattern errors if they are a reference to something uninhabited. I did not add tests to check that the note is not shown for non-references or inhabited references, because this is already done in other tests. Maybe the added test is superfluous, because `always-inhabited-union-ref` already checks for this case. This does not handle &&Void or &&&void etc. I could add those as special cases as well and ignore people who need quadruple references. Fixes #78123
2021-01-03Only report reference-style link errors onceDániel Buga-67/+175
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-03Rollup merge of #80628 - matthiaskrgr:match_ref_pats, r=varkorGuillaume Gomez-4/+4
reduce borrowing and (de)referencing around match patterns (clippy::match_ref_pats)
2021-01-03Rollup merge of #80617 - ↵Guillaume Gomez-1/+11
GuillaumeGomez:detect-invalid-rustdoc-test-commands, r=jyn514 Detect invalid rustdoc test commands Fixes #80570. There are now errors displayed in case of bad command syntax: ``` ---- [rustdoc] rustdoc/remove-url-from-headings.rs stdout ---- error: htmldocck failed! status: exit code: 1 command: "/usr/bin/python" "/home/imperio/rust/rust/src/etc/htmldocck.py" "/home/imperio/rust/rust/build/x86_64-unknown-linux-gnu/test/rustdoc/remove-url-from-headings" "/home/imperio/rust/rust/src/test/rustdoc/remove-url-from-headings.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ 3: Invalid command: `!`@has`,` (try with ``@!has`)` // !`@has` - '//a[`@href="http://a.a"]'` Encountered 1 errors ``` r? `@camelid`
2021-01-03Rollup merge of #80580 - GuillaumeGomez:suggestion-ignore-codeblock-warn, ↵Guillaume Gomez-6/+45
r=jyn514 Add suggestion for "ignore" doc code block Part of https://github.com/rust-lang/rust/issues/30032. This PR adds a suggestion to help users when they have a "ignore" doc code block which is invalid rust code. r? `@jyn514`
2021-01-03Stylistic fixes to diagnostic messagesoli-1/+1
2021-01-03Refactor the non-transient cell borrow error diagnosticoli-22/+24
2021-01-03Inline resetMouseMoved function directly into "mousemove" event handlerGuillaume Gomez-5/+1
2021-01-03Replace some loops with "onEachLazy" callGuillaume Gomez-13/+11
2021-01-03Create a "is_ignore" variable instead of doing the comparison multiple timesGuillaume Gomez-3/+4
2021-01-03Update now-more-precise operation with a preciser messageoli-14/+14
2021-01-03Detect invalid rustdoc test commandsGuillaume Gomez-1/+11
2021-01-03Auto merge of #80261 - GuillaumeGomez:attr-rework, r=jyn514bors-164/+145
rustdoc DocFragment rework Kind of a follow-up of #80119. A few things are happening in this PR. I'm not sure about the impact on perf though so I'm very interested about that too (if the perf is worse, then we can just close this PR). The idea here is mostly about reducing the memory usage by relying even more on `Symbol` instead of `String`. The only issue is that `DocFragment` has 3 modifications performed on it: 1. Unindenting 2. Collapsing similar comments into one 3. "Beautifying" (weird JS-like comments handling). To do so, I saved the information about unindent and the "collapse" is now on-demand (which is why I'm not sure the perf will be better, it has to be run multiple times...). r? `@jyn514`
2021-01-03Auto merge of #80623 - flip1995:clippyup, r=Manishearthbors-249/+648
Update Clippy Biweekly Clippy update. This includes a Cargo.lock update for the recent Clippy version bump. r? `@Manishearth`
2021-01-02Auto merge of #80592 - Skynoodle:snake-case-lint-reserved-identifier, ↵bors-0/+86
r=davidtwco Suggest renaming or escaping when fixing non-snake-case identifiers which would conflict with keywords Fixes #80575
2021-01-02reduce borrowing and (de)referencing around match patterns ↵Matthias Krüger-4/+4
(clippy::match_ref_pats)
2021-01-02Simplify docfragment transformation in unindent testsGuillaume Gomez-14/+1
2021-01-02Remove unused collapse passGuillaume Gomez-19/+3
2021-01-02Improve code for DocFragment reworkGuillaume Gomez-19/+18
2021-01-02Auto merge of #80412 - GuillaumeGomez:fix-search-section-pos, r=jyn514bors-1/+4
Fix search section position on small devices Fixes #79526. This is exactly the same issue fixed in 9c36491538476dd3ff5ec834944aacdaceb12f30 (in https://github.com/rust-lang/rust/pull/79936) but applied to the search section. When the width becomes too small, the search input goes on its own line to get more space, making it go "under" the section following (so either "main" or "search"). The fix is to simply make the section go more under so that it doesn't go over the search input. r? `@jyn514`
2021-01-02Use bootstrap rustc for versioncheck in Clippyflip1995-3/+4
2021-01-02Update rustdoc-ui test outputGuillaume Gomez-2/+4
2021-01-02End of rework of Attributes structGuillaume Gomez-136/+145
2021-01-02Rework DocFragmentGuillaume Gomez-4/+4
2021-01-02Add snake case lint note about keyword identifiers which cannot be rawSkynoodle-0/+2
2021-01-02Auto merge of #80550 - bugadani:markdown-refactor, r=jyn514bors-103/+111
Cleanup markdown span handling, take 2 This PR includes the cleanups made in #80244 except for the removal of `locate()`. While the biggest conceptual part in #80244 was the removal of `locate()`, it introduced a diagnostic regression. Additional cleanup: - Use `RefCell` to avoid building two separate vectors for the links Work to do: - [ ] Decide if `locate()` can be simplified by assuming `s` is always in `md` - [ ] Should probably add some tests that still provide the undesired diagnostics causing #80381 cc `@jyn514` This is the best I can do without patching Pulldown to provide multiple ranges for reference-style links. Also, since `locate` is probably more efficient than `rfind` (at least it's constant time), I decided to not check the link type and just cover every &str as it was before.
2021-01-02Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyupflip1995-249/+647
2021-01-02Rollup merge of #80613 - bugadani:issue-80607, r=matthewjasperMara Bos-0/+24
Diag: print enum variant instead of enum type Closes #80607
2021-01-02Rollup merge of #80574 - jyn514:clean-bootstrap, r=Mark-SimulacrumMara Bos-0/+1
Clean bootstrap artifacts on `x.py clean` Closes https://github.com/rust-lang/rust/issues/76519 r? `@Mark-Simulacrum`
2021-01-02Rollup merge of #80546 - matthiaskrgr:rustdoclippy, r=LingManMara Bos-88/+58
clippy fixes for librustdoc fixes clippy warnings of type: match_like_matches_macro or_fun_call op_ref needless_return let_and_return single_char_add_str useless_format unnecessary_sort_by match_ref_pats redundant_field_names
2021-01-02Print actual enum variantDániel Buga-3/+3
2021-01-02Add test for #80607 with undesired outputDániel Buga-0/+24
2021-01-02Only use locate for borrowed stringsDániel Buga-7/+21
2021-01-02Auto merge of #79883 - frewsxcv:frewsxcv-san, r=shepmasterbors-15/+64
Enable ASan, TSan, UBSan for aarch64-apple-darwin. I confirmed ASan, TSan, UBSan all work for me locally with `clang` on my new Macbook Air. ~This requires https://github.com/rust-lang/llvm-project/pull/86~
2021-01-01Auto merge of #80581 - jyn514:ci-llvm, r=Mark-Simulacrumbors-1/+6
Give a better error for download-ci-llvm if .xz is not supported Previously: ``` curl: (22) The requested URL returned error: 404 failed to run: curl -# -y 30 -Y 10 --connect-timeout 30 --retry 3 -Sf -o /tmp/tmp6ptXJV https://ci-artifacts.rust-lang.org/rustc-builds/99ad5a1a2824fea1ecf60068fd3636beae7ea2da/rust-dev-nightly-x86_64-unknown-linux-gnu.tar.gz ``` Now: ``` error: XZ support is required to download LLVM help: consider disabling `download-ci-llvm` or using a different version of python Build completed unsuccessfully in 0:00:00 ``` Follow-up to https://github.com/rust-lang/rust/pull/80435. r? `@Mark-Simulacrum`
2021-01-01clippy fixes for librustdocMatthias Krüger-88/+58
fixes clippy warnings of type: match_like_matches_macro or_fun_call op_ref needless_return let_and_return single_char_add_str useless_format unnecessary_sort_by match_ref_pats redundant_field_names
2021-01-01Auto merge of #80569 - notriddle:patch-3, r=jyn514bors-7/+1
Use Array.prototype.filter instead of open-coding Part of #79052, originally suggested in https://github.com/rust-lang/rust/pull/79052#discussion_r523468743 by `@jyn514` Besides making main.js smaller (always a plus), this also performs better by using the optimized filter implementation in your browser's JavaScript engine (according to `@GuillaumeGomez,` an 84% performance improvement).