about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-10-12Rollup merge of #102924 - notriddle:notriddle/sidebar-link-class, ↵Dylan DPC-97/+95
r=GuillaumeGomez rustdoc: remove unused classes from sidebar links Since https://github.com/rust-lang/rust/commit/98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors from the currently-selected item, there's no need to have item classes on sidebar links. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-link-class/std/vec/struct.Vec.html While cleaning up the CSS to remove unneeded `.content` selectors, this PR changes the `h1.fqn a` CSS selector to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since https://github.com/rust-lang/rust/pull/89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.
2022-10-12Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillotDylan DPC-57/+36
Check representability in adt_sized_constraint Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`. I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK. r? ``@cjgillot``
2022-10-12Rollup merge of #102239 - joshtriplett:style-guide, r=calebcartwrightDylan DPC-0/+2003
Move style guide to rust-lang/rust Per [RFC 3309](https://rust-lang.github.io/rfcs/3309-style-team.html).
2022-10-12Rollup merge of #102187 - b-naber:inline-const-source-info, r=eholkDylan DPC-0/+67
Use correct location for type tests in promoted constants Previously we forgot to remap the location in a type test collected when visiting the body of a promoted constant back to the usage location, causing an ICE when trying to get span information for that type test. Fixes https://github.com/rust-lang/rust/issues/102117
2022-10-12Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwcoDylan DPC-2/+2
Migrate rustc_passes diagnostics Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870 I would like to do this collaboratively, as there is a lot of work! Here's the process: - Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access) - Indicate which file/task you would like to work on (so we don't duplicate work) from the list below - Do the work, push up a commit, comment that you're done with that file/task - Repeat until done 😄 ### Files to Migrate (in `compiler/rustc_passes/src/`) - [x] check_attr.rs ``@CleanCut`` - [x] check_const.rs ``@CleanCut`` - [x] dead.rs ``@CleanCut`` - [x] debugger_visualizer.rs ``@CleanCut`` - [x] diagnostic_items.rs ``@CleanCut`` - [x] entry.rs ``@CleanCut`` - [x] lang_items.rs ``@CleanCut`` - [x] layout_test.rs ``@CleanCut`` - [x] lib_features.rs ``@CleanCut`` - [x] ~liveness.rs~ ``@CleanCut`` Nothing to do - [x] loops.rs ``@CleanCut`` - [x] naked_functions.rs ``@CleanCut`` - [x] stability.rs ``@CleanCut`` - [x] weak_lang_items.rs ``@CleanCut`` ### Tasks - [x] Rebase on current `master` ``@CleanCut`` - [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut`` - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``
2022-10-11Update cargoWeihang Lo-0/+0
9 commits in 3cdf1ab25dc4fe56f890e8c7330d53a23ad905d3..b8f30cb23c4e5f20854a4f683325782b7cff9837 2022-10-07 17:34:03 +0000 to 2022-10-10 19:16:06 +0000 - Add more doc comments for three modules (rust-lang/cargo#11207) - docs: fix (rust-lang/cargo#11208) - Add completions for `cargo remove` (rust-lang/cargo#11204) - Config file loaded via CLI takes priority over env vars (rust-lang/cargo#11077) - Use `#[default]` when possible (rust-lang/cargo#11197) - Implement RFC 3289: source replacement ambiguity (rust-lang/cargo#10907) - Use correct version of cargo in test (rust-lang/cargo#11193) - Check empty input for login (rust-lang/cargo#11145) - Add retry support to sparse registries (rust-lang/cargo#11069)
2022-10-11Rollup merge of #102912 - lnicola:rust-analyzer-2022-10-11, r=lnicolaMatthias Krüger-1093/+2885
:arrow_up: rust-analyzer r? `@ghost`
2022-10-11Rollup merge of #102893 - TaKO8Ki:fix-102878, r=davidtwcoMatthias Krüger-0/+70
Fix ICE #102878 Fixes #102878
2022-10-11Rollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-seMatthias Krüger-1/+0
Stabilize map_first_last Stabilizes the following functions: ```Rust impl<T> BTreeSet<T> { pub fn first(&self) -> Option<&T> where T: Ord; pub fn last(&self) -> Option<&T> where T: Ord; pub fn pop_first(&mut self) -> Option<T> where T: Ord; pub fn pop_last(&mut self) -> Option<T> where T: Ord; } impl<K, V> BTreeMap<K, V> { pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord; pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord; } ``` Closes #62924 ~~Blocked on the [FCP](https://github.com/rust-lang/rust/issues/62924#issuecomment-1179489929) finishing.~~ Edit: It finished!
2022-10-11Rollup merge of #100387 - cjgillot:hygiene-trait-impl, r=petrochenkovMatthias Krüger-22/+89
Check uniqueness of impl items by trait item when applicable. When checking uniqueness of item names in impl blocks, we currently use the same definition of hygiene as for toplevel items. This means that a plain item and one generated by a macro 2.0 do not collide. This hygiene rule does not match with how impl items resolve to associated trait items. As a consequence, we misdiagnose the trait impls. This PR proposes to consider that trait impl items are uses of the corresponding trait items during resolution, instead of checking for duplicates later. An error is emitted when a trait impl item is used twice. There should be no stable breakage, since macros 2.0 are still unstable. r? ``@petrochenkov`` cc ``@RalfJung`` Fixes https://github.com/rust-lang/rust/issues/71614.
2022-10-11rustdoc: remove unneeded `.content` selector from link colorsMichael Howell-28/+28
Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 and b5963f07e611cf2a09a310eb74c1a93adfaeb9de removed color classes from sidebar items, there's no need for the selectors to be so specific any more. This commit does have to change `h1.fqn a` to just be `h1 a`, so that the header link color selector is less specific than the typed link at the end. Since #89506 made docblocks start at `h2`, the main page link header should be the only h1 in the page now.
2022-10-11rustdoc: remove unused classes from sidebarMichael Howell-69/+67
Since 98f05a0282625a5fda6e90ebf3b05a4bd7608f65 removed separate colors from the currently-selected item, there's no need to have item classes on sidebar links.
2022-10-11Auto merge of #102915 - JohnTitor:rollup-5ht99y1, r=JohnTitorbors-48/+35
Rollup of 7 pull requests Successful merges: - #102258 (Remove unused variable in float formatting.) - #102277 (Consistently write `RwLock`) - #102412 (Never panic in `thread::park` and `thread::park_timeout`) - #102589 (scoped threads: pass closure through MaybeUninit to avoid invalid dangling references) - #102625 (fix backtrace small typo) - #102859 (Move lifetime resolution module to rustc_hir_analysis.) - #102898 (rustdoc: remove unneeded `<div>` wrapper from sidebar DOM) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-11Rollup merge of #102898 - notriddle:notriddle/sidebar-block, r=GuillaumeGomezYuki Okushi-48/+35
rustdoc: remove unneeded `<div>` wrapper from sidebar DOM When this was added, the sidebar had a bit more complex style. It can be removed, now. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html
2022-10-11Auto merge of #102755 - pcc:data-local-tmp, r=Mark-Simulacrumbors-4/+4
tools/remote-test-{server,client}: Use /data/local/tmp on Android The /data/tmp directory does not exist, at least not on recent versions of Android, which currently leads to test failures on that platform. I checked a virtual device running AOSP master and a Nexus 5 running Android Marshmallow and on both devices the /data/tmp directory does not exist and /data/local/tmp does, so let's switch to /data/local/tmp.
2022-10-11:arrow_up: rust-analyzerLaurențiu Nicola-1093/+2885
2022-10-11Report duplicate definitions in trait impls during resolution.Camille GILLOT-22/+89
2022-10-11Auto merge of #102724 - pcc:scs-fix-test, r=Mark-Simulacrumbors-3/+3
Fix the sanitizer_scs_attr_check.rs test The test is failing when targeting aarch64 Android. The intent appears to have been to look for a function attributes comment (or the absence of one) on the line preceding the function declaration. But this isn't quite possible with FileCheck and the test as written was looking for a line with `no_scs` after a line with `scs`, which doesn't appear in the output. Instead, match on the function attributes comment on the line following the demangled function name comment.
2022-10-10Remove outdated commentMichael Howell-1/+0
2022-10-11Auto merge of #102896 - matthiaskrgr:rollup-jg5xawz, r=matthiaskrgrbors-732/+379
Rollup of 6 pull requests Successful merges: - #101360 (Point out incompatible closure bounds) - #101789 (`let`'s not needed in struct field definitions) - #102846 (update to syn-1.0.102) - #102871 (rustdoc: clean up overly complex `.trait-impl` CSS selectors) - #102876 (suggest candidates for unresolved import) - #102888 (Improve rustdoc-gui search-color test) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-10Auto merge of #101720 - GuillaumeGomez:warn-INVALID_HTML_TAGS, r=notriddlebors-23/+86
Change default level of INVALID_HTML_TAGS to warning and stabilize it Fixes of #67799. cc `@Nemo157` r? `@notriddle`
2022-10-10Check representability in adt_sized_constraintCameron Steffen-57/+36
2022-10-10Rollup merge of #102888 - GuillaumeGomez:improve-search-color-check, r=notriddleMatthias Krüger-711/+234
Improve rustdoc-gui search-color test Thanks to the add of "functions" in `browser-ui-test`, we can start to reduce the size of the scripts. It'll be very useful for all color checks. r? `@notriddle`
2022-10-10Rollup merge of #102876 - SparrowLii:import-candidate, r=fee1-deadMatthias Krüger-4/+83
suggest candidates for unresolved import Currently we prompt suggestion of candidates(help notes of `use xxx::yyy`) for names which cannot be resolved, but we don't do that for import statements themselves that couldn't be resolved. It seems reasonable to add candidate help information for these statements as well. Fixes #102711
2022-10-10Rollup merge of #102871 - notriddle:notriddle/trait-impl-anchor, ↵Matthias Krüger-3/+1
r=GuillaumeGomez rustdoc: clean up overly complex `.trait-impl` CSS selectors When added in 45964368f4a2e31c94e9bcf1cef933c087d21544, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
2022-10-10Rollup merge of #102846 - zertosh:update-syn, r=dtolnayMatthias Krüger-12/+14
update to syn-1.0.102 This update removes the only `.gitignore` found in `rustc-src`: vendor/syn/tests/.gitignore vendor/syn-1.0.91/tests/.gitignore vendor/syn-1.0.95/tests/.gitignore To check-in `rustc-src` for hermetic builds in environments with restrictive `.gitignore` policies, one has to remove these `tests/.gitignore` and patch the respective `.cargo-checksum.json`.`syn` >1.0.101 includes dtolnay/syn@3c49303bed7a, which removes its `tests/.gitignore`. Now the `syn` crates.io package has no `.gitignore`. [`rustc-src`'s `vendor`][] is produced from the root `Cargo.toml`, `src/tools/rust-analyzer/Cargo.toml`, `compiler/rustc_codegen_cranelift/Cargo.toml`, and `src/bootstrap/Cargo.toml`. `rustc_codegen_cranelift` does not use `syn`. [`rustc-src`'s `vendor`]: https://github.com/rust-lang/rust/blob/c0784109daa0/src/bootstrap/dist.rs#L934-L940 This was produced with: cargo update --package syn --precise 1.0.102 \ cargo update --package syn --precise 1.0.102 \ --manifest-path src/tools/rust-analyzer/Cargo.toml cargo update --package syn --precise 1.0.102 \ --manifest-path src/bootstrap/Cargo.toml
2022-10-10Rollup merge of #101789 - gimbles:let, r=estebankMatthias Krüger-2/+8
`let`'s not needed in struct field definitions Fixes #101683
2022-10-10Rollup merge of #101360 - compiler-errors:multiple-closure-bounds, ↵Matthias Krüger-0/+39
r=petrochenkov Point out incompatible closure bounds Fixes #100295
2022-10-10Fix unclosed HTML tag in clippy docGuillaume Gomez-3/+3
2022-10-10Auto merge of #102596 - scottmcm:option-bool-calloc, r=Mark-Simulacrumbors-1/+18
Do the `calloc` optimization for `Option<bool>` Inspired by <https://old.reddit.com/r/rust/comments/xtiqj8/why_is_this_functional_version_faster_than_my_for/iqqy37b/>.
2022-10-10rustdoc: remove unneeded `<div>` wrapper from sidebar DOMMichael Howell-47/+35
When this was added, the sidebar had a bit more complex style. It can be removed, now.
2022-10-11fix #102878Takayuki Maeda-0/+70
2022-10-10Fix unclosed HTML tag in rustfmt docGuillaume Gomez-1/+1
2022-10-10Stabilize rustdoc CHECK_INVALID_HTML_TAGS checkGuillaume Gomez-4/+2
2022-10-10Update rustdoc testsGuillaume Gomez-14/+79
2022-10-10Change default lint level of INVALID_HTML_TAGS to warningGuillaume Gomez-1/+1
2022-10-10Simplify result color checksGuillaume Gomez-710/+233
2022-10-10Update browser-ui-test version to 0.12.2Guillaume Gomez-1/+1
2022-10-10`let` is not allowed in struct field definitionsgimbles-2/+8
Co-authored-by: jyn514 <jyn514@gmail.com> Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
2022-10-10Auto merge of #102875 - Dylan-DPC:rollup-zwcq8h9, r=Dylan-DPCbors-542/+218
Rollup of 6 pull requests Successful merges: - #99696 (Uplift `clippy::for_loops_over_fallibles` lint into rustc) - #102055 (Move some tests to more reasonable directories) - #102786 (Remove tuple candidate, nothing special about it) - #102794 (Make tests capture the error printed by a Result return) - #102853 (Skip chained OpaqueCast when building captures.) - #102868 (Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-10Rollup merge of #102868 - compiler-errors:rename-assoc-tyalias-to-ty, r=TaKO8KiDylan DPC-11/+11
Rename `AssocItemKind::TyAlias` to `AssocItemKind::Type` Thanks `@camsteffen` for catching this in ast too, cc https://github.com/rust-lang/rust/pull/102829#issuecomment-1272649247
2022-10-10Rollup merge of #102853 - cjgillot:skip-opaque-cast, r=jackh726Dylan DPC-0/+17
Skip chained OpaqueCast when building captures. Fixes https://github.com/rust-lang/rust/issues/102089
2022-10-10Rollup merge of #102055 - c410-f3r:moar-errors, r=petrochenkovDylan DPC-173/+2
Move some tests to more reasonable directories r? ``@petrochenkov``
2022-10-10Rollup merge of #99696 - WaffleLapkin:uplift, r=fee1-deadDylan DPC-358/+188
Uplift `clippy::for_loops_over_fallibles` lint into rustc This PR, as the title suggests, uplifts [`clippy::for_loops_over_fallibles`] lint into rustc. This lint warns for code like this: ```rust for _ in Some(1) {} for _ in Ok::<_, ()>(1) {} ``` i.e. directly iterating over `Option` and `Result` using `for` loop. There are a number of suggestions that this PR adds (on top of what clippy suggested): 1. If the argument (? is there a better name for that expression) of a `for` loop is a `.next()` call, then we can suggest removing it (or rather replacing with `.by_ref()` to allow iterator being used later) ```rust for _ in iter.next() {} // turns into for _ in iter.by_ref() {} ``` 2. (otherwise) We can suggest using `while let`, this is useful for non-iterator, iterator-like things like [async] channels ```rust for _ in rx.recv() {} // turns into while let Some(_) = rx.recv() {} ``` 3. If the argument type is `Result<impl IntoIterator, _>` and the body has a `Result<_, _>` type, we can suggest using `?` ```rust for _ in f() {} // turns into for _ in f()? {} ``` 4. To preserve the original behavior and clear intent, we can suggest using `if let` ```rust for _ in f() {} // turns into if let Some(_) = f() {} ``` (P.S. `Some` and `Ok` are interchangeable depending on the type) I still feel that the lint wording/look is somewhat off, so I'll be happy to hear suggestions (on how to improve suggestions :D)! Resolves #99272 [`clippy::for_loops_over_fallibles`]: https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles
2022-10-09rustdoc: clean up overly complex `.trait-impl` CSS selectorsMichael Howell-3/+1
When added in 45964368f4a2e31c94e9bcf1cef933c087d21544, these multi-class selectors were present in the initial commit, but no reason was given why the shorter selector wouldn't work.
2022-10-10Auto merge of #94381 - Kobzol:llvm-bolt, r=Mark-Simulacrumbors-7/+158
Use BOLT in CI to optimize LLVM This PR adds an optimization step in the Linux `dist` CI pipeline that uses [BOLT](https://github.com/llvm/llvm-project/tree/main/bolt) to optimize the `libLLVM.so` library built by boostrap. Steps: - [x] Use LLVM 15 as a bootstrap compiler and use it to build BOLT - [x] Compile LLVM with support for relocations (`-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-q"`) - [x] Gather profile data using instrumented LLVM - [x] Apply profile to LLVM that has already been PGOfied - [x] Run with BOLT profiling on more benchmarks - [x] Decide on the order of optimization (PGO -> BOLT?) - [x] Decide how we should get `bolt` (currently we use the host `bolt`) - [x] Clean up The latest perf results can be found [here](https://github.com/rust-lang/rust/pull/94381#issuecomment-1258269440). The current CI build time with BOLT applied is around 1h 55 minutes.
2022-10-10Point out incompatible closure boundsMichael Goulet-0/+39
2022-10-10suggest candidates for unresolved importSparrowLii-4/+83
2022-10-10Rename AssocItemKind::TyAlias to AssocItemKind::TypeMichael Goulet-11/+11
2022-10-10Rollup merge of #102862 - scottmcm:more-alignment-traits, r=thomccYuki Okushi-1/+1
From<Alignment> for usize & NonZeroUsize Since you mentioned these two in https://github.com/rust-lang/rust/pull/102072#issuecomment-1272390033, r? ``@thomcc`` Tracking Issue: https://github.com/rust-lang/rust/issues/102070