Commit Graph

218527 Commits

Author SHA1 Message Date
Markus Everling
9e22516877 Fix VecDeque::shrink_to and add tests.
This adds both a test specific to #108453 as well as an exhaustive test
that goes through all possible combinations of head index, length and target capacity
for a deque with capacity 16.
2023-02-26 03:13:44 +01:00
bors
70fd012439 Auto merge of #108473 - matthiaskrgr:rollup-qjyae58, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #107062 (Do some cleanup of doc/index.md)
 - #107890 (Lint against `Iterator::map` receiving a callable that returns `()`)
 - #108431 (Add regression test for #107918)
 - #108432 (test: drop unused deps)
 - #108436 (make "proc macro panicked" translatable)
 - #108444 (docs/test: add UI test and docs for `E0476`)
 - #108449 (Do not lint ineffective unstable trait impl for unresolved trait)
 - #108456 (Complete migrating `ast_passes` to derive diagnostics)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-26 02:04:23 +00:00
Jason Newcomb
4a2de63ae3 Merge commit '149392b0baa4730c68f3c3eadf5c6ed7b16b85a4' into clippyup 2023-02-25 19:28:50 -05:00
Matthias Krüger
767c865f07
Rollup merge of #108456 - clubby789:ast-passes-diag-migrate, r=compiler-errors
Complete migrating `ast_passes` to derive diagnostics

cc #100717

```@rustbot``` label +A-translation
2023-02-26 00:46:28 +01:00
Matthias Krüger
a223ff7cea
Rollup merge of #108449 - fee1-dead-contrib:do_not_lint_unresolved, r=compiler-errors
Do not lint ineffective unstable trait impl for unresolved trait
2023-02-26 00:46:28 +01:00
Matthias Krüger
65eecc6b59
Rollup merge of #108444 - Ezrashaw:add-test+docs-for-e0476, r=GuillaumeGomez
docs/test: add UI test and docs for `E0476`

Final undocumented error code. Not entirely sure about wording in the docs.

Part of https://github.com/rust-lang/rust/issues/61137.

r? ```@compiler-errors```

cc ```@compiler-errors```
2023-02-26 00:46:28 +01:00
Matthias Krüger
9631f4b5c9
Rollup merge of #108436 - tshepang:translatable-proc-macro-panicked, r=estebank
make "proc macro panicked" translatable
2023-02-26 00:46:27 +01:00
Matthias Krüger
4ab1c74b77
Rollup merge of #108432 - klensy:test-deps, r=Mark-Simulacrum
test: drop unused deps

Looks unused. Anyway, tests should catch any breakage.
2023-02-26 00:46:26 +01:00
Matthias Krüger
5196e9114c
Rollup merge of #108431 - GuillaumeGomez:regression-test-for-107918, r=notriddle
Add regression test for #107918

Fixes https://github.com/rust-lang/rust/issues/107918.

r? ```@notriddle```
2023-02-26 00:46:26 +01:00
Matthias Krüger
fa10a21bd2
Rollup merge of #107890 - obeis:mapping-to-unit, r=cjgillot
Lint against `Iterator::map` receiving a callable that returns `()`

Close #106991
2023-02-26 00:46:25 +01:00
Matthias Krüger
f840799385
Rollup merge of #107062 - tgross35:update-doc-index, r=ehuss
Do some cleanup of doc/index.md

I think a lot of people get to this landing page from `rustup doc`, and it's a bit tricky to find some useful information. I attempted to clean it up here a bit, from the commit message:

- Add quick link to API docs
- Add marker for external links, to help offline users
- Add information about using 'cargo doc' and the playground
- Clean up some of the wording
- Update body & header style to match rustdoc defaults
- Bump heading levels so main page header is 1, others are 2 (all were level 1 before)
2023-02-26 00:46:25 +01:00
bors
149392b0ba Auto merge of #10402 - Jarcho:rustup, r=Jarcho
Rustup

Looks like `@flip1995`  is busy.

r? `@ghost`

