Commit Graph

230441 Commits

Author SHA1 Message Date
Matthias Krüger
0ed5f091a6
Rollup merge of #112508 - compiler-errors:trait-sig-lifetime-sugg-ice, r=cjgillot
Tweak spans for self arg, fix borrow suggestion for signature mismatch

1. Adjust a suggestion message that was annoying me
2. Fix #112503 by recording the right spans for the `self` part of the `&self` 0th argument
3. Remove the suggestion for adjusting a trait signature on type mismatch, bc that's gonna probably break all the other impls of the trait even if it fixes its one usage 😅
2023-07-22 19:57:35 +02:00
bors
c39995485f Auto merge of #113853 - cjgillot:split-validator, r=compiler-errors
Reuse the MIR validator for MIR inlining

Instead of having the inliner home-cook its own validation, we just check that the substituted MIR body passes the regular validation.

The MIR validation is first split in two: control flow validation (MIR syntax and CFG invariants) and type validation (subtyping relationship in assignments and projections). Only the latter can be affected by instantiating type parameters.
2023-07-22 16:59:23 +00:00
yukang
d46804c62a Fix test panics for submodule of book is not updated 2023-07-23 00:53:39 +08:00
bors
c99bb3c782 Auto merge of #15281 - tetsuharuohzeki:split-ci-steps, r=lnicola
editor/code: Break down CI steps to know what is failing easily

This do the thing I mentioned in https://github.com/rust-lang/rust-analyzer/pull/15265#issuecomment-1634424385

This aims to improve CI status check more readable.

I tried to use [`jobs.<job_id>.if`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif) to make the configuration
more shortly once.

But it could not fire the `end-success` or `end-failure` status if some jobs in the workflow were skipped. This causes an integration problem with bors.

By their reasons, this patch still uses `jobs.<job_id>.steps[*].if`.

---

To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
2023-07-22 16:53:21 +00:00
Tetsuharu Ohzeki
5cca093fa8 editor/code: Break down CI steps to know what is failing easily
To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically
because ESLint's autofix doees not follow prettier's formatting.
So we need to run `npm run lint:fix && npm run format` by this order.
2023-07-23 01:51:57 +09:00
Ben Kimock
65e52bb26c Add #[inline] to core debug assertion helpers 2023-07-22 12:07:06 -04:00
Michael Goulet
e32011209d Get rid of subst-relate incompleteness in new solver 2023-07-22 15:33:37 +00:00
Michael Goulet
c0c2d39668 Don't call a type uncallable if its signature has errors in it 2023-07-22 15:27:21 +00:00
Michael Goulet
7b962d7543 Support interpolated block for try and async 2023-07-22 15:22:12 +00:00
bors
ab0f3e680e Auto merge of #113960 - bjorn3:sync_cg_clif-2023-07-22, r=bjorn3
Sync rustc_codegen_cranelift

This time Cranelift has been updated to 0.98. A couple of bugs have been fixed and a decent amount of x86 vendor intrinsics have been implemented.

r? `@ghost`

`@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-07-22 15:09:09 +00:00
bors
b17be2720a Auto merge of #15277 - 1Kinoti:pub-assist, r=lowr
limit `change_visibility` assist to applicable items

this pr limits the `change_visibility` assist to applicable items. top level items in this context means items that are not nested within `fn`s or `trait`s.

now
```rs
fn foo {
    // assists on this `struct` keyword won't include `change_visibility`
    struct Bar {}
}

trait Foo {
   // same with the `fn` here
   fn bar();
}
```
2023-07-22 15:02:15 +00:00
1Kinoti
65823b0c74 limit change_visibility assist to applicable items 2023-07-22 17:16:51 +03:00
bjorn3
8ffa34ad4e Fix tidy error 2023-07-22 13:47:39 +00:00
bjorn3
36708123c1 Merge commit '1eded3619d0e55d57521a259bf27a03906fdfad0' into sync_cg_clif-2023-07-22 2023-07-22 13:32:34 +00:00
bors
8164cdb9ee Auto merge of #113746 - clarfonthey:ip_bits, r=thomcc
Add BITS, from_bits, to_bits to IP addresses

ACP: rust-lang/libs-team#235
Tracking issue: #113744
2023-07-22 13:18:50 +00:00
Guillaume Gomez
d4ce83c385 Migrate GUI colors test to original CSS color format 2023-07-22 14:01:23 +02:00
bjorn3
1eded3619d Update to Cranelift 0.98 2023-07-22 11:32:25 +00:00
bors
42f5419dd2 Auto merge of #113954 - matthiaskrgr:rollup-e2r9suz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #112490 (Remove `#[cfg(all())]` workarounds from `c_char`)
 - #113252 (Update the tracking issue for `const_cstr_from_ptr`)
 - #113442 (Allow limited access to `OsString` bytes)
 - #113876 (fix docs & example for `std::os::unix::prelude::FileExt::write_at`)
 - #113898 (Fix size_hint for EncodeUtf16)
 - #113934 (Multibyte character removal in String::pop and String::remove doctests)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-07-22 11:30:18 +00:00
