| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #132651 (Remove attributes from generics in built-in derive macros)
- #132668 (Feature gate yield expressions not in 2024)
- #132771 (test(configure): cover `parse_args` in `src/bootstrap/configure.py`)
- #132895 (Generalize `NonNull::from_raw_parts` per ACP362)
- #132914 (Update grammar in std::cell docs.)
- #132927 (Consolidate type system const evaluation under `traits::evaluate_const`)
- #132935 (Make sure to ignore elided lifetimes when pointing at args for fulfillment errors)
- #132941 (Subtree update of `rust-analyzer`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Update grammar in std::cell docs.
Using "having" in both the leading sentence and the bullets is unnecessary.
It makes it read as "it is only possible to have having several immutable...".
|
|
r=ibraheemdev
Generalize `NonNull::from_raw_parts` per ACP362
I did the raw pointers in #125701, but apparently forgot `NonNull`.
cc https://github.com/rust-lang/libs-team/issues/362
|
|
|
|
Check for null in the `alloc_zeroed` example
We should demonstrate good behavior, just like #99198 did for `alloc`.
|
|
lolbinarycat:library-fix-too_long_first_doc_paragraph, r=tgross35
split up the first paragraph of doc comments for better summaries
used `./x clippy -Aclippy::all '-Wclippy::too_long_first_doc_paragraph' library/core library/alloc` to find these issues.
|
|
elem_offset / subslice_range: use addr() instead of 'as usize'
There's no reason to use ptr-to-int casts with their subtle semantics here.
|
|
Rollup of 7 pull requests
Successful merges:
- #120077 (Add Set entry API )
- #132144 (Arbitrary self types v2: (unused) Receiver trait)
- #132297 (Document some `check_expr` methods, and other misc `hir_typeck` tweaks)
- #132820 (Add a default implementation for CodegenBackend::link)
- #132881 (triagebot: Autolabel rustdoc book)
- #132912 (Simplify some places that deal with generic parameter defaults)
- #132916 (Unvacation fmease)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
We should demonstrate good behavior, just like #99198 did for `alloc`.
|
|
|
|
|
|
Arbitrary self types v2: (unused) Receiver trait
This commit contains a new `Receiver` trait, which is the basis for the Arbitrary Self Types v2 RFC. This allows smart pointers to be method receivers even if they're not Deref.
This is currently unused by the compiler - a subsequent PR will start to use this for method resolution if the `arbitrary_self_types` feature gate is enabled. This is being landed first simply to make review simpler: if people feel this should all be in an atomic PR let me know.
This is a part of the arbitrary self types v2 project, https://github.com/rust-lang/rfcs/pull/3519
https://github.com/rust-lang/rust/issues/44874
r? `@wesleywiser`
|
|
Add Set entry API
See https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/HashSet.3A.3Aentry/near/413224639 and https://github.com/rust-lang/rust/issues/60896#issuecomment-678708111
Closes https://github.com/rust-lang/rfcs/issues/1490
|
|
|
|
|
|
Rollup of 4 pull requests
Successful merges:
- #129627 (Ensure that tail expr receive lifetime extension)
- #130999 (Implement file_lock feature)
- #132873 (handle separate prefixes in clippy rules)
- #132891 (Remove `rustc_session::config::rustc_short_optgroups`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Using "having" in both the leading sentence and the bullets is unnecessary.
It makes it read as "it is only possible to have having several immutable...".
|
|
When linking an executable without dynamic linking, this is a pure improvement.
It significantly reduces code size and avoids a lot of buggy behaviors. It is
supported in all browsers for many years and in all maintained versions of
Node.
It does change the ABI, so people who are dynamically linking with a library
or executable that uses the old ABI may need to turn it off. It can be disabled
if needed by passing `-Clink-arg -sWASM_BIGINT=0` to `rustc`. But few people
will want to turn it off.
|
|
Implement file_lock feature
This adds lock(), lock_shared(), try_lock(), try_lock_shared(), and unlock() to File gated behind the file_lock feature flag
This is the initial implementation of https://github.com/rust-lang/rust/issues/130994 for Unix and Windows platforms. I will follow it up with an implementation for WASI preview 2
|
|
rustdoc-search: simplify rules for generics and type params
**Heads up!**: This PR is a follow-up that depends on #124544. It adds 12dc24f46007f82b93ed85614347a42d47580afa, a change to the filtering behavior, and 9900ea48b566656fb12b5fcbd0a1b20aaa96e5ca, a minor ranking tweak.
Part of https://github.com/rust-lang/rust-project-goals/issues/112
This PR overturns https://github.com/rust-lang/rust/pull/109802
## Preview
* no results: [`Box<[A]> -> Vec<B>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CB%3E)
* results: [`Box<[A]> -> Vec<A>`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=Box%3C%5BA%5D%3E%20-%3E%20Vec%3CA%3E)
* [`T -> U`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3/std/index.html?search=T%20-%3E%20U)
* [`Cx -> TyCtxt`](http://notriddle.com/rustdoc-html-demo-12/search-sem-3-compiler/rustdoc/index.html?search=Cx%20-%3E%20TyCtxt)

## Description
This commit is a response to feedback on the displayed type signatures results, by making generics act stricter.
- Order within generics is significant. This means `Vec<Allocator>` now matches only with a true vector of allocators, instead of matching the second type param. It also makes unboxing within generics stricter, so `Result<A, B>` only matches if `B` is in the error type and `A` is in the success type. The top level of the function search is unaffected.
- Generics are only "unboxed" if a type is explicitly opted into it. References and tuples are hardcoded to allow unboxing, and Box, Rc, Arc, Option, Result, and Future are opted in with an unstable attribute. Search result unboxing is the process that allows you to search for `i32 -> str` and get back a function with the type signature `&Future<i32> -> Box<str>`.
- Instead of ranking by set overlap, it ranks by the number of items in the type signature. This makes it easier to find single type signatures like transmute.
## Find the discussion on
* <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149>
* <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265>
* <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search>
|
|
I did the raw pointers in 125701, but apparently forgot `NonNull`.
|
|
|
|
This improves the performance of `str::parse` into integers.
Before:
```
compare fastest │ slowest │ median │ mean │ samples │ iters
╰─ std │ │ │ │ │
├─ 328920585 10.23 ns │ 24.8 ns │ 10.34 ns │ 10.48 ns │ 100 │ 25600
├─ 3255 8.551 ns │ 8.59 ns │ 8.551 ns │ 8.56 ns │ 100 │ 25600
╰─ 5 7.847 ns │ 7.887 ns │ 7.847 ns │ 7.853 ns │ 100 │ 25600
```
After:
```
compare fastest │ slowest │ median │ mean │ samples │ iters
╰─ std │ │ │ │ │
├─ 328920585 8.316 ns │ 23.7 ns │ 8.355 ns │ 8.491 ns │ 100 │ 25600
├─ 3255 4.566 ns │ 4.588 ns │ 4.586 ns │ 4.576 ns │ 100 │ 51200
╰─ 5 2.877 ns │ 3.697 ns │ 2.896 ns │ 2.945 ns │ 100 │ 102400
```
Benchmark:
```rust
fn std(input: &str) -> Result<u64, ParseIntError> {
input.parse()
}
```
|
|
|
|
|
|
|
|
|
|
|
|
ABI compatibility: remove section on target features
Once https://github.com/rust-lang/rust/pull/127731 lands, we will properly diagnose ABI issues caused by target feature mismatch (at least on tier 1 targets). So I'd say we can remove the corresponding part of the docs here -- this is now something the compiler can take care of, so programmers don't need to be concerned. For now this is just a lint, but that's just a transition period, like in prior cases where we fix I-unsound bugs by adding a new check that goes through the "future incompatibility" stages. We have decided that it's actually a bug that we have ABI risks around target features, and we shouldn't document that bug as-if it was intended behavior.
Cc `@rust-lang/opsem` `@chorman0773` `@veluca93`
|
|
These functions read from a pointer, so `readonly` has to be used instead of `nomem`.
|
|
|
|
|
|
|
|
Co-authored-by: Mike Pedersen <mike@mikepedersen.dk>
Co-authored-by: Nathan West <Lucretiel@gmail.com>
|
|
update io::Error::into_inner to acknowledge io::Error::other
|
|
|
|
|
|
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
|
|
remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead
This brings us one step closer towards removing support for `extern "rust-intrinsic"` blocks, in favor of `#[rustc_intrinsic]` functions.
Also move `#[rustc_intrinsic]` under the `intrinsics` feature gate, to match the `extern "rust-intrinsic"` style.
|
|
functions instead
|
|
Initialize channel `Block`s directly on the heap
The channel's `Block::new` was causing a stack overflow because it held
32 item slots, instantiated on the stack before moving to `Box::new`.
The 32x multiplier made modestly-large item sizes untenable.
That block is now initialized directly on the heap.
Fixes #102246
try-job: test-various
|
|
|
|
fortanix:raoul/rte-235-fix_fmodl_missing_symbol_issue, r=tgross35
Compile `test_num_f128` conditionally on `reliable_f128_math` config
With #132434 merged, our internal SGX CI started failing with:
```
05:27:34 = note: rust-lld: error: undefined symbol: fmodl
05:27:34 >>> referenced by arith.rs:617 (core/src/ops/arith.rs:617)
05:27:34 >>> /home/jenkins/workspace/rust-sgx-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/std-5d5f11eb008c9091.std.d8141acc61ab7ac8-cgu.10.rcgu.o:(std::num::test_num::h7dd9449f6c01fde8)
05:27:34 >>> did you mean: fmodf
05:27:34 >>> defined in: /home/jenkins/workspace/rust-sgx-ci/rust/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-fortanix-unknown-sgx/release/deps/libcompiler_builtins-0376f439a2ebf305.rlib(compiler_builtins-0376f439a2ebf305.compiler_builtins.c22db39d25d6f802-cgu.148.rcgu.o)
```
This originated from the `test_num_f128` test not having the required conditional compilation. This PR fixes that issue.
cc: ````@jethrogb,```` ````@workingjubilee````
|
|
core: move intrinsics.rs into intrinsics folder
This makes the rustbot notification we have set up for this folder in `triagebot.toml` actually work. Also IMO it makes more sense to have it all in one folder.
|
|
|