Commit Graph

241827 Commits

Author SHA1 Message Date
Celina G. Val 86451badf1 Add a method to check if type is a CStr 2023-12-15 13:18:41 -08:00
Jakub Stasiak 47282799da Add link to is_benchmark from the Ipv6Addr::is_global documentation
All other relevant is_* methods are mentioned in the list of addresses
here, is_benchmarking has been the only one missing.
2023-12-15 20:53:54 +01:00
bors a96d57bdb6 Auto merge of #118996 - matthiaskrgr:rollup-n6x2lc7, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #117824 (Stabilize `ptr::{from_ref, from_mut}`)
 - #118234 (Stabilize `type_name_of_val`)
 - #118944 (Move type relations into submodule `relate` in rustc_infer, and notify when it has changed)
 - #118977 (Simplify `src-script.js` code)
 - #118985 (Remove `@JohnTitor` from diagnostics pings)
 - #118986 (Simplify JS code a little bit)
 - #118988 (rustdoc: add regression test for JS data file loading)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-15 19:32:17 +00:00
Matthias Krüger 5fc9ff5619 Rollup merge of #118988 - notriddle:notriddle/varconst, r=GuillaumeGomez
rustdoc: add regression test for JS data file loading

Follow up for #118961
2023-12-15 20:19:56 +01:00
Matthias Krüger b377babd2b Rollup merge of #118986 - GuillaumeGomez:simplify-js-inline, r=notriddle
Simplify JS code a little bit

As mentioned, JS code can be simplified a little bit.

r? ``@notriddle``
2023-12-15 20:19:55 +01:00
Matthias Krüger 39b6f458c3 Rollup merge of #118985 - JohnTitor:rm-jtitor-diag-pings, r=compiler-errors
Remove @JohnTitor from diagnostics pings

I've been inactive around diagnostics for a while so would like to remove myself from the diagnostics-related ping groups for now.
2023-12-15 20:19:55 +01:00
Matthias Krüger ae9e08e65e Rollup merge of #118977 - GuillaumeGomez:simplifysrc-script, r=notriddle
Simplify `src-script.js` code

Instead of keeping this value in the global scope and still use it in the function in case it wasn't used outside, let's just use it inside the function.

r? ``@notriddle``
2023-12-15 20:19:54 +01:00
Matthias Krüger d5213cf52e Rollup merge of #118944 - compiler-errors:relate, r=lcnr
Move type relations into submodule `relate` in rustc_infer, and notify when it has changed

r? lcnr
2023-12-15 20:19:54 +01:00
Matthias Krüger ea6daca3cb Rollup merge of #118234 - tgross35:type_name_of_value, r=dtolnay
Stabilize `type_name_of_val`

Make the following API stable:

```rust
// in core::any
pub fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str
```

This is a convenience method to get the type name of a value, as opposed to `type_name` that takes a type as a generic.

Const stability is not added because this relies on `type_name` which is also not const. That has a blocking issue https://github.com/rust-lang/rust/issues/97156.

Wording was also changed to direct most of the details to `type_name` so we don't have as much duplicated documentation.

Fixes tracking issue #66359.

There were two main concerns in the tracking issue:

1. Naming: `type_name_of` and `type_name_of_val` seem like the only mentioned options. Differences in opinion here come from `std::mem::{size_of, align_of, size_of_val, align_of_val}`. This PR leaves the name as `type_name_of_val`, but I can change if desired since it is pretty verbose.
2. What this displays for `&dyn`: I don't think that having `type_name_of_val` function resolve those is worth the headache it would be, see https://github.com/rust-lang/rust/issues/66359#issuecomment-1718480774 for some workarounds. I also amended the docs wording to leave it open-ended, in case we have means to change that behavior in the future.

``@rustbot`` label -T-libs +T-libs-api +needs-fcp
r? libs-api
2023-12-15 20:19:53 +01:00
Matthias Krüger 8ad8f29ae0 Rollup merge of #117824 - WaffleLapkin:ptr_from_ref_stab, r=dtolnay
Stabilize `ptr::{from_ref, from_mut}`

I propose to stabilize the following APIs:

```rust
// mod core::ptr

pub const fn from_ref<T: ?Sized>(r: &T) -> *const T;
pub const fn from_mut<T: ?Sized>(r: &mut T) -> *mut T;
```

Tracking issue: https://github.com/rust-lang/rust/issues/106116

---

``@RalfJung`` what do you think we should do with `from_mut`? Stabilize it as const, given that you can't call it anyway (no way to get `&mut` in `const fn`)? Defer stabilizing it as const leaving the same issue/feature? Change issue/feature? Change issue/feature to the "`&mut` in const fn" one?
2023-12-15 20:19:53 +01:00
jyn 4845665f6a use if cfg instead of #[cfg]
this pr is specifically for waffle because i love it <3
2023-12-15 13:15:40 -05:00
Michael Goulet 0184c7616e Move nll_relate to relate::nll submodule 2023-12-15 18:13:40 +00:00
Michael Goulet 807cd85dfa Add higher_ranked to relate submodule 2023-12-15 18:13:40 +00:00
Michael Goulet 18bf0caa5a Notify lcnr and errs when relations change 2023-12-15 18:13:40 +00:00
Michael Goulet 5b0b7cd8f9 Move type relations into submodule in rustc_infer 2023-12-15 18:13:40 +00:00
bors 3f39cae119 Auto merge of #115165 - davidtwco:issue-9228-describe-item-member-visibility, r=wesleywiser
codegen_llvm: set `DW_AT_accessibility`