bjorn3
ebe2825966 Fix rustc test suite 2023-07-22 11:27:49 +00:00
bjorn3
4eabaf331f Rustup to rustc 1.73.0-nightly (0308df23e 2023-07-21) 2023-07-22 11:11:45 +00:00
Urgau
ffa4b6f422 Add regression test for issue #113941 - naive layout isn't refined 2023-07-22 13:02:59 +02:00
Lukas Markeffsky
237ed1630f add tests for broken links in unused doc strings 2023-07-22 13:02:49 +02:00
bjorn3
a8a722f211 Sync from rust 0308df23e6 2023-07-22 10:54:06 +00:00
Lukas Markeffsky
bb98f3ad4d fix doc links on extern crate items 2023-07-22 12:27:25 +02:00
León Orell Valerian Liehr
5924043b86
rustdoc: handle cross-crate RPITITs correctly 2023-07-22 12:20:17 +02:00
Lukas Markeffsky
9ebd8095fa fix doc links on use items 2023-07-22 12:14:26 +02:00
Lukas Markeffsky
a342617059 improve debuggability 2023-07-22 11:54:28 +02:00
Matthias Krüger
37cd63431c
Rollup merge of #113934 - ajtribick:string-pop-remove-multibyte, r=thomcc
Multibyte character removal in String::pop and String::remove doctests

I think it would be useful to have the doctests for the `String::pop()` and `String::remove()` methods demonstrate that they work on multibyte UTF-8 sequences.
2023-07-22 11:48:55 +02:00
Matthias Krüger
65b5cba0dd
Rollup merge of #113898 - ajtribick:encode_utf16_size_hint, r=cuviper
Fix size_hint for EncodeUtf16

More realistic upper and lower bounds, and handle the case where the iterator is located within a surrogate pair.

Resolves #113897
2023-07-22 11:48:54 +02:00
Matthias Krüger
746d507c72
Rollup merge of #113876 - darklyspaced:master, r=cuviper
fix docs & example for `std::os::unix::prelude::FileExt::write_at`

 Changelog:
 * used `File::create` instead of `File::read` to get a writeable file
 * explicity mentioned the bug with `pwrite64` in docs

Unfortunately, I don't think that there is really much we can do about this since the feature has already been stabilised.

We could potentially add a clippy lint warning people on Linux that using `write_at` with the `O_APPEND` flag does not exhibit the behaviour that they would have assumed.

fixes #113627
2023-07-22 11:48:54 +02:00
Matthias Krüger
0877d11e8d
Rollup merge of #113442 - epage:osstring, r=cuviper
Allow limited access to `OsString` bytes

This extends #109698 to allow no-cost conversion between `Vec<u8>` and `OsString` as suggested in feedback from `os_str_bytes` crate in #111544.
2023-07-22 11:48:53 +02:00
Matthias Krüger
58a4be1dfb
Rollup merge of #113252 - tgross35:const-cstr-from-ptr-tracking-issue, r=ChrisDenton
Update the tracking issue for `const_cstr_from_ptr`

Tracking issue #101719 was for `const_cstr_methods`, #113219 is a new issue specific for `const_cstr_from_ptr`.

