Commit Graph

245839 Commits

Author SHA1 Message Date
Nicolas Roche
575e0aa592 Startup objects disappearing from sysroot
When launching tests with --keep-stage option, startup objects
such as rsbegin.o an rsend.o may disappear from the corresponding
stageN compiler.

Fix issue #120784
2024-02-09 09:09:26 +01:00
DianQK
bc31920c63
Print image input file and checksum in CI only 2024-02-09 15:38:14 +08:00
LegionMammal978
c94bbb24db Clarify that atomic and regular integers can differ in alignment
The documentation for atomic integers says that they have the "same
in-memory representation" as their underlying integers. This might be
misconstrued as implying that they have the same layout. Therefore,
clarify that atomic integers' alignment is equal to their size.
2024-02-08 22:59:36 -05:00
Gurinder Singh
6e37f955e5 Emit more specific diagnostics when enums fail to cast with as 2024-02-09 09:19:44 +05:30
Nicholas Nethercote
7619792107 Fix ErrorGuaranteed unsoundness with stash/steal.
When you stash an error, the error count is incremented. You can then
use the non-zero error count to get an `ErrorGuaranteed`. You can then
steal the error, which decrements the error count. You can then cancel
the error.

Example code:
```
fn unsound(dcx: &DiagCtxt) -> ErrorGuaranteed {
    let sp = rustc_span::DUMMY_SP;
    let k = rustc_errors::StashKey::Cycle;
    dcx.struct_err("bogus").stash(sp, k);           // increment error count on stash
    let guar = dcx.has_errors().unwrap();           // ErrorGuaranteed from error count > 0
    let err = dcx.steal_diagnostic(sp, k).unwrap(); // decrement error count on steal
    err.cancel();                                   // cancel error
    guar                                            // ErrorGuaranteed with no error emitted!
}
```

This commit fixes the problem in the simplest way: by not counting
stashed errors in `DiagCtxt::{err_count,has_errors}`.

However, just doing this without any other changes leads to over 40 ui
test failures. Mostly because of uninteresting extra errors (many saying
"type annotations needed" when type inference fails), and in a few
cases, due to delayed bugs causing ICEs when no normal errors are
printed.

To fix these, this commit adds `DiagCtxt::stashed_err_count`, and uses
it in three places alongside `DiagCtxt::{has_errors,err_count}`. It's
dodgy to rely on it, because unlike `DiagCtxt::err_count` it can go up
and down. But it's needed to preserve existing behaviour, and at least
the three places that need it are now obvious.
2024-02-09 13:50:03 +11:00
David Barsky
2d09d69fbe internal: fix crash inside filter_unnecessary_bounds for a missing generic param 2024-02-08 20:58:48 -05:00
Ben Kimock
dbf817bae1 Add and use Unique::as_non_null_ptr 2024-02-08 19:56:30 -05:00
Ben Kimock
611c3cb561 Bless/fix tests 2024-02-08 19:56:30 -05:00
Ben Kimock
9e1b2d909b Add new ui tests 2024-02-08 19:56:30 -05:00
bors
57fda121d8 Auto merge of #16467 - DropDemBits:structured-snippet-migrate-6, r=DropDemBits
internal: Migrate assists to the structured snippet API, part 6/7

Continuing from #16082

Migrates the following assists:

- `extract_function`
- `generate_getter_or_setter`
- `generate_impl`
- `generate_new`
- `replace_derive_with_manual_impl`

Would've been the final PR in the structured snippet migration series, but I didn't notice that `generate_trait_from_impl` started to use `{insert,replace}_snippet` when I first started the migration 😅. This appears to be a pretty self-contained change, so I'll leave that for a separate future PR.

