Commit graph

245284 commits

Author SHA1 Message Date
bors 039681112f Auto merge of #16456 - davidbarsky:david/tracing-followups, r=Veykril
internal: `tracing` improvements and followups

Hi folks! Building on https://github.com/rust-lang/rust-analyzer/pull/16394, I've got a few small tweaks:
- Removed the accidental `mod.rs` usage that I introduced.
- Removed a panic in `pat_analysis.rs`.
- Recorded the event kind in `handle_event` to better distinguish what _kind_ of event is being handled.
- Did a small refactor of `hprof` to have somewhat more linear control flow, and more importantly, write the recorded fields to the output.

The end result is the following:
<img width="1530" alt="A screenshot of Visual Studio Code on a Mac. `hprof.rs` is open, with " src="https://github.com/rust-lang/rust-analyzer/assets/2067774/bd11dde5-b2da-4774-bc38-bcb4772d1192">
2024-01-31 18:29:51 +00:00
Nadrieril f65fe3ba59 Remove pattern_arena from RustcMatchCheckCtxt 2024-01-31 19:25:40 +01:00
Nadrieril be77cf86ba Use a Vec instead of a slice in DeconstructedPat 2024-01-31 19:25:40 +01:00
Nadrieril 400dc46a05 Gracefully abort on type incompatibility
Since the only use of `TypeCx::bug` is in `Constructor::is_covered_by`,
it is tempting to return `false` instead of `Err()`, but that would
cause "non-exhaustive match" false positives.
2024-01-31 19:22:48 +01:00
David Barsky 44494e235a internal: teach hprof to record tracing fields 2024-01-31 13:15:47 -05:00
Johann Hemmann df2c7a6e4e cargo clippy --fix 2024-01-31 19:06:36 +01:00
Johann Hemmann 771c6c9271 format_collect 2024-01-31 19:06:36 +01:00
Johann Hemmann d37f4e0d21 new_without_default 2024-01-31 19:06:36 +01:00
Johann Hemmann e7e09e7750 large_enum_variant 2024-01-31 19:06:35 +01:00
Johann Hemmann 04ccef80cb field_reassign_with_default 2024-01-31 19:06:18 +01:00
Johann Hemmann dd9f27b8d3 borrow_deref_ref 2024-01-31 19:06:18 +01:00
Johann Hemmann c4688343de derivable_impls 2024-01-31 19:06:18 +01:00
Johann Hemmann 0adb4d1685 wildcard_in_or_patterns 2024-01-31 19:06:18 +01:00
Johann Hemmann b176cf2478 useless_format 2024-01-31 19:06:18 +01:00
Johann Hemmann b73ee2f50d useless_conversion 2024-01-31 19:06:18 +01:00
Johann Hemmann e7d0deac53 unnecessary_mut_passed 2024-01-31 19:06:18 +01:00
Johann Hemmann f191b80799 Refactor 2024-01-31 19:06:18 +01:00
Johann Hemmann c4302eaa56 unnecessary_lazy_evaluations 2024-01-31 19:06:18 +01:00
Johann Hemmann f15ee8a380 unnecessary_filter_map 2024-01-31 19:06:18 +01:00
Johann Hemmann de6f9561f2 unnecessary_cast 2024-01-31 19:06:18 +01:00
Johann Hemmann daa20725c5 toplevel_ref_arg 2024-01-31 19:06:18 +01:00
Johann Hemmann 386d438e17 skip_while_next 2024-01-31 19:06:18 +01:00
David Barsky 579e98c4c5 internal: record Event kind in handle_event 2024-01-31 13:00:40 -05:00
David Barsky 251b14f2c5 internal: don't panic in debug_pat 2024-01-31 13:00:30 -05:00
Brian Cain 647a453657 Correct paths for hexagon-unknown-none-elf platform doc
Update the library paths to correctly refer to libdemo{1,2}_hexagon
and switch to the release build instead.

