1
Fork 0
Commit graph

272117 commits

Author SHA1 Message Date
Matthias Krüger
af1ca153d4
Rollup merge of #132410 - bjorn3:yet_another_driver_refactor_round, r=cjgillot
Some more refactorings towards removing driver queries

Follow up to https://github.com/rust-lang/rust/pull/127184

## Custom driver breaking change

The `after_analysis` callback is changed to accept `TyCtxt` instead of `Queries`. The only safe query in `Queries` to call at this point is `global_ctxt()` which allows you to enter the `TyCtxt` either way. To fix your custom driver, replace the `queries: &'tcx Queries<'tcx>` argument with `tcx: TyCtxt<'tcx>` and remove your `queries.global_ctxt().unwrap().enter(|tcx| { ... })` call and only keep the contents of the closure.

## Custom driver deprecation

The `after_crate_root_parsing` callback is now deprecated. Several custom drivers are incorrectly calling `queries.global_ctxt()` from inside of it, which causes some driver code to be skipped. As such I would like to either remove it in the future or if custom drivers still need it, change it to accept an `&rustc_ast::Crate` instead.
2024-11-27 22:23:24 +01:00
Soveu
685f189b43 Stabilize extended_varargs_abi_support 2024-11-27 22:21:33 +01:00
bors
66adeaf46b Auto merge of #133509 - Urgau:dangling_lint_perf, r=Noratrieb
Recover some lost performence from #132732

This PR reorders some conditions in the `dangling_pointers_from_temporaries` lint to avoid some potentially expensive query call, in particular those who could involve some metadata decoding from disk.

