Commit Graph

243113 Commits

Author SHA1 Message Date
bors
0ee9cfd54d Auto merge of #119693 - petrochenkov:cachemark, r=cjgillot
macro_rules: Add an expansion-local cache to span marker

Most tokens in a macro body typically have the same syntax context.
So the cache should usually be hit.

This change can either be combined with https://github.com/rust-lang/rust/pull/119689, or serve as its alternative, depending on perf results.
2024-01-08 04:07:35 +00:00
Michael Goulet
e651f6f029 Add helper for when we want to know if an item has a host param 2024-01-08 01:37:35 +00:00
Nicholas Nethercote
ca2fc426a9 Remove Clone impl for DiagnosticBuilder.
It seems like a bad idea, just asking for diagnostics to be emitted
multiple times.
2024-01-08 12:05:40 +11:00
Mark Rousskov
be0293f468 Remove crossbeam-channel
The standard library's std::sync::mpsc basically is a crossbeam channel,
and for the use case here will definitely suffice. This drops this
dependency from librustc_driver.
2024-01-07 19:16:13 -05:00
Vadim Petrochenkov
edec91d624 macro_rules: Add an expansion-local cache to span marker 2024-01-08 03:06:37 +03:00
bors
76101eecbe Auto merge of #119722 - matthiaskrgr:rollup-y6w3c9h, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #116129 (Rewrite `pin` module documentation to clarify usage and invariants)
 - #119703 (Impl trait diagnostic tweaks)
 - #119705 (Support `~const` in associated functions in trait impls)
 - #119708 (Unions are not `PointerLike`)
 - #119711 (Delete unused makefile in tests/ui)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-08 00:04:01 +00:00
Matthias Krüger
bf20ade5bf
Rollup merge of #119711 - Nilstrieb:makewtf, r=WaffleLapkin
Delete unused makefile in tests/ui

??????????
2024-01-08 00:38:36 +01:00
Matthias Krüger
26768609fb
Rollup merge of #119708 - compiler-errors:pointer-like, r=Nilstrieb
Unions are not `PointerLike`

I introduced the `PointerLike` trait to enforce `dyn*` coercions only from types that share the same ABI as a pointer. On top of needing to be scalar, they also should not be unions, since CTFE chokes on scalar reads for union types.

Fixes #119695
2024-01-08 00:38:35 +01:00
Matthias Krüger
39b3ef17a1
Rollup merge of #119705 - fmease:tilde-const-assoc-fns-trait-impls, r=compiler-errors
Support `~const` in associated functions in trait impls

Fixes #119700.
2024-01-08 00:38:35 +01:00
Matthias Krüger
0207e24406
Rollup merge of #119703 - compiler-errors:impl-trait-tweaks, r=fmease
Impl trait diagnostic tweaks

1. Tweak some names for `impl Trait` being used in the wrong position
2. Remove two helper functions that are no longer needed since RPITIT is stable, and which causes matches to be a bit obtuse.
3. Split and fix the part where the error notes that it's "only allowed in XX"

Fixes #119629
2024-01-08 00:38:34 +01:00
Matthias Krüger
a9b6908e7f
Rollup merge of #116129 - fu5ha:better-pin-docs-2, r=Amanieu
Rewrite `pin` module documentation to clarify usage and invariants

The documentation of `pin` today does not give a complete treatment of pinning from first principles, nor does it adequately help build intuition and understanding for how the different elements of the pinning story fit together.

This rewrite attempts to address these in a way that makes the concept more approachable while also making the documentation more normative.

This PR picks up where `@mcy` left off in #88500 (thanks to him for the original work and `@Manishearth` for mentioning it such that I originally found it). I've directly incorporated much of the feedback left on the original PR and have rewritten and changed some of the main conceits of the prose to better adhere to the feedback from the reviewers on that PR or just explain something in (hopefully) a better way.
2024-01-08 00:38:33 +01:00
Nadrieril
4b2e8bc841 Abort analysis on type error 2024-01-07 22:13:08 +01:00
Nadrieril
07d5f19426 Add an error path to the algorithm 2024-01-07 22:13:08 +01:00
bors
d475e62159 Auto merge of #3260 - saethlin:build-all-tier-2, r=RalfJung
Check if tier 2 targets build in the nightly cron job

This PR adds a CI job that only runs nightly which will install Miri built from the latest commit, and try to build every Tier 2 without host tools target, as documented on https://doc.rust-lang.org/nightly/rustc/platform-support.html.

