Commit graph

215486 commits

Author SHA1 Message Date
bors d3322e2773 Auto merge of #106981 - joboet:std_remove_box_syntax, r=thomcc
Do not use box syntax in `std`

See #94970 and #49733. About half of the `box` instances in `std` do not even need to allocate, the other half can simply be replaced with `Box::new`.

`@rustbot` label +T-libs
r? rust-lang/libs
2023-01-23 01:05:56 +00:00
bors a5fa99eed2 Auto merge of #106975 - tmiasko:basic-blocks-cache, r=cjgillot
Refactor basic blocks control flow caches

No functional changes.
2023-01-22 21:35:21 +00:00
bors 5e37043d63 Auto merge of #106827 - alexcrichton:update-llvm-to-15.0.7, r=cuviper
Update LLVM to 15.0.7

This commit pulls in rust-lang/llvm-project#143 which updates the LLVM version used by rustc to 15.0.7, namely pulling in https://reviews.llvm.org/D136110 which is needed for some work I'm working on with wasm.
2023-01-22 18:39:13 +00:00
bors cef633de58 Auto merge of #107187 - matthiaskrgr:rollup-lvwzlg2, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #107102 (Implement some more predicates in the new solver)
 - #107111 (Fix missing arguments issues and copy-paste bug for fluent)
 - #107114 (Add note about absolute paths to Path::join)
 - #107127 (Enable sanitizers for s390x-linux)
 - #107152 (Migrate scraped-examples top and bottom "borders" to CSS variables)
 - #107170 (Add myself to .mailmap)
 - #107174 (rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`)
 - #107180 (Remove unnecessary `&format!`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-22 13:22:34 +00:00
Matthias Krüger 2f7a3a1f0a
Rollup merge of #107180 - nvzqz:rm-fmt-ref, r=joshtriplett
Remove unnecessary `&format!`

These were likely from before the `PartialEq<str>` impl for `&String`.
2023-01-22 11:43:09 +01:00
Matthias Krüger 8a225212e6
Rollup merge of #107174 - petrochenkov:defidoc, r=notriddle
rustdoc: Use `DefId(Map,Set)` instead of `FxHash(Map,Set)`

Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
cc https://github.com/rust-lang/rust/pull/106977
2023-01-22 11:43:08 +01:00
Matthias Krüger 06936fe567
Rollup merge of #107170 - albertlarsan68:update-mailmap, r=compiler-errors
Add myself to .mailmap
2023-01-22 11:43:08 +01:00
Matthias Krüger d41a14f91e
Rollup merge of #107152 - GuillaumeGomez:migrate-to-css-var, r=notriddle
Migrate scraped-examples top and bottom "borders" to CSS variables

r? `@notriddle`
2023-01-22 11:43:07 +01:00
Matthias Krüger d779a592dd
Rollup merge of #107127 - uweigand:s390x-sanitizer, r=Mark-Simulacrum
Enable sanitizers for s390x-linux

Include sanitizers supported by LLVM on s390x (asan, lsan, msan, tsan) in the target definition, as well as in the compiletest supported list.

Build sanitizer runtime for the target.  Enable sanitizers in the CI.
2023-01-22 11:43:07 +01:00
Matthias Krüger 17b9f2a7ed
Rollup merge of #107114 - Erk-:add-absolute-note-to-path-join, r=m-ou-se
Add note about absolute paths to Path::join

The note already exists on `PathBuf::push`, but I think it is good to have it on `Path::join` as well since it can cause issues if you are not careful with your input.
2023-01-22 11:43:06 +01:00
Matthias Krüger 6e79310c55
Rollup merge of #107111 - chenyukang:yukang/fix-107090-fluent-parameters, r=petrochenkov
Fix missing arguments issues and copy-paste bug for fluent

Fixes #107090
2023-01-22 11:43:06 +01:00
Matthias Krüger d022013eb7
Rollup merge of #107102 - compiler-errors:new-solver-new-candidats-4, r=lcnr
Implement some more predicates in the new solver

Implement a few more goals. The subtype goal specifically is important, since it's required for this code to compile:

```
fn main() {
  let mut x = vec![];
  x.push(1i32);
}
```

(I think we emit a subtype goal here because of coercion).

Drive-by: Also implements `--compare-mode=next-solver` -- I've been using this locally a lot to find out what works and what doesn't. I'm also happy to split this out into another PR.