cc https://github.com/rust-lang/rust/pull/132732#issuecomment-2499990683
cc `@Kobzol`
2024-11-27 21:19:54 +00:00
Michael Goulet
871cfc9dff Further simplifications 2024-11-27 21:03:15 +00:00
Ralf Jung
37d3c6186e extend group-forbid-always-trumps-cli test 2024-11-27 21:48:23 +01:00
Michael Goulet
4120fdbeab Check xform_ret_ty for WF in the new solver to improve method winnowing 2024-11-27 20:46:08 +00:00
Michael Goulet
26c77742c3 Structurally resolve before applying projection in borrowck 2024-11-27 20:39:49 +00:00
Jason Newcomb
b4163f08c7
[bad_bit_mask] Fix FP on proc macros (#13736)
`clap-3.1.6` was not compiling on the rustc-perf benchmarks because of
this lint. Also, the user could not allow the lint on the macro itself
because it was checking Exprs, not whatever the input of `bitflags!` is.

```
error: &-masking with zero
   --> src/build/arg_settings.rs:197:1
    |
            (#[allow] here)
197 | / bitflags! {
198 | |     struct Flags: u32 {
199 | |         const REQUIRED         ...
200 | |         const MULTIPLE_OCC     ...
...   |
226 | |     }
227 | | }
    | |_^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask
    = note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)
```

changelog:  [`bad_bit_mask`]: Fix FP on procedural macros
2024-11-27 20:31:29 +00:00
Michael Goulet
0f5759a005 Address review comments 2024-11-27 20:24:48 +00:00
Michael Goulet
959801ff2e Handle bounds that come from the trait itself 2024-11-27 20:24:26 +00:00
Michael Goulet
87c045e2b3 Robustify and genericize RTN resolution in RBV 2024-11-27 20:24:25 +00:00
Timo
67657da671
Handle repetition of associated constant constraint as well (#13723)
changelog: [`trait_duplication_in_bounds`]: trigger on duplicate const
associated constraint as well

~~The first commit is part of #13722 which must be merged first.~~
2024-11-27 20:23:54 +00:00
Josh Stone
21b1ab1779 Fill in a BTreeSet::entry example 2024-11-27 12:22:21 -08:00
onur-ozkan
e11cfebf4e print generated doc paths
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-11-27 22:57:53 +03:00
Josh Stone
82b8ea8a7a Add a tracking issue for btree_set_entry 2024-11-27 11:43:05 -08:00
Josh Stone
e37ac2a66f rustc_span: Replace a HashMap<_, ()> with HashSet
Now that `HashSet::entry()` exists, we don't need to fake it with a map.
2024-11-27 11:23:25 -08:00
Josh Stone
b0f8bd7438 Add BTreeSet entry APIs to match HashSet
* `fn get_or_insert(&mut self, value: T) -> &T`
* `fn get_or_insert_with<Q: ?Sized, F>(&mut self, value: &Q, f: F) -> &T`
* `fn entry(&mut self, value: T) -> Entry<'_, T, A>` (+ `Entry` APIs)
2024-11-27 10:51:24 -08:00
Philipp Krones
9b0597d78a
Fix: Use multipart_suggestion for derivable_impls (#13717)
This should address #13099 for the `derivable_impls` test. As I've not
contributed to clippy before, I'd like to make sure i'm on the right
track before doing more :)

changelog: [`derivable_impls`]: Use multipart_suggestion to aggregate
feedback
2024-11-27 17:07:51 +00:00
Henry Jiang
527b6065ba
fmt 2024-11-27 12:02:02 -05:00
bors
6b6a867ae9 Auto merge of #133474 - RalfJung:gvn-miscompile, r=compiler-errors
Do not unify dereferences of shared borrows in GVN

Repost of https://github.com/rust-lang/rust/pull/132461, the last commit applies my suggestions.

Fixes https://github.com/rust-lang/rust/issues/130853
2024-11-27 15:43:56 +00:00
Boxy
583e26c5dd clippy lints 2024-11-27 15:25:08 +00:00
Eric Huss
f94142b366 Update tests to use new proc-macro header 2024-11-27 07:18:25 -08:00
Boxy
22998f0785 update cfgs 2024-11-27 15:14:54 +00:00
Ralf Jung
41c3b5c377 show forbidden_lint_groups in future-compat reports 2024-11-27 15:27:41 +01:00
Eric Huss
f592dd95db Compiletest: Add proc-macro header
This adds a proc-macro header to make it easier to depend on a
proc-macro, and remove some of the boilerplate necessary.
2024-11-27 06:01:46 -08:00
bors
c322cd5c5a Auto merge of #133393 - compiler-errors:dyn-tweaks, r=lcnr,spastorino
Some minor dyn-related tweaks

Each commit should be self-explanatory, but I'm happy to explain what's going on if not. These are tweaks I pulled out of #133388, but they can be reviewed sooner than that.

r? types
2024-11-27 13:02:46 +00:00
Sebastian Urban
4342ec0cf2 Implement code review 2024-11-27 13:30:18 +01:00
Boxy
be78dabe18 bump stage0 2024-11-27 12:12:23 +00:00
Boxy
174ad448c7 replace placeholder version 2024-11-27 12:10:21 +00:00
bjorn3
dc65c6317a
Fix review comment 2024-11-27 11:57:29 +01:00
bors
39cb3386dd Auto merge of #133369 - Zalathar:profiler-builtins-no-core, r=jieyouxu
Allow injecting a profiler runtime into `#![no_core]` crates

An alternative to #133300, allowing `-Cinstrument-coverage` to be used with `-Zbuild-std`.

The incompatibility between `profiler_builtins` and `#![no_core]` crates appears to have been caused by profiler_builtins depending on core, and therefore conflicting with core (or minicore).

But that's a false dependency, because the profiler doesn't contain any actual Rust code. So we can just mark the profiler itself as `#![no_core]`, and remove the incompatibility error.

---

For context, the error was originally added by #79958.
2024-11-27 10:19:38 +00:00
Ralf Jung
562a85579e ensure JSON-defined targets are consistent 2024-11-27 10:13:36 +01:00
bors
5f8a2405a6 Auto merge of #133527 - matthiaskrgr:rollup-kyre1df, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #132979 (use `--exact` on `--skip` to avoid unintended substring matches)
 - #133248 (CI: split x86_64-msvc-ext job)
 - #133449 (std: expose `const_io_error!` as `const_error!`)
 - #133453 (Commit license-metadata.json to git and check it's correct in CI)
 - #133457 (miri: implement `TlsFree`)
 - #133493 (do not constrain infer vars in `find_best_leaf_obligation`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-27 07:38:21 +00:00
Matthias Krüger
762a661705
Rollup merge of #133493 - lcnr:fulfill-fudge, r=compiler-errors
do not constrain infer vars in `find_best_leaf_obligation`

This ended up causing an ICE by making the following code path reachable by incorrectly constraining an inference variable while computing the best obligation for a preceding ambiguity. Closes #129444.

f2abf827c1/compiler/rustc_trait_selection/src/solve/fulfill.rs (L312-L314)

I have to be honest, I don't fully understand how that change removes all the additional diagnostics :3

r? `@compiler-errors`
2024-11-27 08:13:49 +01:00
Matthias Krüger
3cce78b0d1
Rollup merge of #133457 - joboet:miri-tlsfree, r=saethlin
miri: implement `TlsFree`

If the variable does not need a destructor, `std` uses racy initialization for creating TLS keys on Windows. With just the right timing, this can lead to `TlsFree` being called. Unfortunately, with #132654 this is hit quite often, so miri should definitely support `TlsFree` ([documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-tlsfree)).

I'm filing this here instead of in the miri repo so that #132654 isn't blocked for so long.
2024-11-27 08:13:48 +01:00
Matthias Krüger
04d633366d
Rollup merge of #133453 - ferrocene:check-license-metadata, r=Kobzol
Commit license-metadata.json to git and check it's correct in CI

This PR adds `license-metadata.json` to the root of the git repo, and changes `mingw-check` to check that the file is still up-to-date.

By committing this file, we remove the need for developers to a) have reuse installed or b) run an expensive ~90 second analysis of the files on disk when they want generate the COPYRIGHT.html files which depend on this license metadata.

The file will need updating whenever `REUSE.toml` changes, or when git submodules are added, or when git submodules change their license information (as detected by REUSE).

You can now run:

* `./x run collect-license-metadata` to update the `./license-metadata.json` file
* `./x test collect-license-metadata` to test the `./license-metadata.json` file for correctness