I'm not really excited about the idea of scraping the tier 2 without host tools list, but also keeping the list up-to-date by hand seems prone to forgetting to update it. And that update seems like the sort of manual maintenance we should automate.
2024-01-07 20:43:06 +00:00
Ben Kimock
7d5de709c8 Check if tier 2 targets build in the nightly cron job 2024-01-07 15:40:43 -05:00
Nilstrieb
5be2a85351 Delete unused makefile in tests/ui
??????????
2024-01-07 20:48:31 +01:00
Mads Ravn
5b30586ba8 Adding alignment to the list of cases to test for specific error message. Covers >, ^ and <. 2024-01-07 20:39:46 +01:00
Michael Goulet
68bb76634d Unions are not PointerLike 2024-01-07 19:28:00 +00:00
Nadrieril
1a3edc169b We only need the arity of the subtype list now 2024-01-07 19:20:19 +01:00
Nadrieril
4ae2840e84 Use special enum to represent algorithm-generated wildcards in the matrix 2024-01-07 19:20:19 +01:00
Michael Goulet
7e38b70cc0 Split note, fix const/static impl trait error 2024-01-07 18:00:03 +00:00
León Orell Valerian Liehr
3acc5a0da3
effects: support ~const in assoc fns in trait impls 2024-01-07 18:22:47 +01:00
Manish Goregaokar
7fd841c098 link 2024-01-07 08:57:23 -08:00
Manish Goregaokar
df6d44961d Update library/core/src/pin.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
2024-01-07 08:56:25 -08:00
Manish Goregaokar
b1830f130a clean up structural pinning 2024-01-07 08:56:24 -08:00
Manish Goregaokar
a573c7c409 footnote on dropping futures 2024-01-07 08:56:24 -08:00
Manish Goregaokar
6a54ed71c0 valid 2024-01-07 08:56:24 -08:00
Manish Goregaokar
6553d0d551 punctuation in parens 2024-01-07 08:56:24 -08:00
Manish Goregaokar
68bdeddb5c Apply suggestions from code review
Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2024-01-07 08:56:24 -08:00
Manish Goregaokar
4c25246f3e Clean up guarantees wording
We don't need to go into that much depth at this stage
2024-01-07 08:56:24 -08:00
Manish Goregaokar
936ceb20f5 lifetime -> lifespan where relevant. improve docs on as_ref() 2024-01-07 08:56:24 -08:00
Manish Goregaokar
0050676440 Rephrase unpin docs in terms of pinning-agnosticness 2024-01-07 08:56:24 -08:00
Gray Olson
058fb50ecd trim section on managed-box model 2024-01-07 08:56:23 -08:00
Gray Olson
9997114e14 improve Pin::new_unchecked docs 2024-01-07 08:56:23 -08:00
Gray Olson
d7a886a807 update ui tests 2024-01-07 08:56:20 -08:00
Gray Olson
f0827b3055 fix broken link 2024-01-07 08:56:10 -08:00
Gray Olson
e0210e6e1d justify motivation of Unpin better 2024-01-07 08:56:09 -08:00
Gray Olson
469c78bcfd improve Pin and Pin::new docs 2024-01-07 08:56:09 -08:00
Gray Olson
6e882790b8 Pin<P> -> Pin<Ptr> 2024-01-07 08:56:09 -08:00
Gray Olson
de2e748a40 fix typos and edit prose 2024-01-07 08:56:08 -08:00
Gray Olson
6d5f43d77d edit new section for typos and better wording 2024-01-07 08:56:08 -08:00
Gray Olson
921d37dbd5 fix imports 2024-01-07 08:56:07 -08:00
Gray Olson
f2447a6a70 fix typos 2024-01-07 08:56:07 -08:00
Gray Olson
252a83b63f add section on manual owning ptr managed solution via @kpreid 2024-01-07 08:56:07 -08:00
Gray Olson
7c9c71260e improve structural Unpin + formatting 2024-01-07 08:56:06 -08:00
Gray Olson
e2e8746bb6 reword unpin auto impl section 2024-01-07 08:56:06 -08:00
Gray Olson
82a68171d3 fix link in footnote 2024-01-07 08:56:06 -08:00
Gray Olson
bebbe24a63 improve Pin struct docs and add examples 2024-01-07 08:56:05 -08:00
Gray Olson
6818d9278b improve intro and discussion of pinning as library contract 2024-01-07 08:56:05 -08:00
Gray Olson
db5b19e472 improve intro and Unpin-related discussion 2024-01-07 08:56:05 -08:00