Update references to libstandalone to the specific G0/PIC archive instead.
2024-01-31 09:44:45 -08:00
Oli Scherer d31905c904 Remove a has_errors check that doesn't actually prevent noisy follow up errors 2024-01-31 17:00:59 +00:00
Michael Goulet 3913c9a0ca Error on incorrect item kind in async bound 2024-01-31 16:59:19 +00:00
Michael Goulet 54db272cc9 Better error message in ed 2015 2024-01-31 16:59:19 +00:00
Michael Goulet cd2fd34ca6 Add tests 2024-01-31 16:59:19 +00:00
Michael Goulet 0eb2adb7e8 Add async bound modifier to enable async Fn bounds 2024-01-31 16:59:19 +00:00
Oli Scherer 28f250d6a6 Remove a has_errors check that does not prevent follow up error noise 2024-01-31 16:51:42 +00:00
Oli Scherer a6b1e433da Remove a has_errors check that only hides errors after unrelated items have errored. 2024-01-31 16:51:42 +00:00
Oli Scherer f7531f18b8 Remove has_errors check that has no effect 2024-01-31 16:51:42 +00:00
bors 11f32b73e0 Auto merge of #120524 - Nadrieril:rollup-67952ib, r=Nadrieril
Rollup of 9 pull requests

Successful merges:

 - #120207 (check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test)
 - #120321 (pattern_analysis: cleanup the contexts)
 - #120355 (document `FromIterator for Vec` allocation behaviors)
 - #120430 (std: thread_local::register_dtor fix proposal for FreeBSD.)
 - #120469 (Provide more context on derived obligation error primary label)
 - #120472 (Make duplicate lang items fatal)
 - #120490 (Don't hash lints differently to non-lints.)
 - #120495 (Remove the `abi_amdgpu_kernel` feature)
 - #120501 (rustdoc: Correctly handle attribute merge if this is a glob reexport)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-31 15:01:22 +00:00
Nikita Popov 8eb48b4f4c Update data layouts in custom target tests for LLVM 18
Fixes https://github.com/rust-lang/rust/issues/120492.
2024-01-31 15:15:59 +01:00
GnomedDev 7ea4dbbadb
Store SHOULD_CAPTURE as AtomicU8 2024-01-31 13:58:52 +00:00
GnomedDev 3cc601ac7e
Switch OwnedStore handle count to AtomicU32 2024-01-31 13:36:37 +00:00
bors 355c9444e1 Auto merge of #16448 - Young-Flash:typos, r=lnicola
minor: correct typos

