Commit Graph

238323 Commits

Author SHA1 Message Date
Matthias Krüger
cd5b5e08fe
Rollup merge of #115485 - DaniPopes:rustdoc-macro-consts, r=jackh726,fmease
Format macro const literals with pretty printer

Fixes #115295
2023-11-07 19:29:56 +01:00
Rémy Rakic
1d1fe9a205 add note to remember to update a url when bumping to gcc 10.1.0 2023-11-07 18:26:20 +00:00
bjorn3
864973135a Implement all vendor intrinsics used by the simd-json crate 2023-11-07 18:10:12 +00:00
bors
118a2deea5 Auto merge of #117617 - Urgau:bump-libc-0.2.150, r=Mark-Simulacrum
Bump libc dependency

This bumps the `libc` crate to version 0.2.150 which includes https://github.com/rust-lang/libc/pull/3410 which will help remove the old and deprecated check-cfg syntax.

Extracted from https://github.com/rust-lang/rust/pull/117612
2023-11-07 17:18:36 +00:00
Alona Enraght-Moony
434b69a1d6 tests/rustdoc-json: Rewrite tests no not use #![no_core]. 2023-11-07 16:56:03 +00:00
Alona Enraght-Moony
0875f456f1 tests/rustdoc-json: Remove more needless uses of #![no_core].
These were'nt done with regex, but don't require changes to assertions.
2023-11-07 16:40:32 +00:00
Alona Enraght-Moony
f784fa7bd9 tests/rustdoc-json: Remove some needless uses of #![no_core].
Done by removing all uses of `#![no_core]`, and the reverting the ones
that failed. More involved ones are in a later commit.
2023-11-07 16:36:55 +00:00
Ralf Jung
84abf837b8 manually bless a wasm-only test 2023-11-07 17:29:29 +01:00
Hans Wennborg
752a6132e5 llvm-wrapper: Remove include of non-existant Vectorize.h 2023-11-07 16:40:35 +01:00
bors
9bd71afb90 Auto merge of #115904 - notriddle:notriddle/preload-bold, r=GuillaumeGomez
rustdoc: stop preloading Source Serif 4 Bold

According to #91170, italic fonts are not preloaded because they're rarely used, but bold fonts are. This seems to be true of bold Source Code Pro and bold Fira Sans, but bold and italic Source Serif Pro seem to be equally heavily used.

This is, I assume, the result of using Fira Sans Bold and Source Code Bold headings, so you only get bold Serif text when the doc author uses strong `**` emphasis (or within certain kinds of tooltip, which shouldn't be preloaded because they only show up long after the page is loaded).

To check this, run these two commands in the browser console to measure how much they're used. The measurement is extremely rough, but it gets the idea across: the two styles are about equally popular.

    // count bold elements
    Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontWeight > 400 }).length
    // count italic elements
    Array.prototype.slice.call(document.querySelectorAll("*")).filter(x => { const y = document.defaultView.getComputedStyle(x); return y.fontFamily.indexOf("Source Serif 4") !== -1 && y.fontStyle == "italic" }).length

| URL          | Bold | Italic |
|--------------|-----:|-------:|
| [std]        |    2 |      9 |
| [Vec]        |    8 |     89 |
| [regex]      |   33 |     17 |
| [test_suite] |    0 |      0 |

[std]: https://doc.rust-lang.org/nightly/std/index.html
[Vec]: https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html
[regex]: https://docs.rs/regex/1.9.5/regex/index.html
[test_suite]: https://docs.rs/test-suite/3.2.9/test_suite/
2023-11-07 15:14:59 +00:00
Rémy Rakic
d73eaaac5f ci: bump gcc on dist x64 linux builder to 9.5
Support for `-fuse-ld=lld` was added in GCC 9
2023-11-07 14:25:46 +00:00
bjorn3
9f426cef38
Merge pull request #1416 from afonso360/aarch64-intrinsics-1
Implement AArch64 intrinsics necessary for simd-json
2023-11-07 14:38:10 +01:00
bjorn3
ecf79a304a Implement all vendor intrinsics used by the fimg crate 2023-11-07 13:32:11 +00:00
Alex Macleod
f2fd8ad788 Document clippy_config in nightly-rustc docs 2023-11-07 13:21:04 +00:00
bors
187d1afa9d Auto merge of #117297 - clubby789:fn-trait-missing-paren, r=TaKO8Ki
Give a better diagnostic for missing parens in Fn* bounds

Fixes #108109

It would be nice to try and recover here, but I'm not sure it's worth the effort, especially as the bounds on the recovered function would be incorrect.
2023-11-07 13:04:56 +00:00
klensy
eed89185bb bump some deps
drop num_cpus from rust-installer as not used
update rayon, rayon-core, which drops it's deps on num_cpus and crossbeam-channel (for bootstrap too) (https://github.com/rayon-rs/rayon/blob/v1.8.0/RELEASES.md)
update erro, which drops errno-dragonfly (5341791935/CHANGELOG.md)
2023-11-07 15:33:59 +03:00
bors
61a3eea804 Auto merge of #117229 - matthewjasper:thir-unsafeck-fixes, r=cjgillot
Thir unsafeck fixes

