about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-11-05Auto merge of #90631 - matthiaskrgr:rollup-a5tzjh3, r=matthiaskrgrbors-73/+188
Rollup of 5 pull requests Successful merges: - #89942 (Reorder `widening_impl`s to make the doc clearer) - #90569 (Fix tests using `only-i686` to use the correct `only-x86` directive) - #90597 (Warn for variables that are no longer captured) - #90623 (Remove more checks for LLVM < 12) - #90626 (Properly register text_direction_codepoint_in_comment lint.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-05Rollup merge of #90626 - rusticstuff:be-more-accepting, r=jyn514Matthias Krüger-0/+9
Properly register text_direction_codepoint_in_comment lint. This makes it known to the compiler so it can be configured like with `#![allow(text_direction_codepoint_in_comment)]`. Fixes #90614.
2021-11-05Rollup merge of #90597 - nikomatsakis:issue-90465, r=wesleywiserMatthias Krüger-69/+175
Warn for variables that are no longer captured r? `@wesleywiser` cc `@rust-lang/wg-rfc-2229` Fixes #90465
2021-11-05Rollup merge of #90569 - wesleywiser:fix_only_i686_tests, r=Mark-SimulacrumMatthias Krüger-4/+4
Fix tests using `only-i686` to use the correct `only-x86` directive We translate `i686` to `x86` which means tests marked as `only-i686` never ran. Update those tests to use `only-x86`. We parse the `only-` architecture directive here https://github.com/rust-lang/rust/blob/27143a9094b55a00d5f440b05b0cb4233b300d33/src/tools/compiletest/src/util.rs#L160-L168 and we translate `i686` to `x86` here https://github.com/rust-lang/rust/blob/27143a9094b55a00d5f440b05b0cb4233b300d33/src/tools/compiletest/src/util.rs#L56
2021-11-05Properly register text_direction_codepoint_in_comment lint.Hans Kratz-0/+9
2021-11-05Auto merge of #90583 - willcrichton:example-analyzer, r=jyn514bors-13/+142
Fix ICE when rustdoc is scraping examples inside of a proc macro This PR provides a clearer semantics for how --scrape-examples interacts with macros. If an expression's span AND it's enclosing item's span both are not `from_expansion`, then the example will be scraped. The added test case `rustdoc-scrape-examples-macros` shows a variety of situations. * A macro-rules macro that takes a function call as input: good * A macro-rules macro that generates a function call as output: bad * A proc-macro that generates a function call as output: bad * An attribute macro that generates a function call as output: bad * An attribute macro that takes a function call as input: good, if the proc macro is designed to propagate the input spans I ran this updated rustdoc on pyo3 and confirmed that it successfully scrapes examples from inside a proc macro, eg <img width="1013" alt="Screen Shot 2021-11-04 at 1 11 28 PM" src="https://user-images.githubusercontent.com/663326/140412691-81a3bb6b-a448-4a1b-a293-f7a795553634.png"> (cc `@mejrs)` Additionally, this PR fixes an ordering bug in the highlighting logic. Fixes https://github.com/rust-lang/rust/issues/90567. r? `@jyn514`
2021-11-05apply suggestions from code reviewNiko Matsakis-42/+42
2021-11-05Fix rustdoc-scrape-examples-macros test not being cross-platformWill Crichton-1/+2
2021-11-05Auto merge of #90598 - JohnTitor:rollup-kz1qioz, r=JohnTitorbors-62/+74
Rollup of 9 pull requests Successful merges: - #90507 (Suggest `extern crate alloc` when using undeclared module `alloc`) - #90530 (Simplify js tester a bit) - #90533 (Add note about x86 instruction prefixes in asm! to unstable book) - #90537 (Update aarch64 `target_feature` list for LLVM 12.) - #90544 (Demote metadata load warning to "info".) - #90554 (Clean up some `-Z unstable-options` in tests.) - #90556 (Add more text and examples to `carrying_{add|mul}`) - #90563 (rustbot allow labels) - #90571 (Fix missing bottom border for headings in sidebar) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-04Move rustdoc-scrape-examples-macros test to run-make-fulldepsWill Crichton-0/+0
2021-11-05Rollup merge of #90571 - GuillaumeGomez:missing-bottom-border-sidebar, r=jshaYuki Okushi-17/+26
Fix missing bottom border for headings in sidebar Fixes #90568. r? ```@jsha```
2021-11-05Rollup merge of #90554 - ehuss:unstable-options-cleanup, r=joshtriplettYuki Okushi-38/+27
Clean up some `-Z unstable-options` in tests. Several of these tests were for features that have been stabilized, or otherwise don't need `-Z unstable-options`.
2021-11-05Rollup merge of #90533 - Smittyvb:patch-1, r=joshtriplettYuki Okushi-0/+2
Add note about x86 instruction prefixes in asm! to unstable book Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes #82314 by mentioning that x86 instruction prefixes must not be used in inline assembly. AFAICT x86 is the only instruction set with instruction prefixes.
2021-11-05Rollup merge of #90530 - GuillaumeGomez:simplify-js-tester, r=notriddleYuki Okushi-7/+3
Simplify js tester a bit r? `````@notriddle`````
2021-11-05Rollup merge of #90507 - TaKO8Ki:suggest-extern-crate-alloc, r=jackh726Yuki Okushi-0/+16
Suggest `extern crate alloc` when using undeclared module `alloc` closes #90136
2021-11-05Auto merge of #90574 - notriddle:notriddle/doc-fold-stripped-conditional, ↵bors-8/+16
r=camelid,GuillaumeGomez rustdoc: Use conditional for _stripped fold Followup: https://github.com/rust-lang/rust/pull/90475#discussion_r741405472
2021-11-04handle case of a variable not capturedNiko Matsakis-0/+95
2021-11-04rework diagnostic reporting to be more structuredNiko Matsakis-45/+56
2021-11-04Auto merge of #90536 - crlf0710:fix_vtable_hrtb, r=jackh726bors-0/+32
Erase regions within `vtable_trait_first_method_offset` Fixes #90177 . r? `@jackh726`
2021-11-04Fix ICE when rustdoc is scraping examples inside of a proc macroWill Crichton-9/+115
2021-11-04Sort scraped call locations before serializingWill Crichton-4/+26
2021-11-04Fix missing bottom border for headings in sidebarGuillaume Gomez-17/+26
2021-11-04rustdoc: Use conditional for _stripped foldMichael Howell-8/+16
Followup: https://github.com/rust-lang/rust/pull/90475#discussion_r741405472
2021-11-04Mention possible future rejectionsSmittyvb-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-11-04Fix tests using `only-i686` to use the correct `only-x86` directiveWesley Wiser-4/+4
We translate `i686` to `x86` which means tests marked as `only-i686` never ran. Update those tests to use `only-x86`.
2021-11-04Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyupflip1995-1532/+3201
2021-11-03Clean up some `-Z unstable-options` in tests.Eric Huss-38/+27
2021-11-04Auto merge of #90179 - Nilstrieb:lifetime-elision-mismatch-hint, r=estebankbors-0/+134
Add beginner friendly lifetime elision hint to E0623 Address #90170 Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't. Example: ``` error[E0623]: lifetime mismatch --> $DIR/issue-90170-elision-mismatch.rs:2:35 | LL | fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) { | --------- --------- these two types are declared with different lifetimes... LL | core::mem::swap(&mut slice_a, &mut slice_b); | ^^^^^^^^^^^^ ...but data from `slice_b` flows into `slice_a` here | = note: each elided lifetime in input position becomes a distinct lifetime help: explicitly declare a lifetime and assign it to both | LL | fn foo<'a>(slice_a: &'a mut [u8], slice_b: &'a mut [u8]) { | ++++ ++ ++ ``` for ```rust fn foo(slice_a: &mut [u8], slice_b: &mut [u8]) { core::mem::swap(&mut slice_a, &mut slice_b); } ```
2021-11-03Auto merge of #90475 - camelid:docvisitor, r=notriddlebors-125/+218
rustdoc: Add `DocVisitor` and use it where possible `DocFolder` allows transforming the docs, accomplished by making its methods take and return types by-value. However, several of the rustdoc `DocFolder` impls only *visit* the docs; they don't change anything. Passing around types by-value is thus unnecessary, confusing, and potentially inefficient for those impls. `DocVisitor` is very similar to `DocFolder`, except that its methods take shared references and return nothing (i.e., the unit type). This should both be more efficient and make the code clearer. There is an additional reason to add `DocVisitor`, too. As part of my cleanup of `external_traits`, I'm planning to add a `fn cache(&mut self) -> &mut Cache` method to `DocFolder` so that `external_traits` can be retrieved explicitly from the `Cache`, rather than implicitly via `Crate.external_traits` (which is an `Rc<RefCell<...>>`). However, some of the `DocFolder` impls that could be turned into `DocVisitor` impls only have a shared reference to the `Cache`, because they are used during rendering. (They have to access the `Cache` via `html::render::Context.shared.cache`, which involves an `Rc`.) Since `DocVisitor` does not mutate any of the types it's visiting, its equivalent `cache()` method will only need a shared reference to the `Cache`, avoiding the problem described above. r? `@GuillaumeGomez` cc `@jyn514`
2021-11-03Simplify js tester a bitGuillaume Gomez-7/+3
2021-11-03Add beginner friendly lifetime elision hint to E0623Nilstrieb-0/+134
Suggest adding a new lifetime parameter when two elided lifetimes should match up but don't Issue #90170 This also changes the tests introduced by the previous commits because of another rustc issue (#90258)
2021-11-03Auto merge of #90413 - tmiasko:addr-of-mutable, r=RalfJung,oli-obkbors-64/+58
`addr_of!` grants mutable access, maybe? The exact set of permissions granted when forming a raw reference is currently undecided https://github.com/rust-lang/rust/issues/56604. To avoid presupposing any particular outcome, adjust the const qualification to be compatible with decision where raw reference constructed from `addr_of!` grants mutable access. Additionally, to avoid keeping `MaybeMutBorrowedLocals` in sync with const qualification, remove it. It's no longer used. `@rust-lang/wg-const-eval`
2021-11-04Erase regions within `vtable_trait_first_method_offset`.Charles Lew-0/+32
2021-11-03`addr_of!` grants mutable access, maybe?Tomasz Miąsko-6/+58
The exact set of permissions granted when forming a raw reference is currently undecided https://github.com/rust-lang/rust/issues/56604. To avoid presupposing any particular outcome, adjust the const qualification to be compatible with decision where raw reference constructed from `addr_of!` grants mutable access.
2021-11-03Remove `MaybeMutBorrowedLocals`Tomasz Miąsko-58/+0
2021-11-03Auto merge of #90527 - 12101111:libc_a, r=petrochenkovbors-3/+3
Provide standalone libc.a in self-contained for musl and wasi This is a prerequisites of https://github.com/rust-lang/libc/pull/2272, which in turn fix: - https://github.com/rust-lang/wg-cargo-std-aware/issues/66 - https://github.com/rust-lang/rust/issues/89626
2021-11-03Add note about x86 instruction prefixes in asm!Smittyvb-0/+2
Since rustc doesn't do the assembly parsing itself, it is unable to detect when inline assembly ends with an instruction prefix, which doesn't make sense since it would apply to instructions from the compiler. This fixes #82314 by mentioning that x86 instruction prefixes must not be used in inline assembly.
2021-11-03Provide standalone libc.a in self-contained for musl and wasi12101111-3/+3
2021-11-03Auto merge of #90517 - willcrichton:example-analyzer, r=jyn514bors-16/+23
Fix URL for scrape-examples.js in rustdoc page template Also adds line numbers to URLs in the "additional examples" section of rustdoc. r? `@jyn514`
2021-11-03fix messageTakayuki Maeda-1/+1
2021-11-02Add line number to URLs in "additional examples" section of rustdocWill Crichton-13/+20
2021-11-02Fix URL for scrape-examples.js in rustdoc page templateWill Crichton-3/+3
2021-11-03Auto merge of #90516 - matthiaskrgr:rollup-3dmfjkj, r=matthiaskrgrbors-35/+32
Rollup of 6 pull requests Successful merges: - #90084 (Make printed message match the code comment) - #90354 (Document clippy on nightly-rustc) - #90417 (stabilize `relaxed_struct_unsize`) - #90472 (Clarify what to do with accepted feature gates) - #90500 (Update Clippy dependencies) - #90502 (Split doc_cfg and doc_auto_cfg features) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-11-02Rollup merge of #90502 - GuillaumeGomez:split-doc-cfg-feature, r=jyn514Matthias Krüger-5/+25
Split doc_cfg and doc_auto_cfg features Part of #90497. With this feature, `doc_cfg` won't pick up items automatically anymore. cc `@Mark-Simulacrum` r? `@jyn514`
2021-11-02Rollup merge of #90500 - xFrednet:00000-update-clippy-deps, r=flip1995Matthias Krüger-4/+4
Update Clippy dependencies Clippy has two outdated dependencies, where one indirect dependency has been flagged by rustsec for dropping a lifetime. See [RUSTSEC-2020-0146](https://rustsec.org/advisories/RUSTSEC-2020-0146). This PR updates these dependencies. With previous dependency updates, it was tried to prevent duplicates in the `Cargo.lock` file of rust-lang/rust. I've tried to keep this in mind with this update. * Dependency `semver` * Used in `src/tools/cargo/Cargo.toml` as version `1.0.3` * Used in `src/tools/rust-analyzer/crates/project_model/Cargo.toml` as version `1` * Updated in Clippy from `0.11` to `1.0` (Clippy usually defines the major and minor patch version). The `Cargo.lock` file lists `1.0.3` which is one patch version behind the most recent one but prevents a duplicate with cargo's pinned version. * Dependency `cargo_metadata` * Used in several tools as `0.14` * Used in `src/tools/tidy` and `src/tools/rls` as `0.12` * Updated in Clippy from `0.12` to `0.14` All updates to the `Cargo.lock` have been done automatically by `x.py`. There are still some tools with these outdated dependencies. Clippy didn't require any changes, and it would be likely that the others could also be updated without any problem. Let me know if I should try to update them as well :upside_down_face:. Keep up the good work, whoever is reading this :crab: --- For Clippy: changelog: none
2021-11-02Rollup merge of #90417 - lcnr:stabilize-relaxed-struct-unsizing, r=wesleywiserMatthias Krüger-25/+0
stabilize `relaxed_struct_unsize` closes #81793 the fcp is already complete.
2021-11-02Rollup merge of #90354 - xFrednet:00000-lets-deploy-clippy-docs, ↵Matthias Krüger-0/+2
r=Mark-Simulacrum Document clippy on nightly-rustc Adding Clippy's docs to nightly-rustc, based on commit 01cf0bde. This PR only adds `clippy_utils` to the documentation. I've decided to only document one crate for now, as `clippy_lints` etc. contain very specific and undocumented functions which aren't really reusable. I'm guessing that they would mostly clutter up the search results with little benefit. `./x.py --stage 1 doc src/tools/clippy` if working fine now after the help that ```````@jyn514``````` and ```````@ehuss``````` have provided. A big THANK YOU to them!
2021-11-02Rollup merge of #90084 - noncombatant:patch-2, r=steveklabnikMatthias Krüger-1/+1
Make printed message match the code comment I think this code is getting L0, not L1 cache size, if I'm reading the Intel manual right. (I might not be.) Either way, the code comment and the printed message should match, whichever way is right. :)
2021-11-02Auto merge of #90464 - lnicola:rust-analyzer-2021-11-01, r=lnicolabors-16/+23
:arrow_up: rust-analyzer r? `@ghost`
2021-11-03add a suggestion about undeclared `alloc` moduleTakayuki Maeda-0/+16