about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-10-29Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`Eduardo Sánchez Muñoz-0/+211
2024-10-29Auto merge of #132317 - workingjubilee:rollup-x21ncea, r=workingjubileebors-1414/+1490
Rollup of 12 pull requests Successful merges: - #131375 (compiler: apply clippy::clone_on_ref_ptr for CI) - #131520 (Mark `str::is_char_boundary` and `str::split_at*` unstably `const`.) - #132119 (Hack out effects support for old solver) - #132194 (Collect item bounds for RPITITs from trait where clauses just like associated types) - #132216 (correct LLVMRustCreateThinLTOData arg types) - #132233 (Split `boxed.rs` into a few modules) - #132266 (riscv-soft-abi-with-float-features.rs: adapt for LLVM 20) - #132270 (clarified doc for `std::fs::OpenOptions.truncate()`) - #132284 (Remove my ping for rustdoc/clean/types.rs) - #132293 (Remove myself from mentions inside `tests/ui/check-cfg` directory) - #132312 (Delete `tests/crashes/23707.rs` because it's flaky) - #132313 (compiletest: Rename `command-list.rs` to `directive-list.rs`) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-29Rollup merge of #132313 - Zalathar:directive-list, r=jieyouxuJubilee-4/+4
compiletest: Rename `command-list.rs` to `directive-list.rs` Because I forget the name of this file literally every single time I need to find and edit it. r? jieyouxu
2024-10-29Rollup merge of #132312 - jieyouxu:delete-crashes-23707, r=matthiaskrgrJubilee-109/+0
Delete `tests/crashes/23707.rs` because it's flaky It's conditioned on `only-x86_64` because it doesn't reliably fail on other platforms, it's optimization dependent and failed to ICE post-PGO in <https://github.com/rust-lang/rust/pull/132300#issuecomment-2443279042>. Remove this test for now without prejudice against relanding the test in a more reliable form. I removed the `S-bug-has-test` label from #23707. r? compiler
2024-10-29Rollup merge of #132293 - Urgau:tests-check-cfg-out-triagebot, r=lqdJubilee-3/+0
Remove myself from mentions inside `tests/ui/check-cfg` directory This PR removes myself from mentions inside `tests/ui/check-cfg` directory. I'm not sure this particular mention has ever been useful to me, and lately it's been too annoying for me to ignore it. So remove my-self from it.
2024-10-29Rollup merge of #132284 - camelid:rm-ping, r=workingjubileeJubilee-3/+0
Remove my ping for rustdoc/clean/types.rs It was useful at one time, but now it just causes notification noise.
2024-10-29Rollup merge of #132270 - yakiimoninja:fs-truncate-docs, r=NoratriebJubilee-1/+1
clarified doc for `std::fs::OpenOptions.truncate()` Clarified what method does when `std::fs::OpenOptions.truncate()` parameter is set to `true`.
2024-10-29Rollup merge of #132266 - krasimirgg:llvm-20-testfix, ↵Jubilee-3/+8
r=hanna-kruppe,beetrees,workingjubilee riscv-soft-abi-with-float-features.rs: adapt for LLVM 20 Adapts a test for LLVM 20. No functional changes intended.
2024-10-29Rollup merge of #132233 - WaffleLapkin:box-module-split, r=workingjubileeJubilee-971/+1004
Split `boxed.rs` into a few modules I wanted to add an impl for `Box<_>`, but was quickly discouraged by the 3K file. This splits off a couple bits, making it at least a bit more manageable. r? ````@workingjubilee```` (I think you are not bothered by refactorings like this?)
2024-10-29Rollup merge of #132216 - klensy:c_uint, r=cuviperJubilee-9/+9
correct LLVMRustCreateThinLTOData arg types `LLVMRustCreateThinLTOData` defined in rust as ```rust pub fn LLVMRustCreateThinLTOData( Modules: *const ThinLTOModule, NumModules: c_uint, PreservedSymbols: *const *const c_char, PreservedSymbolsLen: c_uint, ) -> Option<&'static mut ThinLTOData>; ``` but in cpp as ```cpp extern "C" LLVMRustThinLTOData * LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, int num_modules, const char **preserved_symbols, int num_symbols) { ``` (note `c_unit` vs `int` types). Let it be actually `size_t`. Also fixes return type of `LLVMRustDIBuilderCreateOpLLVMFragment` to uint64_t as other similar functions around, which should be correct, i assume.
2024-10-29Rollup merge of #132194 - compiler-errors:rpitit-super-wc, r=spastorinoJubilee-14/+23
Collect item bounds for RPITITs from trait where clauses just like associated types We collect item bounds from trait where clauses for *associated types*, i.e. this: ```rust trait Foo where Self::Assoc: Send { type Assoc; } ``` Becomes this: ```rust trait Foo { type Assoc: Send; } ``` Today, with RPITITs/AFIT and return-type notation, we don't do that, i.e.: ```rust trait Foo where Self::method(..): Send { fn method() -> impl Sized; } fn is_send(_: impl Send) {} fn test<T: Foo>() { is_send(T::method()); } ``` ...which fails on nightly today. Turns out it's super easy to fix this, and we just need to use the `associated_type_bounds` lowering function in `explicit_item_bounds_with_filter`, which has that logic baked in.
2024-10-29Rollup merge of #132119 - compiler-errors:effects-old-solver, r=lcnrJubilee-192/+302
Hack out effects support for old solver Opening this for vibes ✨ Turns out that a basic, somewhat incomplete implementation of host effects is achievable in the old trait solver pretty easily. This should be sufficient for us to use in the standard library itself. Regarding incompleteness, maybe we should always treat host predicates as ambiguous in intercrate mode (at least in the old solver) to avoid any worries about accidental impl overlap or something. r? ```@lcnr``` cc ```@fee1-dead```
2024-10-29Rollup merge of #131520 - zachs18:const-str-split, r=NoratriebJubilee-12/+38
Mark `str::is_char_boundary` and `str::split_at*` unstably `const`. Tracking issues: #131516, #131518 First commit implements `const_is_char_boundary`, second commit implements `const_str_split_at` (which depends on `const_is_char_boundary`) ~~I used `const_eval_select` for `is_char_boundary` since there is a comment about optimizations that would theoretically not happen with the simple `const`-compatible version (since `slice::get` is not `const`ifiable) cc #84751. I have not checked if this code difference is still required for the optimization, so it might not be worth the code complication, but 🤷.~~ This changes `str::split_at_checked` to use a new private helper function `split_at_unchecked` (copied from `split_at_mut_unchecked`) that does pointer stuff instead of `get_unchecked`, since that is not currently `const`ifiable due to using the `SliceIndex` trait.
2024-10-29Rollup merge of #131375 - klensy:clone_on_ref_ptr, r=cjgillotJubilee-93/+101
compiler: apply clippy::clone_on_ref_ptr for CI Apply lint https://rust-lang.github.io/rust-clippy/master/index.html#/clone_on_ref_ptr for compiler, also see https://github.com/rust-lang/rust/pull/131225#discussion_r1790109443. Some Arc's can be misplaced with Lrc's, sorry. https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/enable.20more.20clippy.20lints.20for.20compiler.20.28and.5Cor.20std.29
2024-10-29Auto merge of #132314 - lnicola:sync-from-ra, r=lnicolabors-3366/+7243
Subtree update of `rust-analyzer` r? `@ghost`
2024-10-29Auto merge of #132277 - workingjubilee:rollup-5e6q6e4, r=workingjubileebors-339/+748
Rollup of 9 pull requests Successful merges: - #130259 (Lower AST node id only once) - #131441 (Add a new trait `proc_macro::ToTokens`) - #132247 (stable_mir: Directly use types from rustc_abi) - #132249 (compiler: Add rustc_abi dependence to the compiler) - #132255 (Add `LayoutData::is_uninhabited` and use it) - #132258 ([rustdoc] Unify variant struct fields margins with struct fields) - #132260 (cg_llvm: Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char`) - #132261 (refactor: cleaner check to return None) - #132271 (Updating Fuchsia platform-support documentation) r? `@ghost` `@rustbot` modify labels: rollup
2024-10-29Merge pull request #18431 from lnicola/sync-from-rustLaurențiu Nicola-10320/+14591
minor: Sync from downstream
2024-10-29Bump rustc cratesLaurențiu Nicola-17/+17
2024-10-29Rename `command-list.rs` to `directive-list.rs`Zalathar-4/+4
2024-10-29Delete `tests/crashes/23707.rs` because it's flaky许杰友 Jieyou Xu (Joe)-109/+0
It's conditioned on `only-x86_64` because it doesn't reliably fail on other platforms, it's optimization dependent and failed to ICE post-PGO in <https://github.com/rust-lang/rust/pull/132300#issuecomment-2443279042>. Remove this test for now without prejudice against relanding the test in a more reliable form.
2024-10-29Merge from rust-lang/rustLaurențiu Nicola-10302/+14573
2024-10-29Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2024-10-29Auto merge of #128985 - GrigorenkoPV:instantly-dangling-pointer, r=Urgaubors-128/+1093
Lint against getting pointers from immediately dropped temporaries Fixes #123613 ## Changes: 1. New lint: `dangling_pointers_from_temporaries`. Is a generalization of `temporary_cstring_as_ptr` for more types and more ways to get a temporary. 2. `temporary_cstring_as_ptr` is removed and marked as renamed to `dangling_pointers_from_temporaries`. 3. `clippy::temporary_cstring_as_ptr` is marked as renamed to `dangling_pointers_from_temporaries`. 4. Fixed a false positive[^fp] for when the pointer is not actually dangling because of lifetime extension for function/method call arguments. 5. `core::cell::Cell` is now `rustc_diagnostic_item = "Cell"` ## Questions: - [ ] Instead of manually checking for a list of known methods and diagnostic items, maybe add some sort of annotation to those methods in library and check for the presence of that annotation? https://github.com/rust-lang/rust/pull/128985#issuecomment-2318714312 ## Known limitations: ### False negatives[^fn]: See the comments in `compiler/rustc_lint/src/dangling.rs` 1. Method calls that are not checked for: - `temporary_unsafe_cell.get()` - `temporary_sync_unsafe_cell.get()` 2. Ways to get a temporary that are not recognized: - `owning_temporary.field` - `owning_temporary[index]` 3. No checks for ref-to-ptr conversions: - `&raw [mut] temporary` - `&temporary as *(const|mut) _` - `ptr::from_ref(&temporary)` and friends [^fn]: lint **should** be emitted, but **is not** [^fp]: lint **should not** be emitted, but **is**
2024-10-29correct LLVMRustDIBuilderCreateOpLLVMFragment return typeklensy-1/+1
2024-10-29correct LLVMRustCreateThinLTOData arg typesklensy-8/+8
2024-10-28Hack out effects support for old solverMichael Goulet-192/+302
2024-10-28Remove myself from mentions inside `tests/ui/check-cfg` directoryUrgau-3/+0
2024-10-28Bless a miri testMaybe Lapkin-1/+1
After moving some `Box` internals to a different module, the path in the diagnostic changed.
2024-10-28Split `boxed.rs` into a few modulesMaybe Lapkin-970/+1003
+ some minor style changes
2024-10-28Remove my ping for rustdoc/clean/types.rsNoah Lev-3/+0
It was useful at one time, but now it just causes notification noise.
2024-10-28Rollup merge of #132271 - claywilkinson:master, r=tmandryJubilee-9/+2
Updating Fuchsia platform-support documentation Updated for changes in the package server workflow. r? ``@tmandry`` ``@erickt``
2024-10-28Rollup merge of #132261 - ChrisCho-H:refactor/cleaner-check-none, ↵Jubilee-4/+1
r=compiler-errors refactor: cleaner check to return None It's very nit change. Refactor to shorten verbose check when returning None for `backend_feature_name`.
2024-10-28Rollup merge of #132260 - Zalathar:type-safe-cast, r=compiler-errorsJubilee-87/+110
cg_llvm: Use a type-safe helper to cast `&str` and `&[u8]` to `*const c_char` In `rustc_codegen_llvm` there are many uses of `.as_ptr().cast()` to convert a string or byte-slice to `*const c_char`, which then gets passed through FFI. This works, but is fragile, because there's nothing constraining the pointer cast to actually be from `u8` to `c_char`. If the original value changes to something else that has an `as_ptr` method, or the context changes to expect something other than `c_char`, the cast will silently do the wrong thing. By making the cast more explicit via a helper method, we can be sure that it will either perform the intended cast, or fail at compile time.
2024-10-28Rollup merge of #132258 - GuillaumeGomez:variant-structfields-margins, ↵Jubilee-7/+8
r=notriddle [rustdoc] Unify variant struct fields margins with struct fields As discussed in https://github.com/rust-lang/rust/pull/132220. | before | after | |-|-| | ![image](https://github.com/user-attachments/assets/d8d8336d-7fe4-45fb-a5a5-36a4023223f5) | ![Screenshot from 2024-10-28 11-17-24](https://github.com/user-attachments/assets/9d0d9633-b857-45b4-9217-7d0d1aa8f770) | r? ```@notriddle```
2024-10-28Rollup merge of #132255 - workingjubilee:layout-is-🏚️, r=compiler-errorsJubilee-41/+44
Add `LayoutS::is_uninhabited` and use it Use accessors for the things that accessors are good at: reducing everyone's need to be nosy and peek at the internals of every data structure.
2024-10-28Rollup merge of #132249 - workingjubilee:add-rustc-abi, r=compiler-errorsJubilee-19/+39
compiler: Add rustc_abi dependence to the compiler Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not *significantly* entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-10-28Rollup merge of #132247 - workingjubilee:add-rustc-abi-to-smir, r=celinvalJubilee-43/+31
stable_mir: Directly use types from rustc_abi In most cases, rustc_target is not necessary, so use rustc_abi instead of its reexports.
2024-10-28Rollup merge of #131441 - SpriteOvO:proc-macro-to-tokens-trait, r=dtolnayJubilee-0/+314
Add a new trait `proc_macro::ToTokens` Tracking issue #130977 This PR adds a new trait `ToTokens`, implemented for types that can be interpolated inside a `quote!` invocation. ```rust impl ToTokens for TokenTree impl ToTokens for TokenStream impl ToTokens for Literal impl ToTokens for Ident impl ToTokens for Punct impl ToTokens for Group impl<T: ToTokens + ?Sized> ToTokens for &T impl<T: ToTokens + ?Sized> ToTokens for &mut T impl<T: ToTokens + ?Sized> ToTokens for Box<T> impl<T: ToTokens + ?Sized> ToTokens for Rc<T> impl<T: ToTokens + ToOwned + ?Sized> ToTokens for Cow<'_, T> impl<T: ToTokens> ToTokens for Option<T> impl ToTokens for u{8,16,32,64,128} impl ToTokens for i{8,16,32,64,128} impl ToTokens for f{32,64} impl ToTokens for {u,i}size impl ToTokens for bool impl ToTokens for char impl ToTokens for str impl ToTokens for String impl ToTokens for CStr impl ToTokens for CString ``` ~This PR also implements the migration mentioned in the tracking issue, replacing `Extend<Token{Tree,Stream}>` with `Extend<T: ToTokens>`, and replacing `FromIterator<Token{Tree,Stream}>` with `FromIterator<T: ToTokens>`.~ **UPDATE**: Reverted. ```diff -impl FromIterator<TokenTree> for TokenStream -impl FromIterator<TokenStream> for TokenStream +impl<T: ToTokens> FromIterator<T> for TokenStream -impl Extend<TokenTree> for TokenStream -impl Extend<TokenStream> for TokenStream +impl<T: ToTokens> Extend<T> for TokenStream ``` I'm going to leave some comments in the review where I'm unsure and concerned. r? ``@dtolnay`` CC ``@tgross35``
2024-10-28Rollup merge of #130259 - adwinwhite:lower-node-id-once, r=cjgillotJubilee-129/+199
Lower AST node id only once Fixes #96346. I basically followed the given instructions except the inline part. `lower_jump_destination` can't reuse local existing `HirId` due to unknown name resolution result so I created an additional mapping for labels. r? ```@cjgillot```
2024-10-28clarified std::fs truncate docyakiimoninja-1/+1
Co-authored-by: nora <48135649+Noratrieb@users.noreply.github.com>
2024-10-28stable_mir: Directly use types from rustc_abiJubilee Young-43/+31
2024-10-28rustdoc: Use accessors to interrogate type layoutsJubilee Young-4/+4
2024-10-28compiler: Add `is_uninhabited` and use LayoutS accessorsJubilee Young-37/+40
This reduces the need of the compiler to peek on the fields of LayoutS.
2024-10-28Updating Fuchsia platform-support documentationClayton Wilkinson-9/+2
Updated for changes in the package server workflow.
2024-10-28Auto merge of #132145 - RalfJung:stdarch, r=Amanieubors-13/+27
bump stdarch This lets us remove a hack from https://github.com/rust-lang/rust/pull/131349. r? `@Amanieu` try-job: test-various
2024-10-28clarified doc for `std::fs::OpenOptions.truncate()`yakiimoninja-1/+1
Clarified what method does when `truncate` parameter is set to `true`.
2024-10-28fix clippy::clone_on_ref_ptr for compilerklensy-92/+99
2024-10-28split clippy task for library and compiler, so different lints can be enabledklensy-1/+2
2024-10-28Merge pull request #18420 from ChayimFriedman2/cfg-true-falseLukas Wirth-6/+87
feat: Support `cfg(true)` and `cfg(false)`
2024-10-28Merge pull request #18421 from Veykril/push-uxxwvwnqvomrLukas Wirth-707/+684
Move text-edit into ide-db