r? `@lcnr`
2023-01-22 11:43:05 +01:00
bors 8e68090723 Auto merge of #107137 - Mark-Simulacrum:169, r=Mark-Simulacrum
Bump to 1.69.0

r? `@Mark-Simulacrum`
2023-01-22 10:30:59 +00:00
bors 940d00f2f6 Auto merge of #107185 - compiler-errors:rollup-wkomjma, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #103418 (Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report)
 - #106113 (llvm-wrapper: adapt for LLVM API change)
 - #106144 (Improve the documentation of `black_box`)
 - #106578 (Label closure captures/generator locals that make opaque types recursive)
 - #106749 (Update cc to 1.0.77)
 - #106935 (Fix `SingleUseLifetime` ICE)
 - #107015 (Re-enable building rust-analyzer on riscv64)
 - #107029 (Add new bootstrap members to triagebot.toml)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-22 06:53:36 +00:00
Michael Goulet 31f9f21412
Rollup merge of #107029 - albertlarsan68:patch-2, r=Mark-Simulacrum
Add new bootstrap members to triagebot.toml

```@ozkanonur``` if you want to be assigned to review PRs too, just post a message to this thread.

Should a `T-bootstrap` label be created, since `src/tools/tidy` is assigned to the `bootstrap` members, but labeled `A-testsuite` (and not `A-bootstrap`) ?

cc ```@jyn514```
2023-01-21 23:21:02 -05:00
Michael Goulet 1ac117b284
Rollup merge of #107015 - cuviper:ra-riscv64, r=Mark-Simulacrum
Re-enable building rust-analyzer on riscv64

It was disabled in #75103 due to an LLVM bug, but followup comments have
confirmed that it builds fine on Fedora with LLVM 15.

r? ```@Mark-Simulacrum```
cc ```@matklad``` ```@davidlt```
2023-01-21 23:21:01 -05:00
Michael Goulet 8a830cf182
Rollup merge of #106935 - TaKO8Ki:fix-104440, r=cjgillot
Fix `SingleUseLifetime` ICE

Fixes #104440
cc: ``@matthiaskrgr``
2023-01-21 23:21:00 -05:00
Michael Goulet 5645d10f93
Rollup merge of #106749 - glandium:dwarf, r=Mark-Simulacrum
Update cc to 1.0.77

Fixes (without a test) #98746.
2023-01-21 23:21:00 -05:00
Michael Goulet 1d2c9a84fa
Rollup merge of #106578 - compiler-errors:recursive-opaque-closure, r=TaKO8Ki
Label closure captures/generator locals that make opaque types recursive

cc https://github.com/rust-lang/rust/issues/46415#issuecomment-1374665828
2023-01-21 23:20:59 -05:00
Michael Goulet d1405c82b8
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
Improve the documentation of `black_box`

There don't seem to be many great resources on how `black_box` should be used, so I added some information here
2023-01-21 23:20:59 -05:00
Michael Goulet 2504c8d1ee
Rollup merge of #106113 - krasimirgg:llvm-16-ext-tyid, r=nikic
llvm-wrapper: adapt for LLVM API change

No functional changes intended.

The LLVM commit e6b02214c6 added `TargetExtTyID` to the `TypeID` enum. This adapts `RustWrapper` accordingly.
2023-01-21 23:20:58 -05:00
Michael Goulet bdcfa6c9aa
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
Add `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` to future-incompat report

See https://github.com/rust-lang/rust/issues/79813 for a discussion of this lint. This has been warn-by-default for over a year, so adding it to the future-incompat report should help to find libraries that haven't yet updated.
2023-01-21 23:20:58 -05:00
bors 85da15c016 Auto merge of #107133 - pnkfelix:revert-pr-84022-for-issue-106337, r=Mark-Simulacrum
Revert "Make PROC_MACRO_DERIVE_RESOLUTION_FALLBACK a hard error"

This reverts commit 7d82cadd97 aka PR #84022

I am doing this to buy us some time with respect to issue #106337 w.r.t. the 1.67 release.
2023-01-22 03:58:52 +00:00
Nikolai Vazquez 734a91358b Remove unnecessary &format!
These were likely from before the `PartialEq<str>` impl for `&String`.
2023-01-21 22:06:42 -05:00
Vadim Petrochenkov 68803926e0 rustdoc: Use DefId(Map,Set) instead of FxHash(Map,Set)
Not all uses are converted, a few cases iterating through maps/sets and requiring nontrivial changes are kept.
2023-01-22 02:12:05 +04:00
bors 1c394e1b9a Auto merge of #106948 - cuviper:ci-mingw-check, r=nikic
ci: upgrade mingw-check to ubuntu:22.04
2023-01-21 21:42:21 +00:00
Albert Larsan e54028b68e
Add myself to .mailmap 2023-01-21 20:52:20 +00:00
Aaron Hill dc8876196b
Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS to future-incompat report 2023-01-21 14:38:25 -06:00
bors 52372f9c71 Auto merge of #105924 - TimNN:ui-remap, r=Mark-Simulacrum
Remap paths in UI tests by default