I use [crate-ci/typos](https://github.com/crate-ci/typos) to check typos in codebase, if it's ok with you, I'd like to add a typo check CI using [typos](https://github.com/crate-ci/typos) (with Apache-2.0, MIT licenses).

BTW, we can add a [_typos.toml](https://github.com/crate-ci/typos/blob/master/docs/reference.md) as white list for some intentional typos
2024-01-31 13:29:55 +00:00
Young-Flash 62ff8f33d4 minor: correct close to closure 2024-01-31 21:26:30 +08:00
Nadrieril 4eaf4c2615
Rollup merge of #120501 - GuillaumeGomez:glob-reexport-attr-merge-bugfix, r=notriddle
rustdoc: Correctly handle attribute merge if this is a glob reexport

Fixes #120487.

The regression was introduced in https://github.com/rust-lang/rust/pull/113091. Only non-glob reexports should have been impacted.

cc `````@Nemo157`````
r? `````@notriddle`````
2024-01-31 12:10:53 +01:00
Nadrieril 573e7f181d
Rollup merge of #120495 - clubby789:remove-amdgpu-kernel, r=oli-obk
Remove the `abi_amdgpu_kernel` feature

The tracking issue (#51575) has been closed for 3 years, with no activity for 5.
2024-01-31 12:10:53 +01:00
Nadrieril be4f8e2758
Rollup merge of #120490 - nnethercote:Diagnostic-hashing, r=estebank
Don't hash lints differently to non-lints.

`Diagnostic::keys`, which is used for hashing and equating diagnostics, has a surprising behaviour: it ignores children, but only for lints. This was added in #88493 to fix some duplicated diagnostics, but it doesn't seem necessary any more.

This commit removes the special case and only four tests have changed output, with additional errors. And those additional errors aren't exact duplicates, they're just similar. For example, in src/tools/clippy/tests/ui/same_name_method.rs we currently have this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:79:9
   |
LL |         impl T1 for S {}
   |         ^^^^^^^^^^^^^^^^
```
and with this change we also get this error:
```
error: method's name is the same as an existing method in a trait
  --> $DIR/same_name_method.rs:75:13
   |
LL |             fn foo() {}
   |             ^^^^^^^^^^^
   |
note: existing `foo` defined here
  --> $DIR/same_name_method.rs:81:9
   |
LL |         impl T2 for S {}
   |
```
I think printing this second argument is reasonable, possibly even preferable to hiding it. And the other cases are similar.

r? `@estebank`
2024-01-31 12:10:52 +01:00
Nadrieril 032596e34c
Rollup merge of #120472 - Nilstrieb:die, r=compiler-errors
Make duplicate lang items fatal

Prevents terminal spam.
2024-01-31 12:10:52 +01:00
Nadrieril 0313eb2182
Rollup merge of #120469 - estebank:issue-40120, r=TaKO8Ki
Provide more context on derived obligation error primary label

Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote:

```
error[E0277]: the trait bound `i32: Bar` is not satisfied
 --> f100.rs:6:6
  |
6 |     <i32 as Foo>::foo();
  |      ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo`
  |
help: this trait has no implementations, consider adding one
 --> f100.rs:2:1
  |
2 | trait Bar {}
  | ^^^^^^^^^
note: required for `i32` to implement `Foo`
 --> f100.rs:3:14
  |
3 | impl<T: Bar> Foo for T {}
  |         ---  ^^^     ^
  |         |
  |         unsatisfied trait bound introduced here
```

Fix #40120.
2024-01-31 12:10:51 +01:00
Nadrieril a7d5382e5c
Rollup merge of #120430 - devnexen:fix_tls_dtor_fbsd, r=cuviper
std: thread_local::register_dtor fix proposal for FreeBSD.

following-up 5d3d347 commit, rust started to spin
__cxa_thread_call_dtors warnings even without any TLS usage. using instead home made TLS destructor handler `register_dtor_fallback`.

close #120413
2024-01-31 12:10:51 +01:00
Nadrieril 03daaa6f07
Rollup merge of #120355 - the8472:doc-vec-fromiter, r=cuviper
document `FromIterator for Vec` allocation behaviors

[t-libs discussion](https://rust-lang.zulipchat.com/#narrow/stream/259402-t-libs.2Fmeetings/topic/Meeting.202024-01-24/near/417686526) about #120091 didn't reach a strong consensus, but it was agreed that if we keep the current behavior it should at least be documented even though it is an implementation detail.

The language is intentionally non-committal. The previous (non-existent) documentation permits a lot of implementation leeway and we want retain that. In some cases we even must retain it to be able to rip out some code paths that rely on unstable features.
2024-01-31 12:10:50 +01:00
Nadrieril 0eaa32fce2
Rollup merge of #120321 - Nadrieril:cleanup-cx, r=compiler-errors
pattern_analysis: cleanup the contexts

This cleans up a bit the various `*Ctxt`s I had left lying around. As a bonus this made it possible to make `PatternColumn` public. I don't have a use for that yet but that could come useful.

`UsefulnessCtxt` looks useless right now but I'll be adding a field or two in subsequent PRs.

r? `````@compiler-errors`````
2024-01-31 12:10:50 +01:00
Nadrieril bcb709b30f
Rollup merge of #120207 - onur-ozkan:120202-fix, r=clubby789
check `RUST_BOOTSTRAP_CONFIG` in `profile_user_dist` test

Fixes a logical bug in `profile_user_dist` test (explained in #120202).
2024-01-31 12:10:49 +01:00
Benoît du Garreau a158fb33ef Improve io::Read::read_buf_exact error case
- Use `const_io_error` instead of `Error::new`
- Use the same message as `read_exact`
2024-01-31 11:06:19 +01:00
bors 9d837a622d Auto merge of #16445 - lnicola:bump-scip, r=lnicola
internal: Bump scip

Fixes #16440
2024-01-31 09:27:01 +00:00