(I believe #101719 could also be closed)

```@rustbot``` label +T-libs-api +A-docs
2023-07-22 11:48:53 +02:00
Matthias Krüger
6003d6b60b
Rollup merge of #112490 - Alexendoo:c-char-cfg-all, r=cuviper
Remove `#[cfg(all())]` workarounds from `c_char`

Casts to type aliases are now ignored by Clippy https://github.com/rust-lang/rust-clippy/pull/8596

Closes https://github.com/rust-lang/rust-clippy/issues/8093
2023-07-22 11:48:52 +02:00
bors
dcb810414e Auto merge of #113224 - zachs18:vec_extend_remove_allocator_lifetime, r=cuviper
Remove lifetime bound for A for `impl Extend<&'a T> for Vec<T, A>`.

The lifetime of the references being copied from is unrelated to the allocator.

Compare with [`impl<'a, T: 'a + Copy, A: Allocator> Extend<&'a T> for VecDeque<T, A>`](https://doc.rust-lang.org/alloc/collections/vec_deque/struct.VecDeque.html#impl-Extend%3C%26'a+T%3E-for-VecDeque%3CT,+A%3E) which does not have the `A: 'a` bound already.

Since `Allocator` is unstable, the only possible `A` on stable is `Global`, and `Global: 'static`, so this change is not (should not be) observable on stable (or without `#![feature(allocator_api)]`). [This is observable on nightly](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8c4aa166c6116a90593d2934d30cfeb3).
2023-07-22 09:44:50 +00:00
Camille GILLOT
b8701ff9d3 Remove Scope::Elision. 2023-07-22 08:32:53 +00:00
bors
a317fa865c Auto merge of #15325 - HKalbasi:mir, r=flodiebold
Normalize expected ty in call arguments

fix #15321

I'm not sure if we should do this, or add a normalize in the beginning of `infer_expr_inner`, or somewhere else. r? `@lowr`
2023-07-22 08:14:06 +00:00
bors
16cddb38d9 Auto merge of #2988 - rust-lang:rustup-2023-07-22, r=oli-obk
Automatic sync from rustc
2023-07-22 07:39:43 +00:00
yukang
c0156f1b2c Fix rustc-args passing issue in bootstrap 2023-07-22 15:29:42 +08:00
bors
e0922fba67 Auto merge of #113033 - JohnTitor:stabilize-unix-chown, r=cuviper
Stabilize chown functions (`unix_chown`)

Closes #88989
FCP is complete here: https://github.com/rust-lang/rust/issues/88989#issuecomment-1561125635
2023-07-22 07:27:01 +00:00
The Miri Conjob Bot
32198e1b5c fmt 2023-07-22 06:36:56 +00:00
The Miri Conjob Bot
bd1e4eeaea Merge from rustc 2023-07-22 06:34:13 +00:00
The Miri Conjob Bot
6e3932e10d Preparing for merge from rustc 2023-07-22 06:25:15 +00:00
bors
a8765525fb Auto merge of #113946 - dtolnay:revertniche, r=oli-obk
Revert "Prototype: Add unstable `-Z reference-niches` option"

Clean revert of #113166. I confirmed this fixes #113941.
2023-07-22 05:44:21 +00:00
David Tolnay
5bbf0a8306
Revert "Auto merge of #113166 - moulins:ref-niches-initial, r=oli-obk"
This reverts commit 557359f925, reversing
changes made to 1e6c09a803.
2023-07-21 22:35:57 -07:00
Alex Zepeda
302ad2175d rust-installer: Use env(1) in the shebang.
This fixes the case (e.g. *BSD) where bash is installed on the host
system, but not at the typical location of /bin.
2023-07-21 17:55:49 -07:00
bors
a5e2eca40e Auto merge of #112699 - bluebear94:mf/more-is-sorted-tests, r=cuviper
Add more comprehensive tests for is_sorted and friends

See #53485 and #55045.
2023-07-21 23:25:04 +00:00
Andrew Tribick
f777339af3 Clarify logic on bytes:code units ratio 2023-07-21 23:49:31 +02:00
Andrew Tribick
2c145982a5 Demonstrate multibyte character removal in String::pop and String::remove doctests 2023-07-21 23:40:55 +02:00
hkalbasi
b7d91ca5b2 Normalize expected ty in call arguments 2023-07-22 01:06:58 +03:30
bors
0308df23e6 Auto merge of #97550 - ojeda:comment-section, r=bjorn3
[RFC] Support `.comment` section like GCC/Clang (`!llvm.ident`)

Both GCC and Clang write by default a `.comment` section with compiler information:

```txt
$ gcc -c -xc /dev/null && readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  GCC: (GNU) 11.2.0

$ clang -c -xc /dev/null && readelf -p '.comment' null.o

String dump of section '.comment':
  [     1]  clang version 14.0.1 (https://github.com/llvm/llvm-project.git c62053979489ccb002efe411c3af059addcb5d7d)
```

They also implement the `-Qn` flag to avoid doing so:

```txt
$ gcc -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!

$ clang -Qn -c -xc /dev/null && readelf -p '.comment' null.o
readelf: Warning: Section '.comment' was not dumped because it does not exist!
```

So far, `rustc` only does it for WebAssembly targets and only when debug info is enabled:

```txt
$ echo 'fn main(){}' | rustc --target=wasm32-unknown-unknown --emit=llvm-ir -Cdebuginfo=2 - && grep llvm.ident rust_out.ll
!llvm.ident = !{!27}
```

The RFC part of this PR is about which behavior should `rustc` follow:
  - Always add it.
  - Add it by default, i.e. have an opt-out flag (GCC, Clang).
  - Have an opt-in flag.
  - Never add it (current).

There is also the question of whether debug info being enabled matters for that decision, given the current behavior of WebAssembly targets.

For instance, adding it by default gets us closer to other popular compilers, but that may surprise some users with an information leak. The most conservative option is to only do so opt-in, even if debug info is enabled (some users may be stripping debug info and not expecting something else to be leaked elsewhere).

Implementation-wise, this covers both `ModuleLlvm::new()` and `ModuleLlvm::new_metadata()` cases by moving the addition to `context::create_module` and adds a few test cases.

ThinLTO also sees the `llvm.ident` named metadata duplicated (in temporary outputs), so this deduplicates it like it is done for `wasm.custom_sections`. The tests also check this duplication does not take place.
2023-07-21 21:17:27 +00:00