Commit Graph

23418 Commits

Author SHA1 Message Date
Michael Goulet
773e8a5ad1 RTN 2023-03-28 01:02:15 +00:00
Michael Goulet
fb9ca9223d Feature gate 2023-03-28 01:02:15 +00:00
Michael Goulet
f50c1e1f05 ParenthesizedGenericArgs::{Ok -> ParenSugar} 2023-03-28 01:02:15 +00:00
James Dietz
ff88787ff0 check for write macro and write_fmt with err msg
added ui test
blessed stderrs
fixed typo
reblessed
2023-03-27 21:01:23 -04:00
est31
7bbc8ef022 Make doc comment a little bit more accurate
It queries not LLVM in particular but the codegen backend *in general*.
While cranelift does not provide target features, other codegen backends do.
2023-03-28 02:19:46 +02:00
bors
5bf139e360 Auto merge of #109440 - WaffleLapkin:make_tidy_slower, r=jyn514
Don't skip all directories when tidy-checking

This fixes a regression from https://github.com/rust-lang/rust/pull/108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
2023-03-27 22:19:56 +00:00
clubby789
f995003ec5 Fix subslice capture in closure 2023-03-27 22:26:30 +01:00
Michael Goulet
f738b44c6d no shadow plz 2023-03-27 20:47:15 +00:00
Maybe Waffle
904dd2c398 Bless tidy 2023-03-27 18:58:07 +00:00
Maybe Waffle
3c4fabc341 Improve documentation for E0223 2023-03-27 18:00:22 +00:00
Guillaume Gomez
b1e8be783f
Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async`

This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416.

In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`.
It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
2023-03-27 18:56:19 +02:00
Rémy Rakic
a2be7a1bb4 readability tweaks 2023-03-27 16:04:05 +00:00
Rémy Rakic
a69642015a add more InitMask test coverage 2023-03-27 16:04:05 +00:00
Rémy Rakic
3f80529c64 make InitMask lazy for fully init/uninit cases
Avoid materializing bits in the InitMask bitset when a single value
would be enough: when the mask represents a fully initialized or fully
uninitialized const allocation.
2023-03-27 15:52:17 +00:00
Jamen Marz
73c34cbaf7 Add notes to non-structural const in pattern error message 2023-03-27 11:08:11 -04:00
Matthias Krüger
7f6b406fa1
Rollup merge of #109582 - scottmcm:local-ref-pending, r=oli-obk
Refactor: Separate `LocalRef` variant for not-evaluated-yet operands

As I was reading through this, I noticed that almost every place that was using this needed to distinguish between Some vs None in the match arm anyway, so thought that separating the cases at the variant level might be clearer instead.

I like how it ended up; let me know what you think!
2023-03-27 15:32:42 +02:00
Matthias Krüger
9c73bf9038
Rollup merge of #109580 - compiler-errors:new-solver-fixmes, r=lcnr
Remove some stale FIXMEs in new solver

Some FIXMEs are no longer needed
2023-03-27 15:32:41 +02:00
Mara Bos
1b3fda4978 Use span of placeholders in format_args!() expansion. 2023-03-27 14:53:48 +02:00
Oli Scherer
9e27c6c133 Some tracing/instrument cleanups 2023-03-27 12:19:15 +00:00
lcnr
0c13565ca6 Add a builtin FnPtr trait 2023-03-27 12:16:54 +00:00
Krasimir Georgiev
684e7a5461 llvm-wrapper: adapt for LLVM API change
Adapts the wrapper for the LLVM commit 377e1311d5.
2023-03-27 11:12:47 +00:00
bors
553ecbe8ba Auto merge of #109652 - matthiaskrgr:rollup-pbw3hi3, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #97506 (Stabilize `nonnull_slice_from_raw_parts`)
 - #98651 (Follow C-RW-VALUE in std::io::Cursor example)
 - #102742 (Remove unnecessary raw pointer in __rust_start_panic arg)
 - #109587 (Use an IndexVec to debug fingerprints.)
 - #109613 (fix type suggestions in match arms)
 - #109633 (Fix "Directly go to item in search if there is only one result" setting)
 - #109635 (debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of)
 - #109641 (Don't elaborate non-obligations into obligations)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-27 10:44:27 +00:00
Matthias Krüger
6535e66fa5
Rollup merge of #109641 - compiler-errors:dont-elaborate-non-obl, r=oli-obk
Don't elaborate non-obligations into obligations

It's suspicious to elaborate a `PolyTraitRef` or `Predicate` into an `Obligation`, since the former does not have a param-env associated with it, but the latter does. This is a footgun that, while not being misused *currently* in the compiler, easily could be misused by someone less familiar with the elaborator's inner workings.

This PR just changes the API -- ideally, the elaborator wouldn't even have to deal with obligations if we're not elaborating obligations, but that would require a bit more abstraction than I could be bothered with today.
2023-03-27 08:46:55 +02:00
Matthias Krüger
2b7dc94535
Rollup merge of #109635 - Nilstrieb:debrrruginfo, r=compiler=errors
debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of

This avoids some type interning and a query execution. It also just makes the code simpler.
2023-03-27 08:46:54 +02:00
Matthias Krüger
04b8523c46
Rollup merge of #109613 - lukas-code:match-str-to-char-suggestion, r=compiler-errors
fix type suggestions in match arms

fix https://github.com/rust-lang/rust/issues/109586
2023-03-27 08:46:53 +02:00
Matthias Krüger
32aa4c03d9
Rollup merge of #109587 - cjgillot:no-hashmap-fingerprint, r=Nilstrieb
Use an IndexVec to debug fingerprints.

Uncontroversial part of https://github.com/rust-lang/rust/pull/109050
2023-03-27 08:46:52 +02:00
bors
7a0600714a Auto merge of #109091 - Nilstrieb:match-on-attr, r=cjgillot
Cleanup `codegen_fn_attrs`

The `match` control flow construct has been stable since 1.0, we should use it here.

Sorry for the hard to review diff, I did try to at least split it into two commits. But looking at before-after side-by-side (instead of whatever github is doing) is probably the easiest way to make sure that I didn't forget about anything.

On top of #109088, you can wait for that
2023-03-27 05:01:19 +00:00
Michael Goulet
1ce4b37900 Don't elaborate non-obligations into obligations 2023-03-26 20:33:54 +00:00
Nilstrieb
72c917d4be debuginfo: Get pointer size/align from tcx.data_layout instead of layout_of
This avoids some type interning and a query execution. It also just
makes the code simpler.
2023-03-26 20:05:17 +02:00
bors
89c2e3d3d7 Auto merge of #109626 - matthiaskrgr:rollup-k0y7bdd, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #109007 (rustdoc: skip `// some variants omitted` if enum is `#[non_exhaustive]`)
 - #109593 (Rustdoc Book refer to rustdoc::missing_doc_code_examples. Fixes #109592.)
 - #109595 (Improve "Auto-hide trait implementation documentation" GUI test)
 - #109619 (Still-further-specializable projections are ambiguous in new solver)
 - #109620 (Correct typo (`back_box` -> `black_box`))
 - #109621 (Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-26 12:05:38 +00:00
Ali MJ Al-Nasrawy
2a3177a8bc tolerate region vars in implied bounds
See https://github.com/rust-lang/rust/issues/109628.
2023-03-26 14:37:24 +03:00
Ali MJ Al-Nasrawy
b20aa97d48 exhaustive match on implied bounds regions 2023-03-26 11:43:12 +03:00
Ali MJ Al-Nasrawy
d1743c9817 resolve regions before implied bounds 2023-03-26 11:43:12 +03:00
Ali MJ Al-Nasrawy
b197f1ac2e remove obsolete givens from regionck 2023-03-26 11:43:12 +03:00
Matthias Krüger
4aa4ce6ee2
Rollup merge of #109621 - scottmcm:update-variantidx, r=compiler-errors
Refactor: `VariantIdx::from_u32(0)` -> `FIRST_VARIANT`

Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant.