changelog: None
2023-02-25 23:34:06 +00:00
bors
f37f9f6512 Auto merge of #108464 - compiler-errors:rollup-trl1g70, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #105736 (Test that the compiler/library builds with validate-mir)
 - #107291 ([breaking change] Remove a rustdoc back compat warning)
 - #107675 (Implement -Zlink-directives=yes/no)
 - #107848 (Split `x setup` sub-actions to CLI arguments)
 - #107911 (Add check for invalid #[macro_export] arguments)
 - #108229 ([107049] Recognise top level keys in config.toml.example)
 - #108333 (Make object bound candidates sound in the new trait solver)

Failed merges:

 - #108337 (hir-analysis: make a helpful note)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-25 23:15:10 +00:00
Jason Newcomb
69c4ff6df8 Emit unnecessary_def_path in source order. 2023-02-25 18:09:24 -05:00
Jason Newcomb
e825adf637 Fix normalization of custom_ice_message test. 2023-02-25 18:08:51 -05:00
bors
51551193d8 Auto merge of #10401 - samueltardieu:issue-10148, r=Alexendoo
Do not panic when analyzing the malformed origin of a format string

Fixes #10148. This will trigger only when generating format strings while accepting weird things in a procedural macro and setting the span to something which is not a string.

changelog: none
2023-02-25 23:05:23 +00:00
Samuel Tardieu
64775f30c2 Do not panic when analyzing the malformed origin of a format string 2023-02-25 23:48:17 +01:00
Jason Newcomb
5552f4a6b5 Bump nightly version -> 2023-02-25 2023-02-25 17:44:05 -05:00
Jason Newcomb
bc184e9c7d Merge branch 'master' into rustup 2023-02-25 17:43:19 -05:00
Tshepang Mbambo
e5d1fcd535 hir-analysis: make a helpful note 2023-02-26 00:01:44 +02:00
John Kåre Alsaker
b897b2d65c Update tests 2023-02-25 21:43:25 +01:00
Michael Goulet
53fb433652 Special note for str in auto traits 2023-02-25 20:01:33 +00:00
Michael Goulet
3560e65c44 Treat str as containing [u8] for auto trait purposes 2023-02-25 20:01:33 +00:00
Michael Goulet
4723a9ad14
Rollup merge of #108333 - compiler-errors:new-solver-object-sound, r=lcnr
Make object bound candidates sound in the new trait solver

r? `@lcnr`
2023-02-25 11:53:11 -08:00
Michael Goulet
0b6b373f48
Rollup merge of #108229 - lionellloh:issue-107049, r=Mark-Simulacrum
[107049] Recognise top level keys in config.toml.example

Closes #107049

Test Plan

Configure changelog-seen
```
lionellloh@lionellloh-mbp rust % ./configure --set changelog-seen=1
configure: processing command line
configure:
configure: changelog-seen       := 1
configure: build.configure-args := ['--set', 'changelog-seen=1']
configure:
configure: writing `config.toml` in current directory
configure:
configure: run `python /Users/lionellloh/rust/x.py --help`
lionellloh@lionellloh-mbp rust % diff config.toml config.toml.example
16c16
< changelog-seen = 1
---
> changelog-seen = 2
331c331
< configure-args = ['--set', 'changelog-seen=1']
---
> #configure-args = []
675c675
< [target.x86_64-apple-darwin]
---
> [target.x86_64-unknown-linux-gnu]
809d808
<
```

Configure profile

```
lionellloh@lionellloh-mbp rust % ./configure --set profile=xyz
configure: processing command line
configure:
configure: profile              := xyz
configure: build.configure-args := ['--set', 'profile=xyz']
configure:
configure: writing `config.toml` in current directory
configure:
configure: run `python /Users/lionellloh/rust/x.py --help`
lionellloh@lionellloh-mbp rust % diff config.toml config.toml.example
26c26
< profile = xyz
---
> #profile = <none>
331c331
< configure-args = ['--set', 'profile=xyz']
---
> #configure-args = []
675c675
< [target.x86_64-apple-darwin]
---
> [target.x86_64-unknown-linux-gnu]
809d808
<
```
2023-02-25 11:53:10 -08:00
Michael Goulet
cf049ac2af
Rollup merge of #107911 - blyxyas:issue-107231-fix, r=compiler-errors
Add check for invalid #[macro_export] arguments