Fixes #9228.
Based on #74778.

Sets the accessibility of types and fields in DWARF using `DW_AT_accessibility` attribute.

`DW_AT_accessibility` (public/protected/private) isn't exactly right for Rust,  but neither is `DW_AT_visibility` (local/exported/qualified), and there's no way to set `DW_AT_visbility` in LLVM's API. Debuggers will special-case the handling of these per-language anyway.

r? `@wesleywiser` (visited in wg-debugging triage)
2023-12-15 17:13:04 +00:00
Maybe Waffle b863e9ba57 Stabilize ptr::{from_ref, from_mut} 2023-12-15 08:34:59 -08:00
Nadrieril 3016c29628 s/MatchCx/TypeCx/ 2023-12-15 17:26:19 +01:00
Michael Goulet bc1ca6b528 Fix enforcement of generics for associated items 2023-12-15 16:17:28 +00:00
Cameron Steffen 04fafd69de Cfg remove lang items in doctest 2023-12-15 16:17:28 +00:00
Michael Goulet 553c3c44b2 Appease the tools: clippy, rustdoc 2023-12-15 16:17:27 +00:00
Michael Goulet 653ca5ad3b Simplify instantiate_poly_trait_ref 2023-12-15 16:17:27 +00:00
Michael Goulet fc010de26b banish hir::GenericBound::LangItemTrait 2023-12-15 16:17:27 +00:00
Michael Goulet ad00641b74 Collect lang items from AST 2023-12-15 16:12:27 +00:00
Michael Goulet 252d99a54b Fix comments 2023-12-15 16:08:26 +00:00
Michael Goulet 7f565ed282 Don't pass lint back out of lint decorator 2023-12-15 16:05:36 +00:00
Nadrieril 4bcf66f875 Introduce MatchCtxt 2023-12-15 16:58:38 +01:00
Nadrieril 60ea14bfaa s/PatCtxt/PlaceCtxt/ 2023-12-15 16:58:38 +01:00
Nadrieril 1e89a38423 pattern_analysis doesn't need to know what spans are 2023-12-15 16:58:38 +01:00
Nadrieril 8c5e89907c Address review comments 2023-12-15 16:58:38 +01:00
Nadrieril e10b165775 s/RustcCtxt/RustcMatchCheckCtxt/ 2023-12-15 16:58:38 +01:00
Nadrieril 63c5b008e1 Make the crate compile on stable 2023-12-15 16:58:38 +01:00
Nadrieril f30c5956f5 Make rustc_index::bit_set available on stable 2023-12-15 16:58:38 +01:00
Nadrieril e646c9f723 Make the rustc_data_structures dependency optional 2023-12-15 16:58:38 +01:00
Nadrieril 16bd6ac3ed Gate rustc-specific code under a feature 2023-12-15 16:58:37 +01:00
Nadrieril 42f4393824 Iron out last rustc-specific details 2023-12-15 16:58:37 +01:00
Nadrieril cb622f3994 Name rustc-specific things "rustc" 2023-12-15 16:58:37 +01:00
Nadrieril 3d7c4df326 Abstract MatchCheckCtxt into a trait 2023-12-15 16:58:36 +01:00
Nadrieril 3ad76f9325 Disentangle the arena from MatchCheckCtxt 2023-12-15 16:57:36 +01:00
Nadrieril 081c3dcf43 Remove all matching on ty.kind() outside cx 2023-12-15 16:57:36 +01:00
Nadrieril b111b2e839 Split Single ctor into more specific variants 2023-12-15 16:57:36 +01:00
Michael Howell 6bbbff5189 rustdoc: add regression test for JS data file loading
Follow up for #118961
2023-12-15 08:56:49 -07:00
Guillaume Gomez 028a3135c8 Simplify JS code a little bit 2023-12-15 16:56:11 +01:00
bors 21b06c1beb Auto merge of #16131 - HKalbasi:rustc-tests-fixup, r=HKalbasi
Fix false positive type mismatch in const reference patterns
2023-12-15 15:42:00 +00:00
hkalbasi fa5a327786 Use depth 1 in git clone 2023-12-15 19:09:42 +03:30
hkalbasi 4f722165b6 Fix false positive type mismatch in const reference patterns 2023-12-15 19:09:07 +03:30
Yuki Okushi c3dd266f47 Remove @JohnTitor from diagnostics pings
I've been inactive around diagnostics for a while so would like to remove myself from the diagnostics-related ping groups for now.
2023-12-16 00:15:15 +09:00
bors fcb89b394a Auto merge of #3226 - saethlin:deadpool-test, r=RalfJung
Add a regression test for rust#115145

Per https://github.com/rust-lang/rust/pull/118805#issuecomment-1855264860
2023-12-15 15:05:41 +00:00
Ben Kimock afcf01c238 Add the test minimized from deadpool 2023-12-15 10:04:07 -05:00
bors e6707df0de Auto merge of #118982 - matthiaskrgr:rollup-xoraxf4, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - #118962 (Annotate some bugs)
 - #118969 (coverage: Use `Waker::noop` in async tests)
 - #118974 (Annotate panic! reasons during enum layout)

Failed merges:

 - #111658 (Refactor pre-getopts command line argument handling)
 - #117449 (Avoid silencing relevant follow-up errors)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-15 15:01:55 +00:00