about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-04-12Update attribute testsManish Goregaokar-8/+8
2021-04-12Move search JS into search-index.jsJacob Hoffman-Andrews-1524/+1534
Export a few variables and functions into the global scope because they are needed both by main.js and search-index.js.
2021-04-12Add explanatory note to `bare_urls` lintCamelid-0/+35
I think the lint is confusing otherwise since it doesn't fully explain what the problem is.
2021-04-13Auto merge of #84082 - andjo403:stabilize_nonzero_leading_trailing_zeros, ↵bors-1/+32
r=m-ou-se Stabilize nonzero_leading_trailing_zeros Stabilizing nonzero_leading_trailing_zeros and due to this also stabilizing the intrinsic cttz_nonzero FCP finished here: https://github.com/rust-lang/rust/issues/79143#issuecomment-817216153 `@rustbot` modify labels: +T-libs Closes #79143
2021-04-13Check for asm support in UI tests that require itTomasz Miąsko-5/+32
Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features.
2021-04-12Compiler error messages: reduce assertiveness of message E0384James Addison-35/+35
This message is emitted as guidance by the compiler when a developer attempts to reassign a value to an immutable variable. Following the message will always currently work, but it may not always be the best course of action; following the 'consider ...' messaging pattern provides a hint to the developer that it could be wise to explore other alternatives.
2021-04-12Auto merge of #82918 - Manishearth:edition-2015-warn, r=oli-obkbors-77/+84
Turn old edition lint (anonymous-parameters) into warn-by-default on 2015 This makes `anonymous_parameters` <s>and `keyword_idents` </s>warn-by-default on the 2015 edition. I would also like to do this for `absolute_paths_not_starting_with_crate`, but I feel that case is slightly less clear-cut. Note that this only affects code on the 2015 edition, such code is illegal in future editions anyway. This was spurred by https://github.com/dtolnay/syn/issues/972: old edition syntax breaks tooling (like syn), and while the tooling should be free to find its balance on how much to support prior editions, it does seem like we should be nudging such code towards the newer edition, and we can do that by turning this Allow lint into a Warn. In general, I feel like migration lints from an old edition should be made Warn after a year or so, and idiom lints for the new edition should be made Warn after a couple months. cc `@m-ou-se,` this is for stuff from the 2015-2018 migration but you might be interested.
2021-04-12+ignore-tidy-filelengthManish Goregaokar-1/+2
2021-04-12Fix typo in error messageCamelid-3/+6
Also tweaked the message a bit by - removing the hyphen, because in my opinion the hyphen makes the message a bit harder to read, especially combined with the backticks; - adding the word "be", because I think it's a bit clearer that way.
2021-04-12Move color to themesManish Goregaokar-5/+9
2021-04-12& -> &&Manish Goregaokar-2/+2
2021-04-12Wrap toggle_open()Manish Goregaokar-1/+4
2021-04-12Add test for item hidingManish Goregaokar-0/+155
2021-04-12add testb-naber-0/+58
2021-04-12should_hide_fields > 12Manish Goregaokar-2/+1
2021-04-12Turn old edition lints (anonymous-parameters, keyword-idents) into ↵Manish Goregaokar-77/+84
warn-by-default on 2015
2021-04-12Auto merge of #84103 - calebcartwright:bump-rls-rustfmt, r=Xanewokbors-5/+5
update RLS and rustfmt Fixes #83460 and fixes #83459 cc `@Xanewok`
2021-04-12Fix lookahead with None-delimited groupAaron Hill-0/+15
2021-04-12Add css classesManish Goregaokar-12/+12
2021-04-12Improve CSS for "hide contents, not items"Jacob Hoffman-Andrews-130/+116
Introduce a first use of the `<details>` and `<summary>` tags as replacements for the JS-built toggles. I think this has the potential to replace all the JS toggles and generally clean up the JS, CSS, and HTML. Split rendering of attributes into two cases: in the case where they are rendered as descendents of a `<pre>` tag, where they use indent spaces and newlines for formatting, matching their surrounding markup. In the case where they are rendered as descendants of a `<code>` tag, they are rendered as `<div>`. This let me clean up some fragile CSS that was adjusting the margin-left of attributes depending on context. Remove toggles for attributes. With the ALLOWED_ATTRIBUTES filter, it's rare for an item to have more than one attribute, so hiding attributes behind a toggle doesn't save any screen space in the common case. Fix a couple of invocations of `matches!` that didn't compile on my machine. Fix a boolean for the JS `createToggle` call that was causing "Expand description" to show up spuriously on already-expanded descriptions. Add JS for auto-hide settings and hide all / show all. Remove a z-index property and some font color tweaks made unnecessary by the <details> toggles. Add CSS for the <details> toggles.
2021-04-12Update src/librustdoc/html/render/print_item.rsManish Goregaokar-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12Update src/librustdoc/html/render/print_item.rsManish Goregaokar-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12rustdoc: Add setting for hiding large itemsManish Goregaokar-1/+6
2021-04-12rustdoc: smartly hide associated items of traits if there are too many of themManish Goregaokar-12/+30
2021-04-12rustdoc: hide fields of structs/unions > 5Manish Goregaokar-8/+31
2021-04-12rustdoc: hide variants of enums > 5Manish Goregaokar-7/+34
2021-04-12rustdoc: Stop hiding entire item declarationsManish Goregaokar-33/+5
2021-04-12update RLS and rustfmtCaleb Cartwright-5/+5
2021-04-12Auto merge of #84068 - Amanieu:fix_lint, r=lcnrbors-12/+15
Add `bad_asm_style` to HardwiredLints This was missed when the lint was added, which prevents the lint from being ignored with `#[allow]`.
2021-04-12Auto merge of #84095 - infinity0:master, r=Mark-Simulacrumbors-4/+6
bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057
2021-04-12Auto merge of #84112 - Dylan-DPC:rollup-tapsrzz, r=Dylan-DPCbors-182/+498
Rollup of 7 pull requests Successful merges: - #83669 (Issue 81508 fix) - #84014 (Improve trait/impl method discrepancy errors) - #84059 (Bump libc dependency of std to 0.2.93) - #84067 (clean up example on read_to_string) - #84079 (Improve test for `rustdoc::bare_urls` lint) - #84094 (Remove FixedSizeArray) - #84101 (rustdoc: Move crate loader to collect_intra_doc_links::early ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-12Rollup merge of #84101 - jyn514:early-pass, r=ManishearthDylan DPC-133/+220
rustdoc: Move crate loader to collect_intra_doc_links::early This groups the similar code together, and also allows making most of collect_intra_doc_links private again. This builds on https://github.com/rust-lang/rust/pull/84066, but it wouldn't be too hard to base it off master if you want this to land first. Helps with https://github.com/rust-lang/rust/issues/83761. r? manishearth Fixes https://github.com/rust-lang/rust/issues/84046
2021-04-12Rollup merge of #84079 - camelid:improve-bare-urls-test, r=jyn514Dylan DPC-18/+80
Improve test for `rustdoc::bare_urls` lint - Rename `url-improvements` test to `bare-urls` - Run rustfix for `bare-urls` test
2021-04-12Rollup merge of #84014 - estebank:cool-bears-hot-tip, r=varkorDylan DPC-31/+155
Improve trait/impl method discrepancy errors * Use more accurate spans * Clean up some code by removing previous hack * Provide structured suggestions Structured suggestions are particularly useful for cases where arbitrary self types are used, like in custom `Future`s, because the way to write `self: Pin<&mut Self>` is not necessarily self-evident when first encountered.
2021-04-12Rollup merge of #83669 - kwj2104:issue-81508-fix, r=varkorDylan DPC-0/+43
Issue 81508 fix Fix #81508 **Problem**: When variable name is used incorrectly as path, error and warning point to undeclared/unused name, when in fact the name is used, just incorrectly (should be used as a variable, not part of a path). **Summary for fix**: When path resolution errs, diagnostics checks for variables in ```ValueNS``` that have the same name (e.g., variable rather than path named Foo), and adds additional suggestion that user may actually intend to use the variable name rather than a path. The fix does not suppress or otherwise change the *warning* that results. I did not find a straightforward way in the code to modify this, but would love to make changes here as well with any guidance.
2021-04-11detect when suggested paths enter extern crates more rigorouslySNCPlay42-0/+39
2021-04-11Auto merge of #84100 - sjakobi:77548-reenable-check, r=jyn514bors-5/+3
tidy: Re-enable the "ignoring line length unnecessarily" check Closes #77548.
2021-04-11Move crate loader to collect_intra_doc_links::earlyJoshua Nelson-61/+80
This groups the similar code together, and also allows making most of collect_intra_doc_links private again
2021-04-11stabilize const_cttzAndreas Jonson-1/+32
2021-04-11tidy: Re-enable the "ignoring file length unnecessarily" checkSimon Jakobi-5/+3
Closes #77548.
2021-04-11Allow using `-C force-unwind-tables=no` when `panic=unwind`hyd-dev-11/+65
2021-04-11Add test to allow bad_asm_styleAmanieu d'Antras-12/+15
2021-04-11bootstrap: check local_rebuild before adding --cfg=bootstrap, closes #84057Ximin Luo-4/+6
2021-04-11Auto merge of #82608 - Aaron1011:feature/final-preexp-tts, r=petrochenkovbors-713/+725
Implement token-based handling of attributes during expansion This PR modifies the macro expansion infrastructure to handle attributes in a fully token-based manner. As a result: * Derives macros no longer lose spans when their input is modified by eager cfg-expansion. This is accomplished by performing eager cfg-expansion on the token stream that we pass to the derive proc-macro * Inner attributes now preserve spans in all cases, including when we have multiple inner attributes in a row. This is accomplished through the following changes: * New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced. These are very similar to a normal `TokenTree`, but they also track the position of attributes and attribute targets within the stream. They are built when we collect tokens during parsing. An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when we invoke a macro. * Token capturing and `LazyTokenStream` are modified to work with `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which is created during the parsing of a nested AST node to make the 'outer' AST node aware of the attributes and attribute target stored deeper in the token stream. * When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11Implement token-based handling of attributes during expansionAaron Hill-713/+725
This PR modifies the macro expansion infrastructure to handle attributes in a fully token-based manner. As a result: * Derives macros no longer lose spans when their input is modified by eager cfg-expansion. This is accomplished by performing eager cfg-expansion on the token stream that we pass to the derive proc-macro * Inner attributes now preserve spans in all cases, including when we have multiple inner attributes in a row. This is accomplished through the following changes: * New structs `AttrAnnotatedTokenStream` and `AttrAnnotatedTokenTree` are introduced. These are very similar to a normal `TokenTree`, but they also track the position of attributes and attribute targets within the stream. They are built when we collect tokens during parsing. An `AttrAnnotatedTokenStream` is converted to a regular `TokenStream` when we invoke a macro. * Token capturing and `LazyTokenStream` are modified to work with `AttrAnnotatedTokenStream`. A new `ReplaceRange` type is introduced, which is created during the parsing of a nested AST node to make the 'outer' AST node aware of the attributes and attribute target stored deeper in the token stream. * When we need to perform eager cfg-expansion (either due to `#[derive]` or `#[cfg_eval]`), we tokenize and reparse our target, capturing additional information about the locations of `#[cfg]` and `#[cfg_attr]` attributes at any depth within the target. This is a performance optimization, allowing us to perform less work in the typical case where captured tokens never have eager cfg-expansion run.
2021-04-11Auto merge of #83806 - JohnTitor:issue-51446, r=estebankbors-0/+34
Add a regression test for issue-51446 Closes #51446 r? `@estebank`
2021-04-11Auto merge of #84071 - nagisa:nixos-patching-fix, r=Mark-Simulacrumbors-48/+41
Fix NixOS patching Moving the `.nix-deps` has resulted in rpath links being broken and therefore bootstrap on NixOS broken entirely. This PR still produces a `.nix-deps` but only for the purposes of producing a gc root. We rpath a symlink-resolved result instead. For purposes of simplicity we also use joinSymlink to produce a single merged output directory so that we don't need to update multiple locations every time we add a library or something. Fixes a regression from https://github.com/rust-lang/rust/pull/82739.
2021-04-10Preprocess intra-doc links consistentlyJoshua Nelson-92/+160
Previously, rustdoc would panic on links to external crates if they were surrounded by backticks.
2021-04-10Run rustfix for `bare-urls` testCamelid-18/+80
This will help us ensure that it emits valid suggestions.
2021-04-10Rename `url-improvements` test to `bare-urls`Camelid-18/+18
The lint used to be called `non-autolinks`, and linted more than just bare URLs. Now, it is called `bare-urls` and only lints against bare URLs. So, `bare-urls` is a better name for the test.