So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since [it doesn't have any today](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/abi/struct.VariantIdx.html).
2023-03-26 08:39:28 +02:00
Matthias Krüger
705435fe01
Rollup merge of #109619 - compiler-errors:new-solver-still-further-specializable, r=BoxyUwU
Still-further-specializable projections are ambiguous in new solver

Fixes https://github.com/rust-lang/rust/pull/108896/files#r1148450781

r? ``@BoxyUwU`` (though feel free to re-roll)

---

This can be used to create an unsound transmute function with the new solver:

```rust
#![feature(specialization)]

trait Default {
   type Id;

   fn intu(&self) -> &Self::Id;
}

impl<T> Default for T {
   default type Id = T;

   fn intu(&self) -> &Self::Id {
        self
   }
}

fn transmute<T: Default<Id = U>, U: Copy>(t: T) -> U {
    *t.intu()
}

use std::num::NonZeroU8;
fn main() {
    let s = transmute::<u8, Option<NonZeroU8>>(0);
    assert_eq!(s, None);
}
```
2023-03-26 08:39:27 +02:00
bors
2420bd34ba Auto merge of #106428 - saethlin:inline-diverging-functions, r=cjgillot
Permit the MIR inliner to inline diverging functions

This heuristic prevents inlining of `hint::unreachable_unchecked`, which in turn makes `Option/Result::unwrap_unchecked` a bad inlining candidate. I looked through the changes to `core`, `alloc`, `std`, and `hashbrown` by hand and they all seem reasonable. Let's see how this looks in perf...

---

Based on rustc-perf it looks like this regresses ctfe-stress, and the cachegrind diff indicates that this regression is in `InterpCx::statement`. I don't know how to do any deeper analysis because that function is _enormous_ in the try toolchain, which has no debuginfo in it. And a local build produces significantly different codegen for that function, even with LTO.
2023-03-26 05:55:32 +00:00
Scott McMurray
0439d13176 Refactor: VariantIdx::from_u32(0) -> FIRST_VARIANT
Since structs are always `VariantIdx(0)`, there's a bunch of files where the only reason they had `VariantIdx` or `vec::Idx` imported at all was to get the first variant.

So this uses a constant for that, and adds some doc-comments to `VariantIdx` while I'm there, since it doesn't have any today.
2023-03-25 18:58:25 -07:00
Michael Goulet
3310f72db9 transmute test 2023-03-26 00:03:14 +00:00
Michael Goulet
20679b1166 Still-further-specializable projections are ambiguous 2023-03-25 23:51:08 +00:00
Lukas Markeffsky
08f3deb3d5 fix type suggestions in match arms 2023-03-25 22:27:24 +01:00
Ben Kimock
88e78aba82 Explain how we get to skip checking for cleanup blocks in the visitor 2023-03-25 13:58:49 -04:00
bors
2d429f3064 Auto merge of #109458 - Nilstrieb:smol-cute-little-bits, r=wesleywiser
Use `SmallVec` in bitsets

This doesn't increase their size and means that we don't have to heap allocate for small sets.
2023-03-25 17:06:43 +00:00
bors
96bd50dd47 Auto merge of #109581 - matthiaskrgr:rollup-e8fi2vi, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #109355 (Fix bad suggestion for clone/is_some in field init shorthand)
 - #109484 (Bugfix: avoid panic on invalid json output from libtest)
 - #109539 (Refactor `find_*_stability` functions)
 - #109542 (rustdoc: clean up `storage.js`)
 - #109545 (Deeply check well-formedness of return-position `impl Trait` in trait)
 - #109568 (miri: fix raw pointer dyn receivers)
 - #109570 (Add GUI test for "Auto-hide item methods' documentation" setting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-25 14:34:13 +00:00
bors
b72e896268 Auto merge of #109100 - Zoxc:merge-query-try, r=cjgillot
Refactor `try_execute_query`

This merges `JobOwner::try_start` into `try_execute_query`, removing `TryGetJob` in the processes. 3 new functions are extracted from `try_execute_query`: `execute_job`, `cycle_error` and `wait_for_query`. This makes the control flow a bit clearer and improves performance.

Based on https://github.com/rust-lang/rust/pull/109046.

<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7134s</td><td align="right">1.7061s</td><td align="right"> -0.43%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2519s</td><td align="right">0.2510s</td><td align="right"> -0.35%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9517s</td><td align="right">0.9481s</td><td align="right"> -0.38%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5389s</td><td align="right">1.5338s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.9488s</td><td align="right">5.9258s</td><td align="right"> -0.39%</td></tr><tr><td>Total</td><td align="right">10.4048s</td><td align="right">10.3647s</td><td align="right"> -0.38%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9962s</td><td align="right"> -0.38%</td></tr></table>

r? `@cjgillot`
2023-03-25 12:04:46 +00:00
Camille GILLOT
5e49f099a9 Use an IndexVec to debug fingerprints. 2023-03-25 09:22:40 +00:00
Scott McMurray
49798605a0 Refactor: Separate LocalRef variant for not-evaluated-yet operands 2023-03-24 20:36:59 -07:00
Matthias Krüger
31df7f1ecd
Rollup merge of #109568 - RalfJung:miri-raw-ptr-dyn, r=oli-obk
miri: fix raw pointer dyn receivers

r? `@oli-obk`
Fixes https://github.com/rust-lang/miri/issues/2786
2023-03-25 03:37:12 +01:00
Matthias Krüger
3b49ad3814
Rollup merge of #109545 - compiler-errors:rpitit-wf, r=eholk
Deeply check well-formedness of return-position `impl Trait` in trait

Walk the bounds of RPITITs to see if we find any more RPITITs 😸
2023-03-25 03:37:12 +01:00
Matthias Krüger
15ea2276ff
Rollup merge of #109539 - cjgillot:find-stability, r=b-naber
Refactor `find_*_stability` functions

The idea is to split the monolithic function into the 3 cases: stability, const stability, and body stability.
2023-03-25 03:37:11 +01:00
Matthias Krüger
f3d3f350cc
Rollup merge of #109355 - chenyukang:yukang/fix-108470, r=compiler-errors
Fix bad suggestion for clone/is_some in field init shorthand

Fixes #108470
2023-03-25 03:37:10 +01:00
John Kåre Alsaker
820e3a8d6a Pass tcx directly 2023-03-25 03:13:05 +01:00
John Kåre Alsaker
afe4c16b29 Split the if to release the lock earlier 2023-03-25 03:12:41 +01:00
John Kåre Alsaker
dfae9c993d Remove DebugArg 2023-03-25 02:59:54 +01:00
John Kåre Alsaker
8f294066b3 Optimize incremental_verify_ich 2023-03-25 02:59:53 +01:00
Michael Goulet
53ec4bc631 Remove some stale FIXMEs in new solver 2023-03-25 01:51:19 +00:00
John Kåre Alsaker
27c44d2e28 Update indexmap and rayon crates 2023-03-25 02:12:13 +01:00
John Kåre Alsaker
a1f48047bf Use Rayon's TLV directly 2023-03-25 01:30:36 +01:00
bors
8be3c2bda6 Auto merge of #107932 - petrochenkov:onlyexport, r=jyn514
rustdoc: Skip doc link resolution for non-exported items
2023-03-24 21:10:51 +00:00
Camille GILLOT
3e9ea5da63 Adjust documentation. 2023-03-24 18:53:36 +00:00
Mu001999
910a5ad2df Emits suggestions for expressions with parentheses or not separately 2023-03-25 01:00:49 +08:00
Ben Kimock
67540ec950 Skip checks for common types with alignment 1 2023-03-24 12:35:16 -04:00
Ben Kimock
a71b808d77 Use Vec::split_off 2023-03-24 12:34:49 -04:00
Michael Goulet
7f89c7c32d Make EvalCtxt's infcx private 2023-03-24 16:00:27 +00:00
Ralf Jung
c2fddfd8e2 miri: fix raw pointer dyn receivers 2023-03-24 16:53:18 +01:00
bors
31d74fb24b Auto merge of #109220 - nikic:poison, r=cuviper
Use poison instead of undef

In cases where it is legal, we should prefer poison values over undef values.

This replaces undef with poison for aggregate construction and for uninhabited types. There are more places where we can likely use poison, but I wanted to stay conservative to start with.

In particular the aggregate case is important for newer LLVM versions, which are not able to handle an undef base value during early optimization due to poison-propagation concerns.

r? `@cuviper`
2023-03-24 15:39:40 +00:00
Ben Kimock
c9c1346874
Clarify that we are doing ptr.addr() internally
Co-authored-by: Ralf Jung <post@ralfj.de>
2023-03-24 10:48:40 -04:00
Mu42
6034b2fcb8 Use independent suggestions 2023-03-24 20:09:02 +08:00
yukang
64f6e4f21c Fix bad suggestion for clone/is_some in field init shorthand 2023-03-24 19:52:34 +08:00
bjorn3
8b1be44758 Update ar_archive_writer to 0.1.3
This updates object to 0.30 and fixes a bug where the symbol table
would be omitted for archives where there are object files yet none
that export any symbol. This bug could lead to linker errors for crates
like rustc_std_workspace_core which don't contain any code of their own
but exist solely for their dependencies. This is likely the cause of
the linker issues I was experiencing on Webassembly. It has been shown
to cause issues on other platforms too.

cc rust-lang/ar_archive_writer#5
2023-03-24 11:48:48 +00:00
Mu42
8e56c2c5f1 Suggest ..= when someone tries to create an overflowing range 2023-03-24 14:24:25 +08:00
Matthias Krüger
2cfcca629f
Rollup merge of #109550 - Nathan-Fenner:nathanf/fixme-adjust-funcs, r=compiler-errors
Make helper functions private in fn_ctxt/adjust_fulfillment_errors

Two helper functions in `rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs` were previously made `pub` impl members, because they were also used in `rustc_hir_typeck/src/fn_ctxt/check.rs` (see #107746).

However, that's no longer the case, so the FIXME suggesting they be made private can now be implemented.
2023-03-24 07:13:06 +01:00
Matthias Krüger
4378369b6a
Rollup merge of #109519 - bzEq:aix-llvm-c++, r=cuviper
Link against libc++ on AIX

LLVM on AIX currently is utilizing runtimes in llvm-project, such as libc++, libc++abi and libunwind.
2023-03-24 07:13:05 +01:00
Matthias Krüger
2270bde01f
Rollup merge of #109495 - compiler-errors:new-solver-destruct, r=eholk,lcnr
Implement non-const `Destruct` trait in new solver

Makes it so that we can call stdlib methods like `Option::map` in **non-const** environments, since *many* stdlib methods have `Destruct` bounds 😅

This doesn't bother to implement `const Destruct` yet, but it shouldn't be too hard to do so. Just didn't bother since we already don't have much support for const traits in the new solver anyways. I'd be happy to add skeleton support for `const Destruct`, though, if the reviewer desires.
2023-03-24 07:13:05 +01:00
Matthias Krüger
98254c5cc7
Rollup merge of #109433 - chenyukang:yukang/fix-109188-ice, r=lcnr
Return equal for two identical projections

Fixes #109188
2023-03-24 07:13:04 +01:00
Nathan Fenner
d4d1cc4db6 Make helper functions private 2023-03-23 20:24:37 -07:00
bors
4c0f5008ce Auto merge of #109547 - matthiaskrgr:rollup-zczqgdk, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108629 (rustdoc: add support for type filters in arguments and generics)
 - #108924 (panic_immediate_abort requires abort as a panic strategy)
 - #108961 (Refine error spans for const args in hir typeck)
 - #108986 (sync LVI tests)
 - #109142 (Add block-based mutex unlocking example)
 - #109368 (fix typo in the creation of OpenOption for RustyHermit)
 - #109493 (Return nested obligations from canonical response var unification)
 - #109515 (Add AixLinker to support linking on AIX)
 - #109536 (resolve: Rename some cstore methods to match queries and add comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-24 02:29:48 +00:00
Kai Luo
5aad51098d Avoid misalign 2023-03-24 10:25:52 +08:00
Matthias Krüger
4d21d302a1
Rollup merge of #109536 - petrochenkov:qcstore3, r=cjgillot
resolve: Rename some cstore methods to match queries and add comments

about costs associated with replacing them with query calls.

Supersedes https://github.com/rust-lang/rust/pull/108346.
r? `@cjgillot`
2023-03-24 01:22:07 +01:00
Matthias Krüger
686bd46d8a
Rollup merge of #109515 - bzEq:aix-linker, r=petrochenkov
Add AixLinker to support linking on AIX

AIX linker has a different cli style from other existing linkers.
It is documented in https://www.ibm.com/docs/en/aix/7.1?topic=l-ld-command.
2023-03-24 01:22:07 +01:00
Matthias Krüger
1c7ef3b483
Rollup merge of #109493 - compiler-errors:new-solver-vars-obligations, r=lcnr
Return nested obligations from canonical response var unification

Handle alias-eq obligations being emitted from `instantiate_and_apply_query_response` in:
* `EvalCtxt` - by processing the nested obligations in the next loop by `new_goals`
* `FulfillCtxt` - by adding the nested obligations to the fulfillment's pending obligations
* `InferCtxt::evaluate_obligation` - ~~by returning `EvaluationResult::EvaluatedToAmbig` (boo 👎, see the FIXME)~~ same behavior as above, since we use fulfillment and `select_where_possible`

The only one that's truly sketchy is `evaluate_obligation`, but it's not hard to modify this behavior moving forward.

From #109037, I think a smaller repro could be crafted if I were smarter, but I am not, so I just took this from #105878.

r? `@lcnr` cc `@BoxyUwU`
2023-03-24 01:22:06 +01:00
Matthias Krüger
eb82a5a0c8
Rollup merge of #108961 - compiler-errors:refine-ct-errors, r=BoxyUwU
Refine error spans for const args in hir typeck

Improve just a couple of error messages having to do with mismatched consts.

r? `@ghost` i'll put this up when the dependent commits are merged
2023-03-24 01:22:04 +01:00
bors
cf073ec2cb Auto merge of #109202 - compiler-errors:new-solver-fast-reject-faster-2, r=lcnr
Don't pass `TreatProjections` separately to `fast_reject`

Don't pass `TreatProjections` separately to `fast_reject`, and instead use the original approach of switching on two variants of `TreatParams` (undoes this: https://github.com/rust-lang/rust/pull/108830#pullrequestreview-1330371417).

Fixes the regression introduced in https://github.com/rust-lang/rust/pull/108830#issuecomment-1468116419
2023-03-23 23:53:56 +00:00
Michael Goulet
b605d0740f Deeply check WF for RPITITs 2023-03-23 23:37:22 +00:00
Ben Kimock
8ccf53332e A MIR transform that checks pointers are aligned 2023-03-23 18:23:06 -04:00
bors
1459b3128e Auto merge of #109538 - matthiaskrgr:rollup-ct58npj, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #106964 (Clarify `Error::last_os_error` can be weird)
 - #107718 (Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`)
 - #107880 (Lint ambiguous glob re-exports)
 - #108549 (Remove issue number for `link_cfg`)
 - #108588 (Fix the ffi_unwind_calls lint documentation)
 - #109231 (Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`)
 - #109472 (Add parentheses properly for method calls)
 - #109487 (Move useless_anynous_reexport lint into unused_imports)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-23 21:16:57 +00:00
Camille GILLOT
5f9c004d35 Separate find_*_stability. 2023-03-23 19:52:27 +00:00
Camille GILLOT
17f1db672e Extract parse_stability and parse_unstability. 2023-03-23 19:49:38 +00:00
Michael Goulet
1680334928 Use fulfillment in InferCtxt::evaluate_obligation 2023-03-23 19:22:32 +00:00
Michael Goulet
6c6bd01421 Note type mismatch on ConstArgHasType 2023-03-23 19:09:34 +00:00
Michael Goulet
2bab422393 Return nested obligations from canonical response var unification 2023-03-23 19:00:04 +00:00
Michael Goulet
fc0cbe8340 Don't split up TreatProjections and TreatParams anymore 2023-03-23 18:57:02 +00:00
Matthias Krüger
3961ef5bc8
Rollup merge of #109487 - GuillaumeGomez:move-useless-reexport-check, r=petrochenkov
Move useless_anynous_reexport lint into unused_imports

As mentioned in https://github.com/rust-lang/rust/pull/109003, this check should have been merged with `unused_imports` in the start.

r? `@petrochenkov`
2023-03-23 19:55:46 +01:00
Matthias Krüger
dddede4a24
Rollup merge of #109472 - MU001999:patch-3, r=eholk
Add parentheses properly for method calls

Fixes #109436
2023-03-23 19:55:46 +01:00
Matthias Krüger
2a39cf560f
Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholk
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`

This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
2023-03-23 19:55:45 +01:00
Matthias Krüger
fc5516b782
Rollup merge of #108588 - ehuss:lint-docs-produces, r=eholk
Fix the ffi_unwind_calls lint documentation

This fixes the [`ffi_unwind_calls`](https://doc.rust-lang.org/nightly/rustc/lints/listing/allowed-by-default.html#ffi-unwind-calls) documentation to show its output correctly. Currently it is showing the text `{{produces}}` which is not how it should look.

This fixes it by not ignoring the example. I'm not sure why it was ignored, as the way the lint currently works it doesn't seem to require external linkage. This also fixes several mistakes in the example:

* There is no `ffi_unwind_calls` feature.
* Denies the lint (which is otherwise allow be default).
* Removes the `mod impl` which is not valid Rust syntax, and doesn't appear to be needed anyways.

The output now looks like:

```
warning: call to foreign function with FFI-unwind ABI
  --> lint_example.rs:10:14
   |
10 |     unsafe { foo(); }
   |              ^^^^^ call to foreign function with FFI-unwind ABI
   |
note: the lint level is defined here
  --> lint_example.rs:2:9
   |
2  | #![warn(ffi_unwind_calls)]
   |         ^^^^^^^^^^^^^^^^

warning: call to function pointer with FFI-unwind ABI
  --> lint_example.rs:12:14
   |
12 |     unsafe { ptr(); }
   |              ^^^^^ call to function pointer with FFI-unwind ABI

```

This also includes some updates to the lint-docs tool to help with this issue:

* Adds a check if a lint documentation has `{{produces}}` with an ignored example, and generates an error.
* All instances of a lint are now displayed. Previously it only showed the first time the lint fires. Some examples may trigger a lint multiple times, and they are all now displayed.
2023-03-23 19:55:45 +01:00
Matthias Krüger
5a017d3a57
Rollup merge of #108549 - clubby789:fix-link-cfg-issue, r=eholk
Remove issue number for `link_cfg`

Fixes #72059

Per #37406 and its [unstable book entry](https://doc.rust-lang.org/beta/unstable-book/language-features/link-cfg.html), this is an internal feature, and therefore perma-unstable and not being tracked
2023-03-23 19:55:44 +01:00
Matthias Krüger
bacf059f57
Rollup merge of #107880 - jieyouxu:issue-107563, r=petrochenkov
Lint ambiguous glob re-exports

Attempts to fix #107563.

We currently already emit errors for ambiguous re-exports when two names are re-exported *specifically*, i.e. not from glob exports. This PR attempts to emit deny-by-default lints for ambiguous glob re-exports.
2023-03-23 19:55:43 +01:00
Matthias Krüger
acd7f878ae
Rollup merge of #107718 - Zoxc:z-time, r=nnethercote
Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`

This adds back the `-Z time` option as that is useful for [my rustc benchmark tool](https://github.com/Zoxc/rcb), reverting https://github.com/rust-lang/rust/pull/102725. It now uses nanoseconds and bytes as the units so it is renamed to `time-precise`.
2023-03-23 19:55:43 +01:00
Michael Goulet
e55f73ae47 Refine error spans for const args in hir typeck 2023-03-23 18:51:30 +00:00
bors
e216300876 Auto merge of #108442 - scottmcm:mir-transmute, r=oli-obk
Add `CastKind::Transmute` to MIR

~~Nothing actually produces it in this commit, so I don't know how to test it, but it also means it shouldn't be possible for it to break anything.~~

Includes lowering `transmute` calls to it, so it's used.

Zulip Conversation: <https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Good.20first.20isssue/near/321849610>
2023-03-23 18:43:04 +00:00
Vadim Petrochenkov
1cec923fbb rustc_metadata: Freeze cstore after the full crate list is queried 2023-03-23 20:44:48 +04:00
Vadim Petrochenkov
71927ad083 resolve: Rename some cstore methods to match queries and add comments
about costs associated with replacing them with query calls.
2023-03-23 20:44:02 +04:00
bors
df7fd9995f Auto merge of #108221 - petrochenkov:cratecfg, r=michaelwoerister
rustc_interface: Add a new query `pre_configure`

It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early.

Crate-level cfg attributes on the crate itself are then expanded normally during the main expansion pass, like attributes on any other nodes.
This is a continuation of https://github.com/rust-lang/rust/pull/92473 and one more step to very unstable crate-level proc macro attributes maybe actually working.

Previously crate attributes were pre-configured simultaneously with feature extraction, and then written directly into `ast::Crate`.
2023-03-23 15:17:59 +00:00
bors
99c49d95cd Auto merge of #109517 - matthiaskrgr:rollup-m3orqzd, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #108541 (Suppress `opaque_hidden_inferred_bound` for nested RPITs)
 - #109137 (resolve: Querify most cstore access methods (subset 2))
 - #109380 (add `known-bug` test for unsoundness issue)
 - #109462 (Make alias-eq have a relation direction (and rename it to alias-relate))
 - #109475 (Simpler checked shifts in MIR building)
 - #109504 (Stabilize `arc_into_inner` and `rc_into_inner`.)
 - #109506 (make param bound vars visibly bound vars with -Zverbose)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-23 12:35:05 +00:00
Vadim Petrochenkov
bec4eab3f9 rustdoc: Skip doc link resolution for non-exported items 2023-03-23 16:19:59 +04:00
Vadim Petrochenkov
aca1b1e0b3 rustc_interface: Add a new query pre_configure
It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early.

Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
2023-03-23 14:22:48 +04:00
Vadim Petrochenkov
6cc33b7691 expand: Pass ast::Crate by reference to AST transforming passes
Also some more attributes are passed by reference.
2023-03-23 14:20:55 +04:00
bors
9a6b0c3326 Auto merge of #108355 - dpaoliello:dlltoolm, r=michaelwoerister
Fix cross-compiling with dlltool for raw-dylib

Fix for #103939

Issue Details:
When attempting to cross-compile using the `raw-dylib` feature and the GNU toolchain, rustc would attempt to find a cross-compiling version of dlltool (e.g., `i686-w64-mingw32-dlltool`). The has two issues 1) on Windows dlltool is always `dlltool` (no cross-compiling named versions exist) and 2) it only supported compiling to i686 and x86_64 resulting in ARM 32 and 64 compiling as x86_64.

Fix Details:
* On Windows always use the normal `dlltool` binary.
* Add the ARM64 cross-compiling dlltool name (support for this is coming: https://sourceware.org/bugzilla/show_bug.cgi?id=29964)
* Provide the `-m` argument to dlltool to indicate the target machine type.

(This is the first of two PRs to fix the remaining issues for the `raw-dylib` feature (#58713) that is blocking stabilization (#104218))
2023-03-23 09:51:32 +00:00
Kai Luo
6e8a8282b8 Implement current_dll_path for AIX 2023-03-23 16:50:49 +08:00
Kai Luo
3a7977e3ca Link against libc++ on AIX 2023-03-23 16:33:54 +08:00
Matthias Krüger
477ce585d4
Rollup merge of #109506 - BoxyUwU:debugable_bound_var_printing, r=compiler-errors
make param bound vars visibly bound vars with -Zverbose

I was trying to debug some type/const bound var stuff and it was shockingly tricky due to the fact that even with `-Zverbose` enabled the `T` in `for<T> T: Trait` prints as `T` making it seem like its `TyKind::Param` when it is infact `TyKind::Bound`. This PR "fixes" this when `-Zverbose` is set to allow rendering it as `^T` or `^1_T` depending on binder depth.

r? ```@compiler-errors```
2023-03-23 08:35:36 +01:00
Matthias Krüger
7afed92749
Rollup merge of #109475 - scottmcm:simpler-shifts, r=WaffleLapkin
Simpler checked shifts in MIR building

Doing masking to check unsigned shift amounts is overcomplicated; just comparing the shift directly saves a statement and a temporary, as well as is much easier to read as a human.  And shifting by unsigned is the canonical case -- notably, all the library shifting methods (that don't support every type) take shift RHSs as `u32` -- so we might as well make that simpler since it's easy to do so.

This PR also changes *signed* shift amounts to `IntToInt` casts and then uses the same check as for unsigned.  The bit-masking is a nice trick, but for example LLVM actually canonicalizes it to an unsigned comparison anyway <https://rust.godbolt.org/z/8h59fMGT4> so I don't think it's worth the effort and the extra `Constant`.  (If MIR's `assert` was `assert_nz` then the masking might make sense, but when the `!=` uses another statement I think the comparison is better.)

To review, I suggest looking at 2ee0468c49 first -- that's the interesting code change and has a MIR diff.

My favourite part of the diff:
```diff
-        _20 = BitAnd(_19, const 340282366920938463463374607431768211448_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
-        _21 = Ne(move _20, const 0_u128); // scope 0 at $DIR/shifts.rs:+2:34: +2:44
-        assert(!move _21, "attempt to shift right by `{}`, which would overflow", _19) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+        _18 = Lt(_17, const 8_u128);     // scope 0 at $DIR/shifts.rs:+2:34: +2:44
+        assert(move _18, "attempt to shift right by `{}`, which would overflow", _17) -> [success: bb3, unwind: bb7]; // scope 0 at $DIR/shifts.rs:+2:34: +2:44
```
2023-03-23 08:35:35 +01:00
Matthias Krüger
5d28853efe
Rollup merge of #109462 - compiler-errors:alias-relate, r=BoxyUwU,lcnr
Make alias-eq have a relation direction (and rename it to alias-relate)

Emitting an "alias-eq" is too strict in some situations, since we don't always want strict equality between a projection and rigid ty. Adds a relation direction.

* I could probably just reuse this [`RelationDir`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/combine/enum.RelationDir.html) -- happy to uplift that struct into middle and use that instead, but I didn't feel compelled to... 🤷
* Some of the matching in `compute_alias_relate_goal` is a bit verbose -- I guess I could simplify it by using [`At::relate`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/infer/at/struct.At.html#method.relate) and mapping the relation-dir to a variance.
* Alternatively, I coulld simplify things by making more helper functions on `EvalCtxt` (e.g. `EvalCtxt::relate_with_direction(T, T)` that also does the nested goal registration). No preference.

r? ```@lcnr``` cc ```@BoxyUwU``` though boxy can claim it if she wants
NOTE: first commit is all the changes, the second is just renaming stuff
2023-03-23 08:35:35 +01:00
Matthias Krüger
3e33fb9f12
Rollup merge of #109137 - petrochenkov:qcstore2, r=cjgillot
resolve: Querify most cstore access methods (subset 2)

These changes are less likely to cause perf regressions than the rest of https://github.com/rust-lang/rust/pull/108346.
2023-03-23 08:35:34 +01:00
Kai Luo
3957d3a08a Adjust debug info stripping 2023-03-23 15:14:27 +08:00
Kai Luo
f11611018f Fix copy-paste error 2023-03-23 15:05:45 +08:00
bors
84dd6dfd9d Auto merge of #109503 - matthiaskrgr:rollup-cnp7kdd, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108954 (rustdoc: handle generics better when matching notable traits)
 - #109203 (refactor/feat: refactor identifier parsing a bit)
 - #109213 (Eagerly intern and check CrateNum/StableCrateId collisions)
 - #109358 (rustc: Remove unused `Session` argument from some attribute functions)
 - #109359 (Update stdarch)
 - #109378 (Remove Ty::is_region_ptr)
 - #109423 (Use region-erased self type during IAT selection)
 - #109447 (new solver cleanup + implement coherence)
 - #109501 (make link clickable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-23 07:01:03 +00:00
Kai Luo
485aec41af Add AixLinker to support linking on AIX 2023-03-23 15:00:46 +08:00
Michael Goulet
e5189cc7e4 Nested impl traits trigger opaque_hidden_inferred_bound too much 2023-03-23 06:19:52 +00:00
Michael Goulet
244cdaa457 Remove AliasRelationDirection::Supertype 2023-03-23 05:57:09 +00:00
Michael Goulet
f6fd754680 Printing alias-relate goals correctly 2023-03-23 05:56:40 +00:00
Michael Goulet
3a36a093dd Rename AliasEq -> AliasRelate 2023-03-23 05:56:40 +00:00
Michael Goulet
5dc3fd7c05 Include relation direction in AliasEq predicate 2023-03-23 05:56:27 +00:00
Mu42
2580348ca3 Use span_look_ahead instead of next_point 2023-03-23 09:41:49 +08:00
bors
1c771fec33 Auto merge of #108861 - b-naber:eager-nll-type-relating, r=lcnr
Make NLL Type Relating Eager

We previously instantiated bound regions in nll type relating lazily. Making this eager is more consistent with how we handle type relating in [`higher_ranked_sub`](0a3b557d52/compiler/rustc_infer/src/infer/higher_ranked/mod.rs (L28)) and should allow us to short circuit in case there's structural equality.
2023-03-23 01:26:59 +00:00
Boxy
3f7aeb30ae make param bound vars visibly bound vars 2023-03-23 00:07:55 +00:00
Scott McMurray
64cce5fc7d Add CastKind::Transmute to MIR
Updates `interpret`, `codegen_ssa`, and `codegen_cranelift` to consume the new cast instead of the intrinsic.

Includes `CastTransmute` for custom MIR building, to be able to test the extra UB.
2023-03-22 15:15:41 -07:00
Matthias Krüger
783f3a1965
Rollup merge of #109501 - lukas-code:link, r=WaffleLapkin
make link clickable
2023-03-22 22:44:43 +01:00
Matthias Krüger
28b9354bf6
Rollup merge of #109447 - lcnr:coherence, r=compiler-errors
new solver cleanup + implement coherence

the cleanup:
- change `Certainty::unify_and` to consider ambig + overflow to be ambig
- rename `trait_candidate_should_be_dropped_in_favor_of` to `candidate_should_be_dropped_in_favor_of`
- remove outdated fixme

For coherence I mostly just add an ambiguous candidate if the current trait ref is unknowable. I am doing the same for reservation impl where I also just add an ambiguous candidate.
2023-03-22 22:44:43 +01:00
Matthias Krüger
b22db3fca4
Rollup merge of #109423 - fmease:iat-selection-erase-regions-in-self-ty, r=compiler-errors
Use region-erased self type during IAT selection

Split off from #109410 as discussed.
Fixes #109299.

Re UI test: I use a reproducer of #109299 that contains a name resolution error instead of reproducer [`regionck-2.rs`](fc7ed4af16/tests/ui/associated-inherent-types/regionck-2.rs) (as found in the `AliasKind::Inherent` PR) since it would (incorrectly) pass typeck in this PR due to the lack of regionck and I'd rather not make *that* a regression test (with or without `known-bug`).

``@rustbot`` label F-inherent_associated_types

r? ``@compiler-errors``
2023-03-22 22:44:42 +01:00
Matthias Krüger
2ee07a19b7
Rollup merge of #109378 - MU001999:master, r=scottmcm
Remove Ty::is_region_ptr

Fixes #109372
2023-03-22 22:44:42 +01:00
Matthias Krüger
577d85f92f
Rollup merge of #109358 - petrochenkov:nosess, r=cjgillot
rustc: Remove unused `Session` argument from some attribute functions

(One auxiliary test file containing one of these functions was unused, so I removed it instead of updating.)
2023-03-22 22:44:41 +01:00
Matthias Krüger
950aa3ef86
Rollup merge of #109213 - oli-obk:cstore, r=cjgillot
Eagerly intern and check CrateNum/StableCrateId collisions

r? ``@cjgillot``

It seems better to check things ahead of time than checking them afterwards.
The [previous version](https://github.com/rust-lang/rust/pull/108390) was a bit nonsensical, so this addresses the feedback
2023-03-22 22:44:40 +01:00
Matthias Krüger
34fa6daa5c
Rollup merge of #109203 - Ezrashaw:refactor-ident-parsing, r=Nilstrieb
refactor/feat: refactor identifier parsing a bit

\+ error recovery for `expected_ident_found`

Prior art: #108854
2023-03-22 22:44:39 +01:00
bors
8859fde21f Auto merge of #109497 - matthiaskrgr:rollup-6txuxm0, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #109373 (Set LLVM `LLVM_UNREACHABLE_OPTIMIZE` to `OFF`)
 - #109392 (Custom MIR: Allow optional RET type annotation)
 - #109394 (adapt tests/codegen/vec-shrink-panik for LLVM 17)
 - #109412 (rustdoc: Add GUI test for "Auto-hide item contents for large items" setting)
 - #109452 (Ignore the vendor directory for tidy tests.)
 - #109457 (Remove comment about reusing rib allocations)
 - #109461 (rustdoc: remove redundant `.content` prefix from span/a colors)
 - #109477 (`HirId` to `LocalDefId` cleanup)
 - #109489 (More general captures)
 - #109494 (Do not feed param_env for RPITITs impl side)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-22 21:35:02 +00:00
Daniel Paoliello
a90f342b03 Use -m option instead of looking for a cross-compiling version of dlltool 2023-03-22 14:30:28 -07:00
Lukas Markeffsky
1581b97acb make link clickable 2023-03-22 22:01:19 +01:00
Scott McMurray
b537e6bc53 Generate simpler MIR for shifts 2023-03-22 13:32:12 -07:00
Matthias Krüger
6244b94377
Rollup merge of #109494 - spastorino:new-rpitit-18, r=compiler-errors
Do not feed param_env for RPITITs impl side

r? `@compiler-errors`

I don't think this needs more comments or things that we already have but please let me know if you want some comments or something else in this PR.
2023-03-22 20:08:05 +01:00
Matthias Krüger
9629156fc7
Rollup merge of #109489 - est31:generalize_captures, r=WaffleLapkin
More general captures

This avoids repetition of the binding.
2023-03-22 20:08:04 +01:00
Matthias Krüger
040001e7c1
Rollup merge of #109477 - lcnr:cleanup, r=cjgillot
`HirId` to `LocalDefId` cleanup

revival of the still relevant parts of #109125
2023-03-22 20:08:04 +01:00
Matthias Krüger
3712bfff1b
Rollup merge of #109457 - Veykril:ribstack, r=petrochenkov
Remove comment about reusing rib allocations

Perf indicates this to not be worth the complexity

cc #4948
2023-03-22 20:08:03 +01:00
Dylan DPC
eda88a30c7
Rollup merge of #109435 - oli-obk:🇨🇭🥚_copy_op, r=RalfJung
Detect uninhabited types early in const eval

r? `@RalfJung`

implements https://github.com/rust-lang/rust/pull/108442#discussion_r1143003840

this is a breaking change, as some UB during const eval is now detected instead of silently being ignored. Users can see this and other UB that may cause future breakage with `-Zextra-const-ub-checks` or just by running miri on their code, which sets that flag by default.
2023-03-23 00:00:35 +05:30
Dylan DPC
031640ccd2
Rollup merge of #109414 - spastorino:new-rpitit-16, r=compiler-errors
Do not consider synthesized RPITITs on missing items checks

Without this patch for `tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs` we get ...

```
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:4:12
  |
4 | #![feature(return_position_impl_trait_in_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0046]: not all trait items implemented, missing: `foo`, ``
  --> tests/ui/impl-trait/in-trait/dont-project-to-rpitit-with-no-value.rs:12:1
   |
8  |     fn foo(&self) -> impl Sized;
   |     ----------------------------
   |     |                |
   |     |                `` from trait
   |     `foo` from trait
...
12 | impl MyTrait for i32 {
   | ^^^^^^^^^^^^^^^^^^^^ missing `foo`, `` in implementation

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0046`.
```

instead of ...

```
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/dont-project-to-rpitit-with-no-value.rs:4:12
   |
LL | #![feature(return_position_impl_trait_in_trait)]
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
   = note: `#[warn(incomplete_features)]` on by default

error[E0046]: not all trait items implemented, missing: `foo`
  --> $DIR/dont-project-to-rpitit-with-no-value.rs:12:1
   |
LL |     fn foo(&self) -> impl Sized;
   |     ---------------------------- `foo` from trait
...
LL | impl MyTrait for i32 {
   | ^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0046`.
```

r? `@compiler-errors`
2023-03-23 00:00:35 +05:30
Dylan DPC
b9151b2d70
Rollup merge of #109405 - compiler-errors:rpitit-as-opaques, r=spastorino
RPITITs are `DefKind::Opaque` with new lowering strategy

r? `@spastorino`

Kinda cherry-picked #109400
2023-03-23 00:00:34 +05:30
Dylan DPC
8ce52b7b65
Rollup merge of #109317 - ehuss:discriminant-link-fix, r=Nilstrieb
Update links for custom discriminants.

The discriminant documentation was updated in https://github.com/rust-lang/reference/pull/1055 which changed the layout a bit. This updates the links to the updated locations.
2023-03-23 00:00:34 +05:30
Dylan DPC
af3bd22783
Rollup merge of #109312 - petrochenkov:docice5, r=GuillaumeGomez
rustdoc: Cleanup parent module tracking for doc links

Keep ids of the documented items themselves, not their parent modules. Parent modules can be retreived from those ids when necessary.

Fixes https://github.com/rust-lang/rust/issues/108501.
That issue could be fixed in a more local way, but this refactoring is something that I wanted to do since https://github.com/rust-lang/rust/pull/93805 anyway.
2023-03-23 00:00:33 +05:30
Dylan DPC
70918ecf06
Rollup merge of #109280 - compiler-errors:no-vec-map, r=Mark-Simulacrum
Remove `VecMap`

Not sure what the use of this data structure is over just using `FxIndexMap` or a `Vec`.

r? ```@ghost```
2023-03-23 00:00:32 +05:30
Dylan DPC
14d06467f0
Rollup merge of #109179 - llogiq:intrinsically-option-as-slice, r=eholk
move Option::as_slice to intrinsic

````@scottmcm```` suggested on #109095 I use a direct approach of unpacking the operation in MIR lowering, so here's the implementation.

cc ````@nikic```` as this should hopefully unblock #107224 (though perhaps other changes to the prior implementation, which I left for bootstrapping, are needed).
2023-03-23 00:00:31 +05:30
Michael Goulet
a34c92760c Implement non-const Destruct trait in new solver 2023-03-22 18:22:27 +00:00
Michael Goulet
5456eecab0 Clean up substs building 2023-03-22 18:16:01 +00:00
Michael Goulet
08284449a2 Subst gat normalize pred correctly 2023-03-22 18:16:01 +00:00
b-naber
8f4cf2e000 print sccs_info strings correctly 2023-03-22 18:13:18 +00:00
Santiago Pastorino
1c9ad28dd2
Do not feed param_env for RPITITs impl side 2023-03-22 14:06:22 -03:00
b-naber
35bc8ae86f eager nll type relating 2023-03-22 16:59:46 +00:00
b-naber
da0fe80137 assertion for only collection nll region variable information for debug in non-canonicalization contexts 2023-03-22 16:59:41 +00:00
Guillaume Gomez
825f0888cc Move useless_anynous_reexport lint into unused_imports 2023-03-22 16:05:20 +01:00
est31
edd7d4a9f7 More general captures
This avoids repetition
2023-03-22 15:39:24 +01:00
Lukas Wirth
204807d8a9 Remove comment about re-using Rib allocations 2023-03-22 12:09:19 +01:00
lcnr
0882def9aa review 2023-03-22 11:58:08 +01:00
lcnr
73c79cd806 stop special-casing 'static in evaluate 2023-03-22 11:37:57 +01:00
Vadim Petrochenkov
67a2c5bec8 rustc: Remove unused Session argument from some attribute functions 2023-03-22 13:55:55 +04:00
lcnr
45b44c7758 HirId to LocalDefId cleanup 2023-03-22 10:36:30 +01:00
Mu42
20f3f437d1 Fixes #109436: add parentheses properly 2023-03-22 13:52:24 +08:00
bors
9bdb4881c7 Auto merge of #109119 - lcnr:trait-system-cleanup, r=compiler-errors
a general type system cleanup

removes the helper functions `traits::fully_solve_X` as they add more complexity then they are worth. It's confusing which of these helpers should be used in which context.

changes the way we deal with overflow to always add depth in `evaluate_predicates_recursively`. It may make sense to actually fully transition to not have `recursion_depth` on obligations but that's probably a bit too much for this PR.

also removes some other small - and imo unnecessary - helpers.

r? types
2023-03-22 05:33:18 +00:00
bors
5fa73a75ce Auto merge of #109087 - cjgillot:sparse-bb-clear, r=davidtwco
Only clear written-to locals in ConstProp

This aims to revert the regression in https://github.com/rust-lang/rust/pull/108872

Clearing all locals at the end of each bb is very costly.
This PR goes back to the original implementation of recording which locals are modified.
2023-03-22 02:49:04 +00:00
Michael Goulet
c3e6f68931 RPITITs are DefKind::Opaque with new lowering strategy 2023-03-21 23:36:07 +00:00
Santiago Pastorino
c1f3529c91 Always encode RPITITs 2023-03-21 23:35:46 +00:00
León Orell Valerian Liehr
293f21c876
iat selection: erase regions in self type 2023-03-21 23:53:58 +01:00
Nilstrieb
29c11327c7 Use SmallVec in bitsets
This doesn't increase their size and means that we don't have to heap
allocate for small sets.
2023-03-21 22:20:09 +01:00
bors
1db9c061d3 Auto merge of #109453 - matthiaskrgr:rollup-odn02wu, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #96391 (Windows: make `Command` prefer non-verbatim paths)
 - #108164 (Drop all messages in bounded channel when destroying the last receiver)
 - #108729 (fix: modify the condition that `resolve_imports` stops)
 - #109336 (Constrain const vars to error if const types are mismatched)
 - #109403 (Avoid ICE of attempt to add with overflow in emitter)
 - #109415 (Refactor `handle_missing_lit`.)
 - #109441 (Only implement Fn* traits for extern "Rust" safe function pointers and items)
 - #109446 (Do not suggest bounds restrictions for synthesized RPITITs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-21 20:56:38 +00:00
Santiago Pastorino
364a5d4b54
Do not consider synthesized RPITITs on missing items checks 2023-03-21 15:44:12 -03:00
Matthias Krüger
94d2028abd
Rollup merge of #109446 - spastorino:new-rpitit-17, r=compiler-errors
Do not suggest bounds restrictions for synthesized RPITITs

Before this PR we were getting ...

```
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> tests/ui/async-await/in-trait/missing-send-bound.rs:5:12
  |
5 | #![feature(async_fn_in_trait)]
  |            ^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: future cannot be sent between threads safely
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:17:20
   |
17 |     assert_is_send(test::<T>());
   |                    ^^^^^^^^^^^ future returned by `test` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:13:5
   |
13 |     T::bar().await;
   |     ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
note: required by a bound in `assert_is_send`
  --> tests/ui/async-await/in-trait/missing-send-bound.rs:21:27
   |
21 | fn assert_is_send(_: impl Send) {}
   |                           ^^^^ required by this bound in `assert_is_send`
help: consider further restricting the associated type
   |
16 | fn test2<T: Foo>() where impl Future<Output = ()>: Send {
   |                    ++++++++++++++++++++++++++++++++++++

error: aborting due to previous error; 1 warning emitted
```

and we want this output ...

```
warning: the feature `async_fn_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
  --> $DIR/missing-send-bound.rs:5:12
   |
LL | #![feature(async_fn_in_trait)]
   |            ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
   = note: `#[warn(incomplete_features)]` on by default

error: future cannot be sent between threads safely
  --> $DIR/missing-send-bound.rs:17:20
   |
LL |     assert_is_send(test::<T>());
   |                    ^^^^^^^^^^^ future returned by `test` is not `Send`
   |
   = help: within `impl Future<Output = ()>`, the trait `Send` is not implemented for `impl Future<Output = ()>`
note: future is not `Send` as it awaits another future which is not `Send`
  --> $DIR/missing-send-bound.rs:13:5
   |
LL |     T::bar().await;
   |     ^^^^^^^^ await occurs here on type `impl Future<Output = ()>`, which is not `Send`
note: required by a bound in `assert_is_send`
  --> $DIR/missing-send-bound.rs:21:27
   |
LL | fn assert_is_send(_: impl Send) {}
   |                           ^^^^ required by this bound in `assert_is_send`

error: aborting due to previous error; 1 warning emitted
```

r? `@compiler-errors`
2023-03-21 19:00:15 +01:00
Matthias Krüger
fef1fc4349
Rollup merge of #109441 - oli-obk:fn_trait_new_solver, r=compiler-errors
Only implement Fn* traits for extern "Rust" safe function pointers and items

Since calling the function via an `Fn` trait will assume `extern "Rust"` ABI and not do any safety checks, only safe `extern "Rust"` function can implement the `Fn` traits. This syncs the logic between the old solver and the new solver.

r? `@compiler-errors`
2023-03-21 19:00:14 +01:00
Matthias Krüger
96f35ed720
Rollup merge of #109415 - nnethercote:refactor-handle_missing_lit, r=petrochenkov
Refactor `handle_missing_lit`.

A small code readability improvement.

r? ```@petrochenkov```
2023-03-21 19:00:14 +01:00
Matthias Krüger
25b062d586
Rollup merge of #109403 - chenyukang:yukang/fix-109396, r=estebank
Avoid ICE of attempt to add with overflow in emitter

Fixes #109396
r? ```@estebank```
2023-03-21 19:00:13 +01:00
Matthias Krüger
081c607b0a
Rollup merge of #109336 - compiler-errors:constrain-to-ct-err, r=BoxyUwU
Constrain const vars to error if const types are mismatched

When equating two consts of different types, if either are const variables, constrain them to the correct const error kind.

This helps us avoid "successfully" matching a const against an impl signature but leaving unconstrained const vars, which will lead to incremental ICEs when we call const-eval queries during const projection.

Fixes #109296

The second commit in the stack fixes a regression in the first commit where we end up mentioning `[const error]` in an impl overlap error message. I think the error message changes for the better, but I could implement alternative strategies to avoid this without delaying the overlap error message...

r? `@BoxyUwU`
2023-03-21 19:00:12 +01:00
Matthias Krüger
ee330a3ff5
Rollup merge of #108729 - bvanjoi:fix-issue-97534, r=petrochenkov
fix: modify the condition that `resolve_imports` stops

close #97534
2023-03-21 19:00:12 +01:00
John Kåre Alsaker
6c57dda44d Remove unique and move VerboseTimingGuard fields into a new struct 2023-03-21 18:41:45 +01:00
John Kåre Alsaker
f60d2eb6c1 Add -Z time-passes-format to allow specifying a JSON output for -Z time-passes 2023-03-21 18:18:25 +01:00
John Kåre Alsaker
b0dc15c61b Reduce output spam 2023-03-21 18:18:25 +01:00
Santiago Pastorino
3b04ad2753
Do not suggest bounds restrictions for synthesized RPITITs 2023-03-21 13:18:32 -03:00
lcnr
f86b0358f8 woops 2023-03-21 16:39:24 +01:00
Michael Goulet
b1a957b0b9 query_keys_local is conditional on separate_provide_if_extern 2023-03-21 15:38:52 +00:00
Michael Goulet
d213114cb5 LocalCrate key 2023-03-21 15:38:52 +00:00
Michael Goulet
dcaf956de0 AsLocalKey trait 2023-03-21 15:38:52 +00:00
Michael Goulet
7e6506764b IdentitySubsts::identity_for_item takes Into<DefId> 2023-03-21 15:38:52 +00:00
Michael Goulet
979ef5981f Use LocalDefId in ItemCtxt 2023-03-21 15:38:52 +00:00
Michael Goulet
2eb1c08e43 Use local key in providers 2023-03-21 15:38:51 +00:00
lcnr
a7ec045be8 disable global caching during coherence 2023-03-21 16:38:40 +01:00
lcnr
938434ab82 enable intercrate in the solver InferCtxt 2023-03-21 16:34:04 +01:00
lcnr
47f24a881b new solver cleanup + coherence 2023-03-21 16:27:25 +01:00
Vadim Petrochenkov
d3a5541939 rustdoc: Cleanup parent module tracking for doc links
Keep ids of the documented items themselves, not their parent modules.
Parent modules can be retreived from those ids when necessary.
2023-03-21 17:36:57 +04:00
Oli Scherer
460ecd288a Eagerly intern and check CrateNum/StableCrateId collisions 2023-03-21 12:08:17 +00:00
yukang
7bffe945af add delay_span_bug 2023-03-21 20:05:34 +08:00
nils
925fbcdf8a
Rollup merge of #109408 - RalfJung:retags, r=compiler-errors
not *all* retags might be explicit in Runtime MIR

In https://github.com/rust-lang/rust/pull/105317 I made Miri treat `Rvalue::Ref/AddrOf` as implicit retagging sites. This updates the MIR docs accordingly.

For `Rvalue::Ref` I think this makes a lot more sense: creating a new reference is their entire point, so we can avoid bloating the MIR with retags. Also this seems to be the best way to handle cases like `*ptr = &[mut] ...`, where doing a retag is somewhat questionable since maybe `*ptr` points to another place now?

For `Rvalue::AddrOf`, Stacked Borrows needs this because even raw ptrs need some retagging, but Tree Borrows doesn't do ant retagging here and I hope we'll end up with a model where raw pointers don't get retagged.
2023-03-21 13:00:25 +01:00
nils
b2e48edded
Rollup merge of #109390 - cbeuw:aggregate-lit, r=oli-obk
Custom MIR: Support aggregate expressions

Add support for tuple, array and ADT expressions in custom mir

r? `````@oli-obk````` or `````@tmiasko````` or `````@JakobDegen`````
2023-03-21 13:00:25 +01:00
nils
c0adce567e
Rollup merge of #109385 - lcnr:typo, r=Dylan-DPC
fix typo
2023-03-21 13:00:24 +01:00
nils
66ba60a445
Rollup merge of #109240 - compiler-errors:dont-binder-twice, r=oli-obk
Walk un-shifted nested `impl Trait` in trait when setting up default trait method assumptions

Fixes a double subtraction in some binder math in return-position `impl Trait` in trait handling code.

Fixes #109239
2023-03-21 13:00:23 +01:00
nils
e79b182fca
Rollup merge of #108896 - BoxyUwU:new_solver_add_goal_fn, r=lcnr
new solver: make all goal evaluation able to be automatically rerun

It is generally wrong to call `evaluate_goal` multiple times or `evaluate_goal` and `evaluate_all` for the same `QueryResult` without correctly handling rerunning the goals when inference makes progress. Not doing so will result in the assertion in `evaluate_goal` firing because rerunning the goal will lead to a more accurate `QueryResult`.

Currently there are lots of places that get this wrong and generally it is complex and error prone to handle correctly everywhere. This PR introduces a way to add goals to the `EvalCtxt` and then run all the added goals in a loop so that `evaluate_goal`/`evaluate_all` is not necessary to call manually.

There are a few complications for making everything work "right":
1. the `normalizes-to` hack that replaces the rhs with an unconstrained infer var requires special casing in the new `try_evaluate_added_goals` function similar to how `evaluate_goal`'s assertion special cases that hack.

2. `assemble_candidates_after_normalizing_self_ty`'s normalization step needs to be reran for each candidate otherwise the found candidates will potentially get a more accurate `QueryResult` when rerunning the projection/trait goal which can effect the `QueryResult` of the projection/trait goal.
This is implemented via `EvalCtxt::probe`'s closure's `EvalCtxt` inheriting the added goals of the `EvalCtxt` that `probe` is called on, allowing us to add goals in a probe, and then enter a nested probe for each candidate and evaluate added goals which include the normalization step's goals.

I made `make_canonical_response` evaluate added goals so that it will be hard to mess up the impl of the solver by forgetting to evaluate added goals. Right now the only way to mess this up would be to call `response_no_constraints` (which from the name is obviously weird).

The visibility of `evaluate_goal` means that it can be called from various `compute_x_goal` or candidate assembly functions, this is generally wrong and we should never call `evaluate_goal` manually, instead we should be calling `add_goal`/`add_goals`. This is solved by moving `evaluate_goal` `evaluate_canonical_goal` and `compute_goal` into `eval_ctxt`'s module and making them private so they cannot be called from elsewhere, forcing people to call `add_goal/s` and `evaluate_added_goals_and_make_canonical_resposne`/`try_evaluate_added_goals`

---

Other changes:
- removed the `&& false` that was introduced to the assertion in `evaluate_goal` in #108839
- remove a `!self.did_overflow()` requirement in `search_graph.is_empty()` which causes goals that overflow to ICE
- made `EvalCtxt::eq` take `&mut self` and add all the nested goals via `add_goals` instead of returning them as 99% of call sites just immediately called `EvalCtxt::add_goals` manually.

r? `````@lcnr`````
2023-03-21 13:00:22 +01:00
nils
0ef4da126a
Rollup merge of #108842 - compiler-errors:non_lifetime_binders-object-safe, r=b-naber
Enforce non-lifetime-binders in supertrait preds are not object safe

We can't construct vtables for these supertraits.
2023-03-21 13:00:22 +01:00
Oli Scherer
a00413f680 Also check function items' signatures for Fn* trait compatibility 2023-03-21 11:50:14 +00:00
Oli Scherer
91d913168c Deduplicate fn trait compatibility checks 2023-03-21 11:38:13 +00:00
Oli Scherer
fb9e171ab7 Only implement Fn* traits for extern "Rust" safe function pointers. 2023-03-21 11:11:32 +00:00
Oli Scherer
f066d6785d Detect uninhabited types early in const eval. 2023-03-21 11:09:27 +00:00
lcnr
b8541eb767 use the correct param env 2023-03-21 09:57:22 +01:00
lcnr
c63861b9d5 evaluate: improve and fix recursion depth handling 2023-03-21 09:57:22 +01:00
lcnr
791ce0b7b5 remove some trait solver helpers
they add more complexity then they are worth. It's confusing
which of these helpers should be used in which context.
2023-03-21 09:57:20 +01:00
Oli Scherer
83dec62b26 Add a layout argument to enforce_validity.
This is in preparation of checking the validity only of certain types.
2023-03-21 08:52:31 +00:00
yukang
8126ccb77d Return equal for two identical projections 2023-03-21 15:28:11 +08:00
John Kåre Alsaker
ced33ad289 Refactor try_execute_query 2023-03-21 03:29:19 +01:00
bors
822c10feb7 Auto merge of #109046 - Zoxc:split-execute-job, r=cjgillot,michaelwoerister
Split `execute_job` into `execute_job_incr` and `execute_job_non_incr`

`execute_job` was a bit large, so this splits it in 2. Performance was neutral locally, but this may affect bootstrap times.
2023-03-20 23:53:09 +00:00
Michael Goulet
720cc40fa7 Enforce non-lifetime-binders in supertrait preds are not object safe 2023-03-20 22:38:57 +00:00
Nicholas Nethercote
93eeb12724 Refactor handle_missing_lit. 2023-03-21 09:28:52 +11:00
bors
44f5180584 Auto merge of #106610 - euclio:windows-rs, r=ChrisDenton
migrate compiler, bootstrap and compiletest to windows-rs

This PR migrates the compiler, bootstrap, and compiletest to use [windows-rs](https://github.com/microsoft/windows-rs) instead of winapi-rs. windows-rs is the bindings crate provided by Microsoft, and is actively maintained compared to winapi-rs. Not all ecosystem crates have migrated over yet, so there will be a period of time where both crates are used.

windows-rs also provides some nice ergonomics over winapi-rs to convert return values to `Result`s (which found a case where we forgot to check the return value of `CreateFileW`).
2023-03-20 20:05:45 +00:00
Ralf Jung
5058cc8e62 not *all* retags might be explicit in Runtime MIR 2023-03-20 19:36:01 +01:00
bors
febd59e122 Auto merge of #109384 - matthiaskrgr:rollup-hu348gs, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #109170 (Set `CMAKE_SYSTEM_NAME` for Linux targets)
 - #109266 (rustdoc: Correctly merge import's and its target's docs in one more case)
 - #109267 (Add tests for configure.py)
 - #109273 (Make `slice::is_sorted_by` implementation nicer)
 - #109277 (Fix generics_of for impl's RPITIT synthesized associated type)
 - #109307 (Ignore `Inlined` spans when computing caller location.)
 - #109364 (Only expect a GAT const param for `type_of` of GAT const arg)
 - #109365 (Update mdbook)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-20 17:33:20 +00:00
yukang
cbb8066321 Avoid ICE of attempt to add with overflow in emitter 2023-03-21 01:23:28 +08:00
Andy Russell
bb7c373fdf
migrate compiler, bootstrap, and compiletest to windows-rs 2023-03-20 13:19:35 -04:00
Andy Wang
f404f33c21
Use builtin_index instead of match
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2023-03-20 16:27:44 +01:00
Andy Wang
e24f5ac56b
Fix off-by-one in mir syntax doc 2023-03-20 15:27:40 +01:00
Andy Wang
8e4e55e524
Support aggregate expressions 2023-03-20 15:25:11 +01:00
bors
13b7aa4d7f Auto merge of #108524 - Zoxc:node-backtrace, r=cjgillot
Optimize dep node backtrace and ignore fatal errors

This attempts to optimize https://github.com/rust-lang/rust/pull/91742 while also passing through fatal errors.

r? `@cjgillot`
2023-03-20 11:54:00 +00:00
lcnr
5b4fa5bf98 fix typo 2023-03-20 10:46:43 +01:00
Matthias Krüger
f21c435801
Rollup merge of #109364 - compiler-errors:gat-const-arg, r=BoxyUwU
Only expect a GAT const param for `type_of` of GAT const arg

IDK why we were account for both `is_ty_or_const` instead of just for a const param, since we're computing the `type_of` a const param specifically.

Fixes #109300
2023-03-20 09:46:54 +01:00
Matthias Krüger
3efecba6e7
Rollup merge of #109307 - cjgillot:inline-location, r=compiler-errors
Ignore `Inlined` spans when computing caller location.

Fixes https://github.com/rust-lang/rust/issues/105538
2023-03-20 09:46:54 +01:00
Matthias Krüger
d86fd83ef6
Rollup merge of #109277 - spastorino:new-rpitit-14, r=compiler-errors
Fix generics_of for impl's RPITIT synthesized associated type

The only useful commit is the last one.

This makes `generics_of` for the impl side RPITIT copy from the trait's associated type and avoid the fn on the impl side which was previously wrongly used.
This solution is better but we still need to fix resolution of the generated generics.

r? ``@compiler-errors``
2023-03-20 09:46:53 +01:00
Ezra Shaw
05b5046633
feat: implement error recovery in expected_ident_found 2023-03-20 20:54:41 +13:00
Mu42
20dc532085 Remove Ty::is_region_ptr 2023-03-20 15:32:21 +08:00
Matthias Krüger
eb1f8dc2cb
Rollup merge of #109370 - DaniPopes:issue-109334, r=Nilstrieb
fix ClashingExternDeclarations lint ICE

Fixes #109334

First "real" contribution, please let me know if I did something wrong.

As I understand it, it's OK if a `#[repr(transparent)]` type has no non-zero sized types (aka is a ZST itself) and the function should just return the type normally instead of panicking

r? `@Nilstrieb`
2023-03-20 07:10:34 +01:00
Matthias Krüger
cd9fadea5b
Rollup merge of #109362 - nnethercote:split-meta-stats-items, r=bjorn3
Split `items` from `-Zmeta-stats` in two.

Because it's one of the biggest sections.

r? `@bjorn3`
2023-03-20 07:10:34 +01:00
Matthias Krüger
5d3f460708
Rollup merge of #109301 - Ezrashaw:fix-ctf-ice, r=Nilstrieb
fix: fix ICE in `custom-test-frameworks` feature

Fixes #107454

Simple fix to emit error instead of ICEing. At some point, all the code in `tests.rs` should be refactored, there is a bit of duplication (this PR's code is repeated five times over lol).

r? `@Nilstrieb` (active on the linked issue?)
2023-03-20 07:10:31 +01:00
Matthias Krüger
ede3c39fe6
Rollup merge of #109249 - compiler-errors:new-rpitit-comments, r=spastorino
Update names/comments for new return-position impl trait in trait lowering strategy

r? `@spastorino`

totally cosmetic
2023-03-20 07:10:30 +01:00
Michael Goulet
4fd66d70cb Update some names and comments 2023-03-20 04:51:53 +00:00
Michael Goulet
239ec6cb11 drive-by: Fix a comment in TyCtxt::fold_regions and remove an unused method 2023-03-20 04:50:07 +00:00
Michael Goulet
9f80c75703 Walk un-shifted nested impl Trait in trait when setting up default trait method assumptions 2023-03-20 04:50:02 +00:00
bors
9d0eac4d02 Auto merge of #108148 - parthopdas:master, r=oli-obk
Implementing "<test_binary> --list --format json" for use by IDE test explorers / runners

Fixes #107307

PR 1 of 2 - wiring up just the new information + implement the command line changes i.e. --format json + tests

upcoming:
PR 2 of 2 - clean up "#[cfg(not(bootstrap))]" from PR 1

As per the discussions on
- MCP: https://rust-lang.zulipchat.com/#narrow/stream/233931-t-compiler.2Fmajor-changes/topic/Implementing.20.22.3Ctest_binary.3E.20--list.20--form.E2.80.A6.20compiler-team.23592/near/328747548
- preRFC: https://internals.rust-lang.org/t/pre-rfc-implementing-test-binary-list-format-json-for-use-by-ide-test-explorers-runners/18308
- FYI on Discord: https://discord.com/channels/442252698964721669/459149169546887178/1075581549409484820
2023-03-20 03:24:27 +00:00
DaniPopes
7ab612a7ee
remove bad comment 2023-03-20 00:55:36 +01:00
DaniPopes
8ca0f61fe3
fix ClashingExternDeclarations lint ICE 2023-03-20 00:50:03 +01:00
Michael Goulet
dbedf4003f Reformat type_of 2023-03-19 23:46:09 +00:00
Michael Goulet
252fa78283 Only expect a GAT const arg 2023-03-19 23:46:09 +00:00
Nicholas Nethercote
cb587e7f61 Split items from -Zmeta-stats in two.
Because it's one of the biggest sections.
2023-03-20 07:23:47 +11:00
许杰友 Jieyou Xu (Joe)
1f67949f0e
Lint ambiguous glob re-exports 2023-03-20 03:22:31 +08:00
Arpad Borsos
c8ead2e693
Remove the NodeId of ast::ExprKind::Async 2023-03-19 19:01:31 +01:00
John Kåre Alsaker
c4bcac628c Add some assertions 2023-03-19 17:39:34 +01:00
John Kåre Alsaker
486a38723b Split execute_job into execute_job_incr and execute_job_non_incr 2023-03-19 17:39:34 +01:00
bohan
1775722410 fix: modify the condition that resolve_imports stops 2023-03-19 20:18:45 +08:00
Dylan DPC
881c9898ad
Rollup merge of #109324 - cjgillot:fixed-unused-params, r=Nilstrieb
Implement FixedSizeEncoding for UnusedGenericParams.

Using a `Lazy` for actually a `u32` value is 50% overhead, so let's encode the bitset directly.
2023-03-19 15:33:59 +05:30
Dylan DPC
1f0fcf13f5
Rollup merge of #109243 - chenyukang:yukang/fix-ice-109144, r=petrochenkov
The name of NativeLib will be presented

Fixes #109144

I was working on a quick fix, but found change the name from `Option<Symbol>` to `Symbol` make life a little bit easier.
2023-03-19 15:33:59 +05:30