If you think this needs further discussions / something RFC-like, please let me know the best forum for that.

This PR runs UI tests with a remapped "src base" directory by default.

Why? Because some UI tests currently depend on the length of the absolute path to the `src/test/ui` directory. Remapping makes the tests independent of the absolute path.

The path to the source file (which is absolute on CI) is part of the type name of closures. `rustc` diagnostic output depends on the length of type names (long type names are truncated). So a long absolute path leads to long closure type names, which leads to truncation and changed diagnostics.

(I initially tried just disabling type name truncation, but that made some error messages stupid long (thousands of characters, IIRC)).

Additional changes:

* All boolean `compiletest` directives now support explicit `no-` versions to disable them.
* Adapt existing tests when necessary:
  * Disable remapping for individual tests that fail with it enabled (when there's no obvious alternative fix).
  * For tests that already check something remapping related switch to the new option unless we gain something significant by keeping the manual remap.

Passed Windows CI in https://github.com/rust-lang/rust/actions/runs/3933100590
2023-01-21 17:44:20 +00:00
Michael Goulet 444cbcd729 Address goal nits 2023-01-21 17:15:00 +00:00
Michael Goulet d6a411c086 Implement some more predicates 2023-01-21 16:37:33 +00:00
Michael Goulet 2489889231 Add compare-mode-next-solver 2023-01-21 16:37:33 +00:00
bors 005fc0f00f Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obk
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)

This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.

The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.

~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~

Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)).

Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).

r? `@ghost`
2023-01-21 14:18:17 +00:00
Guillaume Gomez 372ad130d5 Extend rustdoc GUI test for scraped examples top and bottom "borders" 2023-01-21 12:16:02 +01:00
Guillaume Gomez 397e4b13f9 Migrate scraped-examples top and bottom "borders" to CSS variables 2023-01-21 12:15:42 +01:00
bors 21f6839352 Auto merge of #106976 - tmiasko:borrowck-lazy-dominators, r=cjgillot
Lazy dominator tree construction in borrowck

Motivated by the observation that sometimes constructed dominator tree was never queried.
2023-01-21 11:02:29 +00:00
bors b22aa57fd5 Auto merge of #106884 - clubby789:fieldless-enum-debug, r=michaelwoerister
Simplify `derive(Debug)` output for fieldless enums

Fixes #106875
2023-01-21 07:49:09 +00:00
Michael Goulet 8742fd9c85 Label closure captures/generator locals that make opaque types recursive 2023-01-21 05:49:36 +00:00
bors e098eb17e1 Auto merge of #107143 - compiler-errors:rollup-zabvmo5, r=compiler-errors
Rollup of 9 pull requests

Successful merges:

 - #104154 (Change `bindings_with_variant_name` to deny-by-default)
 - #104347 (diagnostics: suggest changing `s@self::{macro}`@::macro`` for exported)
 - #104672 (Unify stable and unstable sort implementations in same core module)
 - #107048 (check for x version updates)
 - #107061 (Implement some more new solver candidates and fix some bugs)
 - #107095 (rustdoc: remove redundant CSS selector `.sidebar .current`)
 - #107112 (Fix typo in opaque_types.rs)
 - #107124 (fix check macro expansion)
 - #107131 (rustdoc: use CSS inline layout for radio line instead of flexbox)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-01-21 04:19:03 +00:00
Michael Goulet 34d4df5bd5
Rollup merge of #107131 - notriddle:notriddle/rustdoc-radio-display-inline-flex, r=GuillaumeGomez
rustdoc: use CSS inline layout for radio line instead of flexbox

This uses less code to lay them out the same way. Already tested here:

5ce39f42bd/tests/rustdoc-gui/settings.goml (L123)
2023-01-20 21:33:24 -05:00
Michael Goulet a4f0126bfa
Rollup merge of #107124 - DebugSteven:check-macro-expansion, r=albertlarsan68
fix check macro expansion