- Recognise thread local statics in THIR unsafeck
- Add suggestion for unsafe_op_in_unsafe_fn
- Fix unsafe checking of let expressions
2023-11-07 10:41:10 +00:00
bjorn3
0a35232c85 Implement all vendor intrinsics used by the httparse crate 2023-11-07 09:42:01 +00:00
bjorn3
61e38ceea7 Implement all SSE intrinsics used by the jpeg-decoder crate 2023-11-07 08:59:16 +00:00
bors
114f1f6838 Auto merge of #117610 - compiler-errors:object-hmm, r=aliemjay
Only instantiate binder during dyn's built-in trait candidate probe once

See UI test for demonstration of the issue.

This was "caused" by #117131, but only because we're using the `normalize_param_env` (which has been augmented with a projection clause used to normalize GATs) which features non-lifetime bound vars in it.

Fixes #117602 technically, though that's also fixed by #117542.

r? types
2023-11-07 08:43:08 +00:00
bors
504f63efb0 Auto merge of #117418 - compiler-errors:better_error_body, r=oli-obk
Build a better MIR body when errors are encountered

Doesn't really have much of an effect on its own, but it does lead to a less confusing phony MIR body being generated when an error is detected during THIR/MIR/match building. This was quite confusing when I hacked `-Zunpretty=mir` to emit `mir_built` rather than `instance_mir`.

This coincidentually also fixes #117413, but not as generally as #117416.

cc `@Nadrieril`
2023-11-07 06:42:20 +00:00
Michael Goulet
0add056dee Rework print_disambiguation_help 2023-11-07 05:23:09 +00:00
Michael Goulet
88a37acb26 Yeet MethodCallComponents 2023-11-07 05:13:22 +00:00
bors
4e0fb98a5c Auto merge of #117006 - estebank:issue-69512, r=compiler-errors
When not finding assoc fn on type, look for builder fn

When we have a resolution error when looking at a fully qualified path on a type, look for all associated functions on inherent impls that return `Self` and mention them to the user.

```
error[E0599]: no function or associated item named `new` found for struct `TcpStream` in the current scope
   --> tests/ui/resolve/fn-new-doesnt-exist.rs:4:28
    |
4   |    let stream = TcpStream::new();
    |                            ^^^ function or associated item not found in `TcpStream`
    |
note: if you're trying to build a new `TcpStream` consider using one of the following associated functions:
      TcpStream::connect
      TcpStream::connect_timeout
   --> /home/gh-estebank/rust/library/std/src/net/tcp.rs:156:5
    |
156 |     pub fn connect<A: ToSocketAddrs>(addr: A) -> io::Result<TcpStream> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
172 |     pub fn connect_timeout(addr: &SocketAddr, timeout: Duration) -> io::Result<TcpStream> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Fix #69512.
2023-11-07 02:05:30 +00:00
Esteban Küber
f926031ea5 When not finding assoc fn on type, look for builder fn
When we have a resolution error when looking at a fully qualified path
on a type, look for all associated functions on inherent impls that
return `Self` and mention them to the user.

Fix #69512.
2023-11-07 00:54:10 +00:00
Zalathar
4e6f438d2a coverage: Register test::Coverage as the test suite for tests/coverage
This restores the ability to run a coverage test by specifying its path, e.g.
`./x.py test tests/coverage/if.rs`. This runs the test in both modes.
2023-11-07 11:15:19 +11:00
Zalathar
49127c64d6 coverage: Migrate tests/coverage-map into tests/coverage 2023-11-07 11:15:19 +11:00
Zalathar
e9d04c5e24 coverage: Migrate tests/run-coverage into tests/coverage 2023-11-07 11:15:19 +11:00
Zalathar
aea7c27eae coverage: Set up a macro for declaring unified coverage test suites 2023-11-07 11:15:19 +11:00
Zalathar
3509aed632 coverage: Add ./x.py test coverage, an alias for coverage-map and run-coverage 2023-11-07 11:15:19 +11:00
Zalathar
e585a99230 coverage: Give each coverage test mode a separate output directory
When multiple test modes share the same test directory, this will allow them to
avoid interfering with each others' files and timestamps.
2023-11-07 11:15:19 +11:00
Zalathar
211d4cee8e coverage: Copy all remaining run-coverage tests into coverage-map
These multi-file tests were not copied over in #114843 because they weren't
working, but it turns out that they just need the correct crate-type.
2023-11-07 11:15:19 +11:00
Zalathar
4b76b97bc8 coverage: Copy all remaining coverage-map tests into run-coverage 2023-11-07 11:15:19 +11:00
Zalathar
f5df56b26b coverage: Flatten coverage-map/status-quo/ into its parent directory 2023-11-07 11:15:18 +11:00
Zalathar
8eef39f082 coverage: Remove tests/coverage-map/if.rs
There is another test named `if.rs` in `tests/coverage-map/status-quo/`, so
this test stands in the way of flattening that directory into its parent.

Fortunately both tests are more-or-less equivalent, so removing this one is
fine.
2023-11-07 11:15:18 +11:00
Zalathar
7f8a6de72c coverage: Use -Copt-level=2 by default in run-coverage tests
This is a step towards being able to unify the two coverage test directories.

There are two tests that require adjustment:

- `overflow.rs` requires an explicit `-Coverflow-checks=yes`
- `sort_groups.rs` is sensitive to provably unused instantiations
2023-11-07 11:15:18 +11:00
bors
7b97a5ca84 Auto merge of #117511 - gurry:117406-err-packed-structs, r=compiler-errors
Emit explanatory note for move errors in packed struct derives

Derive expansions for packed structs with non-`Copy` fields cause move errors because they prefer copying over borrowing since borrowing the fields of a packed struct can result in unaligned access.

This underlying cause of the errors, however, is not apparent to the user. This PR adds a diagnostic note to make it clear to the user (the new note is on the second last line):

```
tests/ui/derives/deriving-with-repr-packed-move-errors.rs:13:16
   |
