Commit graph

16347 commits

Author SHA1 Message Date
Matthias Krüger
5c9b227a3d
Rollup merge of #134140 - compiler-errors:unsafe-binders-ast, r=oli-obk
Add AST support for unsafe binders

I'm splitting up #130514 into pieces. It's impossible for me to keep up with a huge PR like that. I'll land type system support for this next, probably w/o MIR lowering, which will come later.

r? `@oli-obk`
cc `@BoxyUwU` and `@lcnr` who also may want to look at this, though this PR doesn't do too much yet
2024-12-13 17:25:31 +01:00
Matthias Krüger
c1810269e9
Rollup merge of #133937 - estebank:silence-resolve-errors-from-mod-with-parse-errors, r=davidtwco
Keep track of parse errors in `mod`s and don't emit resolve errors for paths involving them

When we expand a `mod foo;` and parse `foo.rs`, we now track whether that file had an unrecovered parse error that reached the end of the file. If so, we keep that information around in the HIR and mark its `DefId` in the `Resolver`. When resolving a path like `foo::bar`, we do not emit any errors for "`bar` not found in `foo`", as we know that the parse error might have caused `bar` to not be parsed and accounted for.

When this happens in an existing project, every path referencing `foo` would be an irrelevant compile error. Instead, we now skip emitting anything until `foo.rs` is fixed. Tellingly enough, we didn't have any test for errors caused by expansion of `mod`s with parse errors.

Fix https://github.com/rust-lang/rust/issues/97734.
2024-12-13 17:25:28 +01:00
bors
e217f94917 Auto merge of #134122 - oli-obk:push-zqnyznxtpnll, r=petrochenkov
Move impl constness into impl trait header

This PR is kind of the opposite of the rejected https://github.com/rust-lang/rust/pull/134114

Instead of moving more things into the `constness` query, we want to keep them where their corresponding hir nodes are lowered. So I gave this a spin for impls, which have an obvious place to be (the impl trait header). And surprisingly it's also a perf improvement (likely just slightly better query & cache usage).