This also removes the last usages of `render_snippet`, which was a follow up goal of #11638. 🎉
2024-02-09 00:54:31 +00:00
Michael Goulet
e32c1ddc52 Don't ice in validation when error body is created 2024-02-09 00:40:43 +00:00
DropDemBits
05b8ccc378
Fix clippy lints 2024-02-08 19:39:04 -05:00
Michael Goulet
698a3c7ade Don't ICE in ByMoveBody when coroutine is tainted 2024-02-09 00:36:30 +00:00
Michael Goulet
7057188c54 make it recursive 2024-02-09 00:13:52 +00:00
Michael Goulet
7a63d3f16a Add tests for untested capabilities 2024-02-09 00:13:52 +00:00
Michael Goulet
548929dc5e Don't unnecessarily lower associated type bounds to impl trait 2024-02-09 00:13:51 +00:00
Michael Goulet
22d582a38d For a rigid projection, recursively look at the self type's item bounds 2024-02-09 00:13:51 +00:00
DropDemBits
1161082051
Remove unused code in utils
All usages of `render_snippet` and `Cursor` have been removed as part of the migration
2024-02-08 19:13:10 -05:00
DropDemBits
8eebf1701b
Migrate replace_derive_with_manual_impl to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
18ea09feca
Migrate generate_new to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
e28f5514e1
Add AssocItemList::add_item_at_start
Needed to recreate the behavior of `generate_new` addding the `new` method at the start of the impl
2024-02-08 19:13:10 -05:00
DropDemBits
e0117154cf
Migrate generate_impl to mutable ast 2024-02-08 19:13:10 -05:00
DropDemBits
ab2233e562
Migrate generate_getter_or_setter to mutable ast 2024-02-08 19:13:09 -05:00
DropDemBits
f1293a8fc4
Add newline to body when where clause is present 2024-02-08 19:13:09 -05:00
DropDemBits
0519414c19
Make ReferenceConversion methods return ast types 2024-02-08 19:13:09 -05:00
DropDemBits
039b3d0abb
Add make::ext::expr_self
Shortcut version of `make::expr_path(make::path_unqualified(make::path_segment_self()))`
2024-02-08 19:09:33 -05:00
DropDemBits
0e39257e5b
Migrate extract_function to mutable ast 2024-02-08 19:09:33 -05:00
DropDemBits
3924a0ef7c
Add ast versions of generate{_trait}_impl_text{_intransitive} 2024-02-08 19:09:33 -05:00
DropDemBits
8c0661b2de
Use GenericArgList for make::impl{_trait}
`make::impl_` no longer merges generic params and args in order to be in line
with `make::impl_`, which doesn't do it either.
2024-02-08 19:09:32 -05:00
Eric Huss
776590b14e Switch linkchecker to use html5ever for html parsing.
The existing regex-based HTML parsing was just too primitive to
correctly handle HTML content. Some books have legitimate `href="…"`
text which should not be validated because it is part of the text, not
actual HTML.
2024-02-08 14:23:40 -08:00
bors
98aa3624be Auto merge of #120807 - matthiaskrgr:rollup-1pf3glu, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #120590 (Remove unused args from functions)
 - #120750 (No need to take `ImplTraitContext` by ref)
 - #120769 (make future diffs minimal)
 - #120772 (Remove myself from review rotation.)
 - #120775 (Make `min_exhaustive_patterns` match `exhaustive_patterns` better)
 - #120778 (Deduplicate `tcx.instance_mir(instance)` calls in `try_instance_mir`)
 - #120782 (Fix mir pass ICE in the presence of other errors)
 - #120783 (Add release note for new ambiguous_wide_pointer_comparisons lint)
 - #120801 (Avoid ICE in drop recursion check in case of invalid drop impls)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-02-08 20:58:33 +00:00
Markus Reiter
d70d3204b7
Use transmute_unchecked in NonZero::new. 2024-02-08 20:44:32 +01:00
bors
13707845f7 Auto merge of #15863 - davidbarsky:davidbarsky/start-of-monorepo-mode, r=Veykril
feature: Create `UnindexedProject` notification to be sent to the client