Resolves #107231
Sorry if I made something wrong, this is my first contribution to the repo.
2023-02-25 11:53:10 -08:00
Michael Goulet
390551716a
Rollup merge of #107848 - clubby789:x-setup-options, r=Mark-Simulacrum
Split `x setup` sub-actions to CLI arguments

Closes #107846

This adds a new `none` profile option which simply skips the `config.toml` step. It also adds `hook` and `vscode` subcommands, for installing the pre-push hook and getting `settings.json` respectively.
2023-02-25 11:53:09 -08:00
Michael Goulet
1a599d7d97
Rollup merge of #107675 - jsgf:link-directives, r=davidtwco
Implement -Zlink-directives=yes/no

`-Zlink-directives=no` will ignored `#[link]` directives while compiling a crate, so nothing is emitted into the crate's metadata.  The assumption is that the build system already knows about the crate's native dependencies and can provide them at link time without these directives.

This is another way to address issue # #70093, which is currently addressed by `-Zlink-native-libraries` (implemented in #70095). The latter is implemented at link time, which has the effect of ignoring `#[link]` in *every* crate. This makes it a very large hammer as it requires all native dependencies to be known to the build system to be at all usable, including those in sysroot libraries. I think this means its effectively unused, and definitely under-used.

Being able to control this on a crate-by-crate basis should make it much easier to apply when needed.

I'm not sure if we need both mechanisms, but we can decide that later.

cc `@pcwalton` `@cramertj`
2023-02-25 11:53:09 -08:00
Michael Goulet
a4119ba0ae
Rollup merge of #107291 - oli-obk:rustdoc_breaking_change, r=estebank
[breaking change] Remove a rustdoc back compat warning

This warning was introduced in https://github.com/rust-lang/rust/pull/62855 for users who use `rustdoc` directly on proc macro crates (instead of using `cargo doc`) without passing `--crate-type proc-macro` (which `cargo doc` passed automatically).
2023-02-25 11:53:08 -08:00
Michael Goulet
b90a385f26
Rollup merge of #105736 - chenyukang:yukang/add-mir-opt-level-testing, r=jyn514
Test that the compiler/library builds with validate-mir

Fixes #105706
2023-02-25 11:53:08 -08:00
Michael Goulet
0f4a7d174e Make clippy happy 2023-02-25 19:46:36 +00:00
Michael Goulet
c0e58c3420 Add ErrorGuaranteed to HIR ExprKind::Err 2023-02-25 19:46:36 +00:00
Michael Goulet
a772a6fc2a Add ErrorGuaranteed to HIR TyKind::Err 2023-02-25 19:46:36 +00:00
bors
34e6673a04 Auto merge of #107405 - hermitcore:bsd, r=bjorn3
add support of RustyHermit's BSD socket layer

RustyHermit is a tier 3 platform and publishes a new kernel interface. The new version supports a common BSD socket layer. By supporting this interface, the implementation of `std` can be harmonized to other operating systems. In `sys_common/mod.rs` we remove only a special case for RustyHermit. All changes are done in the RustyHermit specific directories.

To realize this socket layer, the handling of file descriptors is also harmonized to other operating systems.
2023-02-25 19:43:00 +00:00
clubby789
b30d0da6f3 Update the output of the check descriptions 2023-02-25 19:18:51 +00:00
Nicole Mazzuca
7f25580512 [stdio][windows] Use MBTWC and WCTMB 2023-02-25 11:15:23 -08:00
pommicket
12f959ba39 Add test for VecDeque::append ZST capacity overflow 2023-02-25 13:50:56 -05:00
bors
31448badfd Auto merge of #108450 - matthiaskrgr:rollup-rqvfgu3, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #108354 (Update `fuchsia-test-runner.py` and docs)
 - #108404 (support `x fmt` for sub and outside of rust directories)
 - #108407 (docs: use intra-doc links for `Vec::get(_mut)`)
 - #108410 (rustdoc: avoid including `<li>` tags in item table short desc)
 - #108412 (Fix GUI test navigation bug)
 - #108433 (Wrap missing provider message correctly)
 - #108434 (Migrate `rustc_hir_analysis` to session diagnostic [Part One])

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-02-25 16:48:04 +00:00
bors
ffd12f67cf Auto merge of #2798 - LevitatingLion:master, r=oli-obk
Get Miri working on ARM