12 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Default)]
   |          ----- in this derive macro expansion
13 | struct StructA(String);
   |                ^^^^^^ move occurs because `self.0` has type `String`, which does not implement the `Copy` trait
   |
   = note: `#[derive(Debug)]` triggers a move because taking references to the fields of a packed struct is undefined behaviour
   = note: this error originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Fixes #117406

Partially addresses #110777
2023-11-07 00:03:53 +00:00
Michael Goulet
5a9f07cc97 Build a better MIR body when errors are encountered 2023-11-06 23:54:53 +00:00
Michael Goulet
171d5587ca Don't instantiate the binder twice when assembling object candidate 2023-11-06 23:41:33 +00:00
Michael Goulet
24e14dd8b4 Only check predicates for late-bound non-lifetime vars in object candidate assembly 2023-11-06 23:25:32 +00:00
bors
189d6c71f3 Auto merge of #117641 - matthiaskrgr:rollup-f9c12td, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #117190 (add test for #113381)
 - #117516 (add test for #113375)
 - #117631 (Documentation cleanup for core::error::Request.)
 - #117637 (Check binders with bound vars for global bounds that don't hold)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-11-06 21:43:55 +00:00
Michael Goulet
c17d33f1df Extend builtin/auto trait args with error when they have >1 argument 2023-11-06 21:29:08 +00:00
Matthias Krüger
9efe60b1eb
Rollup merge of #117637 - lqd:trivial-bounds-with-binder-vars, r=compiler-errors
Check binders with bound vars for global bounds that don't hold

This fixes `soa_derive-0.13.0` from #117589's crater run.

r? `@compiler-errors`
2023-11-06 20:31:56 +01:00
Matthias Krüger
2a1f8bccee
Rollup merge of #117631 - smarnach:error-request-doc-fix, r=ChrisDenton
Documentation cleanup for core::error::Request.

This part of the documentation currently render like this:

![image](https://github.com/rust-lang/rust/assets/249196/b34cb907-4ce4-4e85-beca-510d8aa1fefb)

The new version renders like this:

![image](https://github.com/rust-lang/rust/assets/249196/fe18398a-15fb-42a7-82a4-f1856d48bd79)

Fixes:
* Add missing closing back tick.
* Remove spurious double back ticks.
* Add missing newline to render bullet point correctly.
* Fix grammar "there are methods calledrequest_ref and request_value are available" -> "there are methods calledrequest_ref and request_value".
* Change "methods" to "functions", which seems more appropriate for free functions.
2023-11-06 20:31:55 +01:00
Matthias Krüger
8a34fea835
Rollup merge of #117516 - matthiaskrgr:test_effects_113375_oob, r=fee1-dead
add test for #113375

Fixes #113375

r? `@fee1-dead`
2023-11-06 20:31:55 +01:00
Matthias Krüger
1683df7d3b
Rollup merge of #117190 - matthiaskrgr:test_effects_113381, r=fee1-dead
add test for #113381

Fixes #113381

r? fee1-dead
2023-11-06 20:31:54 +01:00
bors
fb61292105 Auto merge of #117292 - estebank:issue-80446, r=davidtwco
Detect misparsed binop caused by missing semi

When encountering

```rust
foo()
*bar = baz;
```

We currently emit potentially two errors, one for the return type of
`foo` not being multiplicative by the type of `bar`, and another for
`foo() * bar` not being assignable.

We now check for this case and suggest adding a semicolon in the right
place and emit only a single error.

Fix #80446.
2023-11-06 18:46:04 +00:00
Esteban Küber
4b7aacaa4f Silence redundant error on typo resulting on binop 2023-11-06 17:38:06 +00:00
rustbot
bf65e3bddb Update books 2023-11-06 12:00:35 -05:00
Matthew Jasper
868de8e76b Visit patterns in THIR let expressions
This fixes some THIR unsafety checking errors not being emitted for
let expressions in these situations.
2023-11-06 16:23:09 +00:00