If the only argument to `check!` is the module name I get this error:

```
error: expected expression, found `,`
   --> src/tools/tidy/src/main.rs:63:42
    |
57  | /         macro_rules! check {
58  | |             ($p:ident $(, $args:expr)* ) => {
59  | |                 drain_handles(&mut handles);
60  | |
...   |
63  | |                     $p::check($($args),* , &mut flag);
    | |                                          ^ expected expression
...   |
69  | |             }
70  | |         }
    | |_________- in this expansion of `check!`
...
117 |           check!(hey);
    |           ----------- in this macro invocation
```

This change makes it so commas are added only when there are `args`.

r? ```@albertlarsan68```
2023-01-20 21:33:24 -05:00
Michael Goulet 7168aa5eb1
Rollup merge of #107112 - eltociear:patch-19, r=albertlarsan68
Fix typo in opaque_types.rs

paramters -> parameters
2023-01-20 21:33:23 -05:00
Michael Goulet 7565b9aa4a
Rollup merge of #107095 - notriddle:notriddle/sidebar-current, r=GuillaumeGomez
rustdoc: remove redundant CSS selector `.sidebar .current`

Since the current sidebar item is already a link, it doesn't do anything.
2023-01-20 21:33:23 -05:00
Michael Goulet 3452104715
Rollup merge of #107061 - compiler-errors:new-solver-new-candidates-3, r=lcnr
Implement some more new solver candidates and fix some bugs

First, fix some bugs:

1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix.
2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes!
3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄
4. Check GATs' own predicates during projection confirmation.

Then implement a few builtin traits:

5. Implement `PointerSized`. Pretty independent.
6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test.

r? ```@lcnr```
2023-01-20 21:33:22 -05:00
Michael Goulet d26c88c752
Rollup merge of #107048 - DebugSteven:newer-x-check-cargo, r=albertlarsan68
check for x version updates

This PR adds a check to tidy to assert that the installed version of `x` is equal to the version in `src/tools/x/Cargo.toml`. It checks the installed version of `x` by parsing the output of `cargo install --list` (as an option proposed in this [issue](https://github.com/rust-lang/rust/issues/106469)).

It does not warn if `x` has not yet been installed, on the assumption that the user isn't interested in using it.
2023-01-20 21:33:22 -05:00
Michael Goulet 68b390ae2a
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
Unify stable and unstable sort implementations in same core module

This moves the stable sort implementation to the core::slice::sort module. By virtue of being in core it can't access `Vec`. The two `Vec` used by merge sort, `buf` and `runs`, are modelled as custom types that implement the very limited required `Vec` interface with the help of provided allocation and free functions. This is done to allow future re-use of functions and logic between stable and unstable sort. Such as `insert_head`.

This is in preparation of #100856 and #104116. It only moves code, it *doesn't* change any of the sort related logic. This unlocks the ability to share `insert_head`, `insert_tail`, `swap_if_less` `merge` and more.

Tagging ````@Mark-Simulacrum```` I hope this allows progress on #100856, by moving `merge_sort` here I hope future changes will be easier to review.
2023-01-20 21:33:21 -05:00
Michael Goulet bf75f8177b
Rollup merge of #104347 - notriddle:notriddle/import-macro-from-self-fixup, r=TaKO8Ki
diagnostics: suggest changing `s@self::{macro}@::macro` for exported

Fixes #99695
2023-01-20 21:33:21 -05:00
Michael Goulet e6400693b8
Rollup merge of #104154 - timrobertsdev:deny-by-default-bindings_with_variant_name, r=scottmcm
Change `bindings_with_variant_name` to deny-by-default

Changed the `bindings_with_variant_name` lint to deny-by-default and fixed up the affected tests.

Addresses #103442.
2023-01-20 21:33:20 -05:00
bors 0726909f6d Auto merge of #107139 - rust-lang:pa-bump-git2, r=Mark-Simulacrum
[master] Update git2 version

This PR bumps the version of the `git2` and `libgit2-sys` crates to pull in fixes for https://github.com/rust-lang/git2-rs/security/advisories/GHSA-m4ch-rfv5-x5g3.

This **does not fix any security vulnerability**: Cargo is already protected thanks to the fixes we implemented as part of CVE-2022-46176. The only purpose of this PR is to avoid dependency scanners from flagging vulnerabilities.
2023-01-21 01:18:13 +00:00
Pietro Albini 6f1795a9fa
update git2 dependency 2023-01-21 00:17:15 +01:00