(Note that this branch contains commits from https://github.com/rust-lang/rust-analyzer/pull/15830, which I'll rebase atop of as needed.)

Based on the discussion in https://github.com/rust-lang/rust-analyzer/issues/15837, I've added a notification and off-by-default toggle to send that notification from `handle_did_open_text_document`. I'm happy to rename/tweak this as needed.

I've been using this for a little bit, and it does seem to cause a little bit more indexing/work in rust-analyzer, but it's something that I'll profile as needed, I think.
2024-02-08 19:36:09 +00:00
Matthias Krüger
ed528515d0
Rollup merge of #120801 - oli-obk:drop_recursion_ice, r=Nilstrieb
Avoid ICE in drop recursion check in case of invalid drop impls

fixes #120787
2024-02-08 20:35:01 +01:00
Matthias Krüger
9565e8d81e
Rollup merge of #120783 - integer32llc:improve-release-notes, r=Mark-Simulacrum
Add release note for new ambiguous_wide_pointer_comparisons lint

I found out about this new lint in Rust because I had code allowing the Clippy lint. Clippy alerted me to the lint name change, and I went searching for the new lint's name in the release notes and was surprised there wasn't an item for it.
2024-02-08 20:35:00 +01:00
Matthias Krüger
1db56fbe81
Rollup merge of #120782 - oli-obk:track_errors8, r=WaffleLapkin
Fix mir pass ICE in the presence of other errors

fixes #120779

it is impossible to add a ui test for this, because it only reproduces in build-fail, but a test that also has errors in check-fail mode can't be made build-fail 🙃

I would have to add a run-make test or sth, which is overkill for such a tiny thing imo.
2024-02-08 20:35:00 +01:00
Matthias Krüger
3e523f6d3c
Rollup merge of #120778 - zetanumbers:refactor_try_instance_mir, r=compiler-errors
Deduplicate `tcx.instance_mir(instance)` calls in `try_instance_mir`
2024-02-08 20:34:59 +01:00
Matthias Krüger
949e55299d
Rollup merge of #120775 - Nadrieril:more-min_exh_pats, r=compiler-errors
Make `min_exhaustive_patterns` match `exhaustive_patterns` better

Split off from https://github.com/rust-lang/rust/pull/120742.

There remained two edge cases where `min_exhaustive_patterns` wasn't behaving like `exhaustive_patterns`. This fixes them, and tests the feature in a bunch more cases. I essentially went through all uses of `exhaustive_patterns` to see which ones would be interesting to compare between the two features.

r? `@compiler-errors`
2024-02-08 20:34:59 +01:00
Matthias Krüger
abef17d23b
Rollup merge of #120772 - m-ou-se:review, r=Nilstrieb
Remove myself from review rotation.

I've been unable to keep up with reviews. :(

Not sure if this helps much, considering there aren't many other libs reviewers on the rotation at the moment.

Hopefully I can add myself back again Soon™ when I can commit more time to reviewing.
2024-02-08 20:34:58 +01:00
Matthias Krüger
2386c7c6a8
Rollup merge of #120769 - tshepang:minimal-diffs, r=wesleywiser
make future diffs minimal
2024-02-08 20:34:58 +01:00
Matthias Krüger
1f31daa047
Rollup merge of #120750 - compiler-errors:itctx-by-val, r=cjgillot
No need to take `ImplTraitContext` by ref

We used to mutate `ImplTraitContext`, so it used to be `&mut` mutable ref. Then I think it used to have non-`Copy` data in it, so we took it by `&` ref. Now, none of that remains, so just copy it around.
2024-02-08 20:34:58 +01:00
Matthias Krüger
4ffb1a7f3d
Rollup merge of #120590 - compiler-errors:dead, r=Nilstrieb
Remove unused args from functions

`#[instrument]` suppresses the unused arguments from a function, *and* suppresses unused methods too! This PR removes things which are only used via `#[instrument]` calls, and fixes some other errors (privacy?) that I will comment inline.

It's possible that some of these arguments were being passed in for the purposes of being instrumented, but I am unconvinced by most of them.
2024-02-08 20:34:57 +01:00
Philipp Krones
4ec9eec9e8
Update Cargo.lock 2024-02-08 20:25:09 +01:00
Philipp Krones
beb4f7d523
Merge commit '60cb29c5e4f9772685c9873752196725c946a849' into clippyup 2024-02-08 20:24:42 +01:00
David Barsky
6330b028b3 feature: Add a UnindexedProject notification and a corresponding setting. 2024-02-08 14:23:00 -05:00
bors
60cb29c5e4 Auto merge of #12246 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2024-02-08 19:17:05 +00:00
Michael Goulet
540be28f6c sort suggestions for object diagnostic 2024-02-08 18:56:52 +00:00
Ayush Singh
92d4060176
Implement SystemTime for UEFI
- Uses SystemTable->RuntimeServices->GetTime()

Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2024-02-09 00:21:36 +05:30
onur-ozkan
993c72fdf1 always run configure_linker except for mir-opt tests
`configure_linker` now runs consistently unless it's for mir-opt tests.
 Previously `!= "check"` condition was causing dirt in the cargo cache between
 runs of `x anything-but-not-check` and `x check`

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-02-08 21:26:11 +03:00
Philipp Krones
2ca6c84194
Bump Clippy version -> 0.1.78 2024-02-08 19:13:40 +01:00