Matthias Krüger
832987bb1e
Rollup merge of #108609 - clubby789:e0599-highlight, r=estebank
...
Highlight whole expression for E0599
Fixes #108603
This adds a secondary label to highlight the whole expression leading to the error. It also prevents empty labels being recognised as 'unexpected' by compiletest - otherwise, tests with NOTE annotations would pick up empty labels.
`@rustbot` label +A-diagnostics
2023-03-02 07:24:02 +01:00
Matthias Krüger
91dafebc91
Rollup merge of #108575 - compiler-errors:erase, r=estebank
...
Erase **all** regions when probing for associated types on ambiguity in astconv
Fixes #108562
2023-03-02 07:24:01 +01:00
Matthias Krüger
c9c9283c6a
Rollup merge of #108516 - clubby789:rustc-box-restrict, r=compiler-errors
...
Restrict `#[rustc_box]` to `Box::new` calls
Currently, `#[rustc_box]` can be applied to any call expression with a single argument. This PR only allows it to be applied to calls to `Box::new`
2023-03-02 07:24:00 +01:00
clubby789
d845769557
Restrict #[rustc_box]
to Box::new
calls
2023-03-02 02:42:19 +00:00
Rune Tynan
f26b0a2948
Format
2023-03-01 20:27:03 -05:00
bors
f77bfb7336
Auto merge of #108620 - Dylan-DPC:rollup-o5c4evy, r=Dylan-DPC
...
Rollup of 7 pull requests
Successful merges:
- #108143 (rustdoc: search by macro when query ends with `!`)
- #108394 (Make `x doc --open` work on every book)
- #108427 (Recover from for-else and while-else)
- #108462 (Fix `VecDeque::append` capacity overflow for ZSTs)
- #108568 (Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs)
- #108604 (Add regression test for #107280 )
- #108605 (Add regression test for #105821 )
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-01 18:51:29 +00:00
Dylan DPC
9d132f77ae
Rollup merge of #108568 - spastorino:new-rpitit-flag, r=compiler-errors
...
Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs
r? `@compiler-errors`
2023-03-01 23:40:21 +05:30
Santiago Pastorino
73e2fe0494
Properly implement should_encode_fn_impl_trait_in_trait using new unstable option
2023-03-01 14:13:41 -03:00
clubby789
6c2a952b56
Highlight whole expression for E0599
2023-03-01 16:57:11 +00:00
Santiago Pastorino
811a1cabda
Make associated_item_def_ids for traits use an unstable option to also return associated types for RPITITs
2023-03-01 12:56:39 -03:00
Santiago Pastorino
be72beca68
Fix typo in docs
2023-03-01 12:56:39 -03:00
Santiago Pastorino
e74f50ecc2
Add unstable option new_rpitit to be used for new RPITIT lowering system
2023-03-01 12:56:39 -03:00
Santiago Pastorino
5295de1694
Add opt_rpitit_info query
2023-03-01 12:56:38 -03:00
bors
609496eecf
Auto merge of #108446 - Zoxc:named-allocs, r=oli-obk
...
Name LLVM anonymous constants by a hash of their contents
This makes the names stable between different versions of a crate unlike the `AllocId` naming, making LLVM IR comparisons with `llvm-diff` more practical.
2023-03-01 15:36:15 +00:00
y21
0758c05c97
recover from for-else and while-else
2023-03-01 13:26:59 +01:00
Michael Woerister
b79f0261f8
Do not implement HashStable for HashSet.
2023-03-01 10:20:45 +01:00
Michael Woerister
04e5fa3ce2
Remove last instances of HashSet in query result types.
2023-03-01 10:20:45 +01:00
Michael Woerister
422208ae52
Use UnordSet instead of FxHashSet for names_imported_by_glob_use query.
2023-03-01 10:20:43 +01:00
Michael Woerister
ee8bc5b0b2
Use FxIndexSet instead of FxHashSet for asm_target_features query.
2023-03-01 10:19:26 +01:00
Michael Woerister
b0202d9c2c
Use LocalDefIdSet/Map instead of FxHashSet/Map for live_symbols_and_ignored_derived_traits query.
2023-03-01 10:19:26 +01:00
Michael Woerister
f0eadbafd4
Use LocalDefIdSet instead of FxHashSet for reachable_set query.
2023-03-01 10:19:25 +01:00
Michael Woerister
5ff00f96e6
Use DefIdMap instead of FxHashMap for impl_item_implementor_ids query.
2023-03-01 10:19:25 +01:00
Nikita Popov
655a810b66
Print NewPM passes
...
-C passes=list was printing passes for the legacy pass manager.
Use PassBuilder::printPassNames() to print NewPM passes instead.
2023-03-01 09:26:00 +01:00
Nikita Popov
45f694dbba
Remove pass initialization code
...
This is no longer necessary with the new pass manager.
2023-03-01 09:24:13 +01:00
bors
bcb610da7f
Auto merge of #108587 - matthiaskrgr:rollup-rw6po59, r=matthiaskrgr
...
Rollup of 10 pull requests
Successful merges:
- #108376 (compiler/rustc_session: fix sysroot detection logic)
- #108400 (add llvm cgu instructions stats to perf)
- #108496 (fix #108495 , postfix decrement and prefix decrement has no warning)
- #108505 (Further unify validity intrinsics)
- #108520 (Small cleanup to `one_bound_for_assoc_type`)
- #108560 (Some `infer/mod.rs` cleanups)
- #108563 (Make mailmap more correct)
- #108564 (Fix `x clean` with specific paths)
- #108571 (Add contains_key to SortedIndexMultiMap)
- #108578 (Update Fuchsia platform team members)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-01 06:23:19 +00:00
Matthias Krüger
168589426c
Rollup merge of #108571 - Jesse-Bakker:sorted_index_multi_map_contains_key, r=Nilstrieb
...
Add contains_key to SortedIndexMultiMap
2023-03-01 01:21:59 +01:00
Matthias Krüger
3ff3011afb
Rollup merge of #108560 - Nilstrieb:infer-cleanup, r=compiler-errors
...
Some `infer/mod.rs` cleanups
2023-03-01 01:21:58 +01:00
Matthias Krüger
35ef8ea5e1
Rollup merge of #108520 - compiler-errors:one-bound-nit, r=jackh726
...
Small cleanup to `one_bound_for_assoc_type`
Use fewer closures :)
2023-03-01 01:21:57 +01:00
Matthias Krüger
5af16c1655
Rollup merge of #108505 - Nilstrieb:further-unify-validity-intrinsics, r=michaelwoerister
...
Further unify validity intrinsics
Also merges the inhabitedness check into the query to further unify the
code paths.
Depends on #108364
2023-03-01 01:21:57 +01:00
Matthias Krüger
1c3cc8bba5
Rollup merge of #108496 - nx2k3:issue-108495-dec, r=WaffleLapkin
...
fix #108495 , postfix decrement and prefix decrement has no warning
Fixes #108495
2023-03-01 01:21:56 +01:00
Matthias Krüger
32d7024100
Rollup merge of #108400 - csmoe:cgu-instr-perf, r=bjorn3
...
add llvm cgu instructions stats to perf
r? ```@bjorn3```
2023-03-01 01:21:56 +01:00
Matthias Krüger
a51006b8d2
Rollup merge of #108555 - Zoxc:par-fix, r=cjgillot
...
Fix a race in the query system
This fixes an issue where in between the `job` removal and `complete` call the query neither has a job nor a result, allowing another thread to start executing it again.
r? ``@cjgillot``
2023-03-01 01:20:26 +01:00
Matthias Krüger
19604c2362
Rollup merge of #108554 - compiler-errors:late-bound-object-default, r=oli-obk
...
Only look for param in item's generics if it actually comes from generics
Record whether a `hir::GenericParam` comes from an item's generics, or from a `for<...>` binder. Then, only look for the param in `object_lifetime_default` if it actually comes from the item's generics.
Fixes #108177
2023-03-01 01:20:25 +01:00
Matthias Krüger
b2dc8c505c
Rollup merge of #108551 - compiler-errors:rpitit-bad-spec, r=oli-obk
...
Descriptive error when users try to combine RPITIT/AFIT with specialization
Previously we failed with some esoteric error like:
```
error[E0053]: method `foo` has an incompatible type for trait
--> $DIR/dont-project-to-specializable-projection.rs:14:35
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^ expected associated type, found future
|
note: type in trait
--> $DIR/dont-project-to-specializable-projection.rs:10:27
|
LL | async fn foo(_: T) -> &'static str;
| ^^^^^^^^^^^^
= note: expected signature `fn(_) -> impl Future<Output = &'static str>`
found signature `fn(_) -> impl Future<Output = &'static str>`
```
Now we error like:
```
error: async associated function in trait cannot be specialized
--> $DIR/dont-project-to-specializable-projection.rs:14:5
|
LL | default async fn foo(_: T) -> &'static str {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: specialization behaves in inconsistent and surprising ways with `#![feature(async_fn_in_trait)]`, and for now is disallowed
```
2023-03-01 01:20:24 +01:00
Matthias Krüger
78f9bb11fe
Rollup merge of #108550 - clubby789:remove-disjoint, r=compiler-errors
...
Remove the `capture_disjoint_fields` feature
As best I can tell, this was stabilized for Edition 2021 in #88126 but the feature was never removed.
2023-03-01 01:20:24 +01:00
Matthias Krüger
371904bba6
Rollup merge of #108297 - chenyukang:yukang/delim-error-exit, r=petrochenkov
...
Exit when there are unmatched delims to avoid noisy diagnostics
From https://github.com/rust-lang/rust/pull/104012#issuecomment-1311764832
r? ``@petrochenkov``
2023-03-01 01:20:22 +01:00
Nathan Fenner
be15f174fa
restore unaddressed FIXME
2023-02-28 14:59:32 -08:00
Nathan Fenner
f0212e6532
Fix error spans for arguments to tuple enum constructors
2023-02-28 14:58:14 -08:00
Michael Goulet
b7e0ca993d
Shift vars for default RPITIT methods correctly
2023-02-28 21:34:59 +00:00
Rune Tynan
79f0021c16
Update header comment
2023-02-28 15:52:00 -05:00
Rune Tynan
3a87a18857
Make zeroed return an Option
2023-02-28 15:39:17 -05:00
Michael Goulet
cb9852b8e6
Erase **all** regions when probing for associated types in astconv
2023-02-28 17:29:46 +00:00
liushuyu
2186358e5a
compiler/rustc_session: fix sysroot detection logic ...
...
... on systems where /usr/lib contains a multi-arch structure
2023-02-28 10:02:38 -07:00
Kornel
2407b0c578
Explain compile-time vs run-time difference in env!() error message
2023-02-28 16:44:59 +00:00
Jesse Bakker
edf053036f
Add contains_key to SortedIndexMultiMap
2023-02-28 17:15:00 +01:00
Maybe Waffle
031206bc1d
micro fmt changes
2023-02-28 19:28:14 +04:00
Nilstrieb
e326777cca
Some infer/mod.rs
cleanups
2023-02-28 11:49:05 +00:00
Nathan Fenner
2566b4105d
Point error span at Some constructor argument when trait resolution fails
2023-02-27 23:58:35 -08:00
yukang
f808877bbf
refactor parse_token_trees to not return unmatched_delims
2023-02-28 07:57:17 +00:00
yukang
88de2e1115
no need to return unmatched_delims from tokentrees
2023-02-28 07:57:17 +00:00