The issue was that removing anything from the `constness` query makes it just return `NotConst`, which is wrong. So I had to change it to `bug!` out if used wrongly, and only then remove the impl blocks from the `constness` query. I think this change is good in general, because it makes using `constness` more robust (as can be seen by how few sites that had to be changed, so it was almost solely used specifically for the purpose of asking for functions' constness). The main thing where this change was not great was in clippy, which was using the `constness` query as a general DefId -> constness map. I added a `DefKind` filter in front of that. If it becomes a more common pattern we can always move that helper into rustc.
2024-12-13 16:17:34 +00:00
roife
4704a962e7 feat: improve name generation in destructure_tuple_binding 2024-12-13 23:34:03 +08:00
bjorn3
3198496385 Make dependency_formats an FxIndexMap rather than a list of tuples
It is treated as a map already. This is using FxIndexMap rather than
UnordMap because the latter doesn't provide an api to pick a single
value iff all values are equal, which each_linked_rlib depends on.
2024-12-13 11:29:15 +00:00
Laurențiu Nicola
9847e01377 Bump typos 2024-12-13 11:45:44 +02:00
Laurențiu Nicola
326a2e5724
Merge pull request #18678 from regexident/fix-typos
minor: Fix a few typos
2024-12-13 09:09:33 +00:00
Vincent Esche
c8abe14dd7 Fix a few typos 2024-12-13 09:54:35 +01:00
Lukas Wirth
6c1138e05a
Merge pull request #18674 from Veykril/push-lrxotqknvxvr
Show expansion errors in expand_macro feature
2024-12-13 08:50:45 +00:00
Lukas Wirth
7718173520
Merge pull request #18672 from Veykril/push-lurnqpqtzvzq
internal: Do not require a special env var to be set for the proc-macro-srv
2024-12-13 08:43:33 +00:00
Lukas Wirth
3a83938956 Show expansion errors in expand_macro feature 2024-12-13 09:36:03 +01:00
Lukas Wirth
54f467b68d Do not require a special env var to be set for the proc-macro-srv 2024-12-13 09:29:16 +01:00
The Miri Cronjob Bot
8652177c63 Merge from rustc 2024-12-13 05:12:21 +00:00
The Miri Cronjob Bot
70628f8b8d Preparing for merge from rustc 2024-12-13 05:04:35 +00:00
Michael Goulet
c605c84be8 Stabilize async closures 2024-12-13 00:04:56 +00:00
Esteban Küber
49a22a4245 Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
Esteban Küber
65a54a7f27 Tweak multispan rendering
Consider comments and bare delimiters the same as an "empty line" for purposes of hiding rendered code output of long multispans. This results in more aggressive shortening of rendered output without losing too much context, specially in `*.stderr` tests that have "hidden" comments.
2024-12-12 23:36:27 +00:00
Will Crichton
4d5d4700f3 Make BorrowSet/BorrowData fields accessible via public getters 2024-12-12 12:34:43 -08:00
Lukas Wirth
c57aec8d58
Merge pull request #18677 from Veykril/push-uumpxklsqpzk
internal: Implement `naked_asm!` builtin
2024-12-12 16:58:26 +00:00
Michael Goulet
b8c5a0f0eb Fix tools 2024-12-12 16:43:36 +00:00
Lukas Wirth
88457c0684 internal: Implement naked_asm! builtin 2024-12-12 17:43:27 +01:00
Lukas Wirth
42aefa76a3
Merge pull request #18675 from ShoyuVanilla/issue-18664
fix: Panic when displaying generic params with defaults, again
2024-12-12 16:37:10 +00:00
Shoyu Vanilla
8f004a2047 fix: Panic when displaying generic params with defaults, again 2024-12-13 01:15:41 +09:00
Philipp Hofer
ec6e0983b8 Fix typo in error message for invalid casting
Corrected the spelling of "defererence" to "dereference" in the error message that informs users about invalid casting requirements.
2024-12-12 15:42:21 +01:00
Lukas Wirth
648a00936b
Merge pull request #18670 from Veykril/push-ylomnylswnxm
internal: Drop proc-macro server support for ~1.66.0 and older toolchains
2024-12-12 14:19:07 +00:00
Lukas Wirth
1ae8416798 internal: Drop proc-macro server support for ~1.66.0 and older toolchains 2024-12-12 15:06:14 +01:00
Lukas Wirth
05f9d44656
Merge pull request #18652 from Giga-Bowser/extract-constant
feat: Add an assist to extract an expression into a constant
2024-12-12 13:22:05 +00:00
Lukas Wirth
508ce7cfc8
Merge pull request #18669 from Veykril/push-qqkuxtvsmsut
internal: Only parse the object file once in proc-macro-srv
2024-12-12 12:46:29 +00:00
Lukas Wirth
b6b7c57305 Fix clippy lints in proc-macro-srv 2024-12-12 13:30:42 +01:00
Lukas Wirth
1428cf6032 Only parse the object file once 2024-12-12 13:23:25 +01:00
Lukas Wirth
d41ad2ce81
Merge pull request #18668 from Veykril/push-tpkmsyllunqv
fix: Fix sourceroot construction for virtual manifests
2024-12-12 12:13:48 +00:00
Lukas Wirth
5182170223
Merge pull request #18660 from Veykril/push-snumrtvzwqvw
fix: copied proc-macros not being cleaned up on exit
2024-12-12 12:09:41 +00:00
Lukas Wirth
0815dfb236 fix: Fix sourceroot construction for virtual manifests 2024-12-12 12:58:18 +01:00
Ralf Jung
202098e049 fix use of this.allocate_bytes 2024-12-12 12:27:01 +01:00
Ralf Jung
f590fa9214 Merge from rustc 2024-12-12 12:24:31 +01:00
Ralf Jung
cc797a2b74 Preparing for merge from rustc 2024-12-12 12:24:25 +01:00
许杰友 Jieyou Xu (Joe)
3c3512cf8c Revert "Rollup merge of #134040 - clubby789:bootstrap-eprintln, r=jieyouxu"
This reverts commit b282774aaf, reversing
changes made to e0f3db0056.
2024-12-12 19:24:01 +08:00
Ralf Jung
b9f1aedfd8
Merge pull request #4069 from shamb0/string_deduplication_for_localtime_r
localtime_r: deduplicate timezone name allocation
2024-12-12 10:48:41 +00:00
shamb0
6cbd1ebae3 Improve timezone handling in 'localtime_r()' using 'allocate_bytes()'
Signed-off-by: shamb0 <r.raajey@gmail.com>
2024-12-12 15:47:17 +05:30
Ralf Jung
11ab793655
Merge pull request #4091 from RalfJung/bench-bump
bench-cargo-miri: bump lockfiles
2024-12-12 10:03:07 +00:00
1hakusai1
41bd955f8e Generate implementation with items even if snippet text edit is disabled 2024-12-12 18:55:14 +09:00
Ralf Jung
c7b8ee060d bench-cargo-miri: bump lockfiles 2024-12-12 10:37:23 +01:00
Ralf Jung
4e8a7340a5
Merge pull request #4068 from devnexen/solarish_stat2
solarish stat following-up, supports for readdir.
2024-12-12 07:42:02 +00:00
Ralf Jung
b7565cb1fe ./miri bench: add a flag to skip the install step 2024-12-12 07:45:48 +01:00
Ralf Jung
0272b6cb32 ci TEST_BENCH: show output 2024-12-12 07:24:45 +01:00
David Carlier
579b680f56 solarish stat following-up, supports for readdir. 2024-12-12 06:00:32 +00:00
Laurențiu Nicola
96d97611e2
Merge pull request #18466 from ChayimFriedman2/proper-lint-severity
Properly handle different defaults for severity of lints
2024-12-11 20:05:39 +00:00
Sam Estep
ef879f7a74 Fix publish workflow link in manual 2024-12-11 14:35:36 -05:00
Giga Bowser
d16909ca91 minor: Group extract_function with other extraction assists 2024-12-11 14:11:20 -05:00
bors
21fe748be1 Auto merge of #134177 - matthiaskrgr:rollup-hgp8q60, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #132975 (De-duplicate and improve definition of core::ffi::c_char)
 - #133598 (Change `GetManyMutError` to match T-libs-api decision)
 - #134148 (add comments in check_expr_field)
 - #134163 (coverage: Rearrange the code for embedding per-function coverage metadata)
 - #134165 (wasm(32|64): update alignment string)
 - #134170 (Subtree update of `rust-analyzer`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-11 19:06:46 +00:00