- Add a shim for `llvm.arm.hint`, which is required by `core::hint::spin_loop` on `arm` targets. The shim simply calls `yield_active_thread` on a YIELD hint, just like the shim for `llvm.aarch64.isb` that's already present.
- Change the signature of `miri_host_to_target_path` to use `c_char` instead of `i8`, to make it compatible with `CStr` on targets where `c_char` is unsigned. The implementation of `miri_host_to_target_path` accesses the memory as bytes and does not need to be adjusted.
- Enable ARM targets in CI. Specifically, `aarch64-unknown-linux-gnu` and `arm-unknown-linux-gnueabi` on the Linux host.

Since all tests also pass for `aarch64-unknown-linux-gnu` I took the liberty of adding that target to CI as well.

Fixes #2791
2023-02-25 16:45:50 +00:00
Camille GILLOT
bf46b9cb28 Explain that this is UB catching instead of malformed MIR. 2023-02-25 16:29:06 +00:00
Camille GILLOT
9aa4f6acb2 MIR-Validate StorageLive. 2023-02-25 16:27:10 +00:00
pommicket
379b18bb0a Use checked_add in VecDeque::append for ZSTs to avoid overflow 2023-02-25 11:05:21 -05:00
Michael Howell
96e6fb6c57
Update search eBNF with ! moved
Co-Authored-By: GuillaumeGomez <guillaume1.gomez@gmail.com>
2023-02-25 08:20:53 -07:00
clubby789
885f9e72d7 Complete migrating ast_passes to derive diagnostics 2023-02-25 15:19:13 +00:00
bors
dcca6a375b Auto merge of #108250 - nnethercote:rename-interner-funcs, r=compiler-errors
Rename interner funcs

This PR cleans up some inconsistencies in interner naming.

Best reviewed one commit at a time.

r? `@compiler-errors`
2023-02-25 13:55:26 +00:00
Camille GILLOT
40bde9902c Address review. 2023-02-25 13:43:21 +00:00
Guillaume Gomez
c934ee8300 Don't run issue-107918.rs test on windows 2023-02-25 12:12:21 +01:00
Matthias Krüger
2aad179b4e
Rollup merge of #108434 - obeis:hir-analysis-migrate-diagnostics, r=Nilstrieb
Migrate `rustc_hir_analysis` to session diagnostic [Part One]

Finishing `lib.rs` file
Updates #100717
r? ``@davidtwco``
2023-02-25 11:31:35 +01:00
Matthias Krüger
a4740a1922
Rollup merge of #108433 - compiler-errors:missing-provider-nit, r=Nilstrieb
Wrap missing provider message correctly

Fixes #108429

```
error: internal compiler error: compiler/rustc_middle/src/ty/query.rs:441:1: `tcx.trigger_delay_span_bug(DefId(0:3 ~ test[78c5]::main))` is not supported for local crate;
                                hint: Queries can be either made to the local crate, or the external crate. This error means you tried to use it for one that's not supported.
                                If that's not the case, trigger_delay_span_bug was likely never assigned to a provider function.

thread 'rustc' panicked at 'Box<dyn Any>', /home/ec2-user/rust3/compiler/rustc_errors/src/lib.rs:1651:9
stack backtrace:
   0:     0x7f51870926d7 - std::backtrace_rs::backtrace::libunwind::trace::hb0876bb39e7adf0d
                               at /home/ec2-user/rust3/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f51870926d7 - std::backtrace_rs::backtrace::trace_unsynchronized::h1bcab1313827007b
                               at /home/ec2-user/rust3/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5187077e07 - std::sys_common::backtrace::_print_fmt::h262d2a62279fa102
                               at /home/ec2-user/rust3/library/std/src/sys_common/backtrace.rs:65:5
```
2023-02-25 11:31:34 +01:00
Matthias Krüger
47c7d53fe6
Rollup merge of #108412 - GuillaumeGomez:fix-gui-test-navigation-bug, r=notriddle
Fix GUI test navigation bug

Following https://github.com/GuillaumeGomez/browser-UI-test/pull/438, we can now remove this `wait-for`.

Should help with #93784.

r? ``@notriddle``
2023-02-25 11:31:34 +01:00