The comparison is done with two `serde_json::Value` objects, so the map objects they contain should ignore differences in ordering.
2024-11-27 08:13:48 +01:00
Matthias Krüger
dcebc5eddd
Rollup merge of #133449 - joboet:io_const_error, r=tgross35
std: expose `const_io_error!` as `const_error!`

ACP: https://github.com/rust-lang/libs-team/issues/205
Tracking issue: https://github.com/rust-lang/rust/issues/133448

Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
2024-11-27 08:13:47 +01:00
Matthias Krüger
21f6ef577b
Rollup merge of #133248 - MarcoIeni:x86_64-msvc-ext-free, r=Kobzol
CI: split x86_64-msvc-ext job

try-job: x86_64-msvc-ext1
try-job: x86_64-msvc-ext3
2024-11-27 08:13:46 +01:00
Matthias Krüger
ee2d862212
Rollup merge of #132979 - onur-ozkan:skip-exact, r=jieyouxu,tgross35
use `--exact` on `--skip` to avoid unintended substring matches

Without the `--exact` flag, using `--skip tests/rustdoc` can unintentionally skip other tests that match as substrings such as `rustdoc-gui`, `rustdoc-js`, etc.

For debugging, run: `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc` and `./x.py --stage 2 test rustdoc-ui --skip tests/rustdoc -- --exact`

Resolves https://github.com/rust-lang/rust/issues/117721

try-job: x86_64-apple-1
2024-11-27 08:13:46 +01:00
Urgau
b6c80a610f Avoid even more decoding if not absolutely necessary 2024-11-27 07:35:55 +01:00
bors
83965efe6a Auto merge of #133274 - ehuss:macro_rules-edition-from-pm, r=compiler-errors
Use edition of `macro_rules` when compiling the macro

This changes the edition assigned to a macro_rules macro when it is compiled to use the edition of where the macro came from instead of the local crate's edition.

This fixes a problem when a macro_rules macro is created by a proc-macro. Previously that macro would be tagged with the local edition, which would cause problems with using the correct edition behavior inside the macro. For example, the check for unsafe attributes would cause errors in 2024 when using proc-macros from older editions.

This is partially related to https://github.com/rust-lang/rust/issues/132906. Unfortunately this is only a half fix for that issue. It fixes the error that happens in 2024, but does not fix the lint firing in 2021. I'm still trying to think of some way to fix that, but I'm running low on ideas.
2024-11-27 04:54:08 +00:00
Michael Goulet
4c0ea55f40 Bless tests due to extra error reporting due to normalizing types that are not WF
It's okay though b/c these are duplicated diagnostics.
2024-11-27 03:34:58 +00:00
Michael Goulet
48b2bbd0de Structurally resolve before matching on type of projection 2024-11-27 02:46:08 +00:00
Michael Goulet
72cd7ac4f1 Structurally resolve before checking never 2024-11-27 02:39:07 +00:00
bors
48696f5bd6 Auto merge of #133516 - compiler-errors:rollup-mq334h8, r=compiler-errors
Rollup of 8 pull requests

Successful merges:

 - #115293 (Remove -Zfuel.)
 - #132605 (CI: increase timeout from 4h to 6h)
 - #133304 (Revert diagnostics hack to fix ICE 132920)
 - #133402 (Constify `Drop` and `Destruct`)
 - #133458 (Fix `Result` and `Option` not getting a jump to def link generated)
 - #133471 (gce: fix typing_mode mismatch)
 - #133475 (`MaybeStorage` improvements)
 - #133513 (Only ignore windows-gnu in avr-jmp-offset)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-11-27 02:13:49 +00:00
Michael Goulet
702996c31b
Rollup merge of #133513 - ChrisDenton:windows-msvc, r=jieyouxu
Only ignore windows-gnu in avr-jmp-offset

The failure in 133480 occurs on mingw but there's currently no evidence it fails on msvc too.
2024-11-26 20:35:41 -05:00
Michael Goulet
219b2a010d
Rollup merge of #133475 - nnethercote:MaybeStorage-improvements, r=lcnr
`MaybeStorage` improvements

Minor dataflow improvements.

r? `@tmiasko`
2024-11-26 20:35:40 -05:00
Michael Goulet
82622c6876
Rollup merge of #133471 - lcnr:uwu-gamer, r=BoxyUwU
gce: fix typing_mode mismatch

Fixes #133271

r? `@BoxyUwU`
2024-11-26 20:35:39 -05:00
Michael Goulet
32dc3936a0
Rollup merge of #133458 - GuillaumeGomez:fix-prelude-tys-links, r=notriddle
Fix `Result` and `Option` not getting a jump to def link generated

It was just because we didn't store the "span" in the `PreludeTy` variant.

r? ``@notriddle``
2024-11-26 20:35:39 -05:00
Michael Goulet
8a2f57f0c4
Rollup merge of #133402 - compiler-errors:drop-and-destruct, r=lcnr
Constify `Drop` and `Destruct`

r? `@lcnr` or `@fee1-dead`
2024-11-26 20:35:38 -05:00