Commit Graph

218626 Commits

Author SHA1 Message Date
Jakub Beránek
c5d65aa580
Apply BOLT optimizations without rebuilding LLVM 2023-03-04 16:37:40 +01:00
bors
276b75a843 Auto merge of #108732 - Dylan-DPC:rollup-dy1l8sx, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #108298 (Fix ICE: check if snippet is `)`)
 - #108405 (Lazily compute crate name for consider_optimizing)
 - #108656 (Rustdoc search: Emit an error for unclosed generic)
 - #108660 (Remove ne implementations from strings)
 - #108669 (Allow checking whether a type allows being uninitialized)
 - #108727 (rustc_expand: make proc-macro derive error translatable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-04 11:44:02 +00:00
Dylan DPC
0965c7e0a9
Rollup merge of #108727 - tshepang:example-translatable-diagnostic, r=Nilstrieb
rustc_expand: make proc-macro derive error translatable

kept this tiny so as to point to it as an example in rustc-dev-guide

`@rustbot` label +A-translation
2023-03-04 15:24:40 +05:30
Dylan DPC
6ce78a31d8
Rollup merge of #108669 - Nilstrieb:query-my-uninitness, r=compiler-errors
Allow checking whether a type allows being uninitialized

This is useful for clippy ([rust-lang/clippy#10407](https://github.com/rust-lang/rust-clippy/issues/10407)) and for the future `MaybeUninit::assume_init` panics (#100423).
2023-03-04 15:24:39 +05:30
Dylan DPC
e700d02374
Rollup merge of #108660 - xfix:remove-ne-method-from-str, r=thomcc
Remove ne implementations from strings

As far as I can tell, there isn't really a reason for those.
2023-03-04 15:24:39 +05:30
Dylan DPC
2fc4935cdb
Rollup merge of #108656 - GuillaumeGomez:rustdoc-search-unclosed-generic, r=notriddle
Rustdoc search: Emit an error for unclosed generic

Now, search like `a<` will error as it should (and as written in the eBNF).

r? `@notriddle`
2023-03-04 15:24:38 +05:30
Dylan DPC
832dab3798
Rollup merge of #108405 - Nilstrieb:lazy-crate-name-optimization-fuel, r=WaffleLapkin
Lazily compute crate name for consider_optimizing

The extra query is unnecessary in the common case of not having fuel.
2023-03-04 15:24:37 +05:30
Dylan DPC
035aa2816a
Rollup merge of #108298 - TaKO8Ki:fix-104440, r=cjgillot
Fix ICE: check if snippet is `)`

Fixes #107705
2023-03-04 15:24:37 +05:30
bors
01b7a6a9ea Auto merge of #108689 - compiler-errors:normalization-error-smaller, r=lcnr
Remove `NormalizationError::ConstantKind`

No longer in use by `TryNormalizeAfterErasingRegionsFolder` (as of #102355 / e8150fa60c it seems). It's making `LayoutError`, etc. kinda large -- that was noticed by `@zoxc.`
2023-03-04 09:03:23 +00:00
Tshepang Mbambo
7fe4f0701c rustc_expand: make proc-macro derive error translatable 2023-03-04 07:54:29 +02:00
bors
0fbfc3e769 Auto merge of #89518 - a1phyr:unix_file_vectored_at, r=workingjubilee
Add vectored positioned I/O on Unix

Add methods for vectored I/O with an offset on `File` for `unix` under `#![feature(unix_file_vectored_at)]`.

The new methods are wrappers around `preadv` and `pwritev`.

Tracking issue: #89517
2023-03-04 05:26:35 +00:00
bors
70adb4e5b4 Auto merge of #108709 - matthiaskrgr:rollup-j2tjbyx, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #104549 (add -Zexport-executable-symbols to unstable book)
 - #108292 (Label opaque type for 'captures lifetime' error message)
 - #108540 (Add `Atomic*::from_ptr`)
 - #108634 (Add link to component dashboard)
 - #108647 (Remove dead pgo.sh file)
 - #108678 (Use `Option::as_slice` where applicable)
 - #108681 (Improve comments in `needs_process_obligation`.)
 - #108688 (Match unmatched backticks in library/)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-03 22:45:58 +00:00
bors
44cfafe2fa Auto merge of #108707 - matthiaskrgr:rollup-9a2l6pc, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #107981 (new solver: implement canonicalization and region constraints)
 - #108553 (Deny capturing late-bound non-lifetime param in anon const)
 - #108599 (Remove legacy PM leftovers)
 - #108667 (Fix another ICE in `point_at_expr_source_of_inferred_type`)
 - #108674 (Clippy Fix array-size-threshold config deserialization error)
 - #108685 (Match unmatched backticks in compiler/)
 - #108694 (Match unmatched backticks in compiler/ comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-03 19:57:10 +00:00
Guillaume Gomez
823671589f Add test for unclosed generic 2023-03-03 20:49:25 +01:00
Guillaume Gomez
51e976948d Emit an error for unclosed generic 2023-03-03 20:49:25 +01:00
Matthias Krüger
7a228ce9a6
Rollup merge of #108688 - est31:backticks_matchmaking_library, r=jyn514
Match unmatched backticks in library/

Found with GNU grep:

```
grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' library/ | rg -v '\s*[//]?.{1,2}```'
```

split out from #108685 as per advice.
2023-03-03 20:45:03 +01:00
Matthias Krüger
37bd50eddd
Rollup merge of #108681 - nnethercote:needs_process_obligation-comments, r=lqd
Improve comments in `needs_process_obligation`.

And a couple of other places.

r? `@lqd`
2023-03-03 20:45:02 +01:00
Matthias Krüger
efc79bc654
Rollup merge of #108678 - llogiq:use-option-as-slice, r=Nilstrieb
Use `Option::as_slice` where applicable

After #105871 introduced `Option::as_slice`, this PR uses it within the compiler. I found it interesting that all cases where `as_slice` could be used were done with different code before; so it seems the new API also has the benefit of being "the obvious solution" where before there was a mix of options, none clearly better than the rest.
2023-03-03 20:45:02 +01:00
Matthias Krüger
dadfbb6a4b
Rollup merge of #108647 - nikic:pgo-sh, r=jyn514
Remove dead pgo.sh file

This has been replaced by stage-build.py.
2023-03-03 20:45:01 +01:00
Matthias Krüger
7a0fc8e35e
Rollup merge of #108634 - SUPERCILEX:patch-1, r=JohnTitor
Add link to component dashboard

It's a pain to find otherwise.
2023-03-03 20:45:01 +01:00
Matthias Krüger
041f6668b5
Rollup merge of #108540 - WaffleLapkin:atomic_thingy_from_thingy_pointer, r=m-ou-se
Add `Atomic*::from_ptr`

This PR adds functions in the following form to all atomic types:
```rust
impl AtomicT {
    pub const unsafe fn from_ptr<'a>(ptr: *mut T) -> &'a AtomicT;
}
```
r? `@m-ou-se` (we've talked about it before)

I'm not sure about docs & safety requirements, I'd appreciate some feedback on them.
2023-03-03 20:45:00 +01:00
Matthias Krüger
188ed14ca3
Rollup merge of #108292 - compiler-errors:opaque-captures-where, r=oli-obk
Label opaque type for 'captures lifetime' error message

Providing more information may help make this somewhat opaque (lol) error message a bit clearer.
2023-03-03 20:45:00 +01:00
Matthias Krüger
a8b9f47638
Rollup merge of #104549 - folkertdev:unstable-book-export-executable-symbols, r=WaffleLapkin
add -Zexport-executable-symbols to unstable book

This flag has been extremely useful to me, but it's hard to discover. The text contains a bunch of terms that hopefully a search engine will pick up on when someone searches for this functionality.
2023-03-03 20:44:59 +01:00
Matthias Krüger
01fc5a7653
Rollup merge of #108694 - est31:backticks_matchmaking_comments, r=Nilstrieb
Match unmatched backticks in compiler/ comments

r? ``@Nilstrieb`` as per [advice](https://github.com/rust-lang/rust/pull/108685#issuecomment-1453018499)
2023-03-03 20:06:30 +01:00
Matthias Krüger
846424d15f
Rollup merge of #108685 - est31:backticks_matchmaking, r=petrochenkov
Match unmatched backticks in compiler/

Found with GNU grep:
```
grep -rEn '^(([^`]*`){2})*[^`]*`[^`]*$' compiler/ | rg -v '\s*[//]?.{1,2}```'
```
2023-03-03 20:06:29 +01:00
Matthias Krüger
f9b122a7d8
Rollup merge of #108674 - flip1995:clippy_backport, r=Manishearth
Clippy Fix array-size-threshold config deserialization error

Complementary PR to https://github.com/rust-lang/rust/pull/108673 in order to also get this into the **next** beta.

r? ``@Mark-Simulacrum``
2023-03-03 20:06:28 +01:00
Matthias Krüger
db4b3dd608
Rollup merge of #108667 - compiler-errors:issue-108664, r=estebank
Fix another ICE in `point_at_expr_source_of_inferred_type`

Types coming from method probes must only be investigated *structurally*, since they often contain escaping infer variables from generalization and autoderef. We already have a hack in this PR that erases variables from types, so just use that.

Fixes #108664

The note attached to this error is pretty bad:

```
here the type of `primes` is inferred to be `[_]`
```

But that's unrelated to the PR.

---

Side-note: This is a pretty easy to trigger beta regression, so I've nominated it. Alternatively, I'm slightly inclined to remove this code altogether until it can be reformulated to be more accurate and less ICEy.
2023-03-03 20:06:28 +01:00
Matthias Krüger
1fab0fc4a2
Rollup merge of #108599 - nikic:drop-init, r=cuviper
Remove legacy PM leftovers

This drops two leftovers of legacy PM usage:
 * We don't need to initialize passes anymore.
 * The pass listing was still using legacy PM passes. Replace it with the corresponding new PM listing.
2023-03-03 20:06:27 +01:00
Matthias Krüger
44e794f8ab
Rollup merge of #108553 - compiler-errors:non-lt-late-bound-in-anon-ct, r=petrochenkov
Deny capturing late-bound non-lifetime param in anon const

Introduce a new AnonConstBoundary so we can detect when we capture a late-bound non-lifetime param with `non_lifetime_binders` enabled.

In the future, we could technically do something like introduce an early-bound parameter on the anon const, and stick the late-bound param in its substs (kinda like how we turn late-bound lifetimes in opaques into early-bound ones). But for now, just deny it so we don't ICE.

Fixes #108191
2023-03-03 20:06:27 +01:00
Matthias Krüger
4f49352e92
Rollup merge of #107981 - lcnr:canonicalization-uwu, r=compiler-errors
new solver: implement canonicalization and region constraints

see the corresponding rustc-dev-guide chapter: https://rustc-dev-guide.rust-lang.org/solve/canonicalization.html

r? ``@compiler-errors``
2023-03-03 20:06:26 +01:00
bors
7a809ce899 Auto merge of #108677 - matthiaskrgr:rollup-i91cxuf, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #108022 (Support allocations with non-Box<[u8]> bytes)
 - #108367 (Re-apply "switch to the macos-12-xl builder")
 - #108557 (Point error span at Some constructor argument when trait resolution fails)
 - #108573 (Explain compile-time vs run-time difference in env!() error message)
 - #108584 (Put backtick content from rustdoc search errors into a `<code>` elements)
 - #108624 (Make `ExprKind` the first field in `thir::Expr`)
 - #108644 (Allow setting hashmap toml values in `./configure`)
 - #108672 (Feed queries on impl side for RPITITs when using lower_impl_trait_in_trait_to_assoc_ty)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-03 16:02:37 +00:00
lcnr
a15abea931 canonicalization 2023-03-03 12:45:03 +01:00
Benoît du Garreau
92f35b32b2 Use weak linkage for preadv and pwritev on MacOS and iOS 2023-03-03 10:40:10 +01:00
est31
c54f061228 Don't put integers into backticks during formatting 2023-03-03 08:39:37 +01:00
est31
5a02105fff Rustdoc-ify LiteralKind note 2023-03-03 08:39:36 +01:00
est31
ef658907a5 Match end user facing unmatched backticks in compiler/ 2023-03-03 08:39:36 +01:00
est31
6df5ae4fb0 Match unmatched backticks in comments in compiler/ 2023-03-03 08:39:00 +01:00
est31
ff2c609d66 Match unmatched backticks in compiler/ that are part of rustdoc 2023-03-03 08:39:00 +01:00
Takayuki Maeda
871ee18086 check if snippet is ) 2023-03-03 14:34:11 +09:00
Michael Goulet
bdacc8bdd9 Migrate diagnostic 2023-03-03 05:02:34 +00:00
Michael Goulet
4b23a224ab Label opaque type for 'captures lifetime' error message 2023-03-03 05:02:34 +00:00
Michael Goulet
a43b554259 Remove NormalizationError::ConstantKind 2023-03-03 02:25:31 +00:00
est31
999405059c Match unmatched backticks in library/ 2023-03-03 03:03:29 +01:00
Nicholas Nethercote
3bcea5f979 Improve comments in needs_process_obligation.
And a couple of other places.
2023-03-03 09:59:33 +11:00
Matthias Krüger
e85df8d0fe
Rollup merge of #108672 - spastorino:new-rpitit-impl-side, r=compiler-errors
Feed queries on impl side for RPITITs when using lower_impl_trait_in_trait_to_assoc_ty

I've added a test for traits that were already working and what I think is probably the last bit of infrastructure work needed.
In following PRs I'm going to start adding things TDD style, tests and code that make it work.

r? `@compiler-errors`
2023-03-02 23:05:31 +01:00
Matthias Krüger
8a21bcee25
Rollup merge of #108644 - KittyBorgX:hashmap-toml, r=albertlarsan68
Allow setting hashmap toml values in `./configure`

Fixes https://github.com/rust-lang/rust/issues/108621
2023-03-02 23:05:30 +01:00
Matthias Krüger
7c4e9dd63d
Rollup merge of #108624 - Nilstrieb:move-it-up, r=WaffleLapkin
Make `ExprKind` the first field in `thir::Expr`

This makes its `Debug` impl print it first which is useful, as it's the most important part when looking at an expr.
2023-03-02 23:05:30 +01:00
Matthias Krüger
0dc12b9dec
Rollup merge of #108584 - GuillaumeGomez:rustdoc-search-background, r=notriddle
Put backtick content from rustdoc search errors into a <code> elements

Some screenshots of the result:

![Screenshot from 2023-02-28 22-37-09](https://user-images.githubusercontent.com/3050060/221990290-fa84f1cf-5a64-4ce5-8433-ee36cedf4c00.png)
![Screenshot from 2023-02-28 22-36-59](https://user-images.githubusercontent.com/3050060/221990298-f8177eeb-894b-4fce-a6fc-06d17c8b7ca2.png)
![Screenshot from 2023-02-28 22-36-51](https://user-images.githubusercontent.com/3050060/221990301-41bffd64-d041-41f1-995a-983925b1fbb1.png)

You can test it [here](https://rustdoc.crud.net/imperio/rustdoc-search-background/foo/index.html?search=%22).

r? ```@notriddle```
2023-03-02 23:05:29 +01:00
Matthias Krüger
13640e337a
Rollup merge of #108573 - kornelski:runtimeenvs, r=WaffleLapkin
Explain compile-time vs run-time difference in env!() error message

This PR is clarifying error message of `env!()` based on this user question: https://users.rust-lang.org/t/environment-variable-out-dir-is-undefined/90067

It makes it clear that `env!()` is for env variables defined at compile-time. There's special-case help text for common Cargo build script variables.

I've also rearranged the code to avoid allocating error message on the happy path when the env var is defined.
2023-03-02 23:05:29 +01:00
Matthias Krüger
564715a5b7
Rollup merge of #108557 - Nathan-Fenner:nathanf/adjust-error-span-fix-Some, r=WaffleLapkin
Point error span at Some constructor argument when trait resolution fails

This is a follow up to #108254 and #106477 which extends error span refinement to handle a case which I mistakenly believed was handled in #106477. The goal is to refine the error span depicted below:

```rs
trait Fancy {}
impl <T> Fancy for Option<T> where T: Iterator {}

fn want_fancy<F>(f: F) where F: Fancy {}

fn example() {
    want_fancy(Some(5));
//  (BEFORE)   ^^^^^^^ `{integer}` is not an iterator
//  (AFTER)         ^  `{integer}` is not an iterator
}
```

I had used a (slightly more complex) example as an illustrative example in #108254 , but hadn't actually turned it into a test, because I had (incorrectly) believed at the time it was covered by existing behavior. It turns out that `Some` is slightly "special" in that it resolves differently from the other `enum` constructors I had tried, and therefore this test was actually broken.

I've now updated the tests to include this example, and fixed the code to correctly resolve the `Some` constructor so that the span of the error is reduced.
2023-03-02 23:05:28 +01:00