| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Rollup of 13 pull requests
Successful merges:
- #133411 (the emscripten OS no longer exists on non-wasm targets)
- #133419 (Added a doc test for std::path::strip_prefix)
- #133430 (Tweak parameter mismatch explanation to not say `{unknown}`)
- #133443 (Remove dead code stemming from the old effects desugaring (II))
- #133450 (remove "onur-ozkan" from users_on_vacation)
- #133454 (Update test expectations to accept LLVM 'initializes' attribute)
- #133462 (Use ReadCache for archive reading in bootstrap)
- #133464 (std::thread: avoid leading whitespace in some panic messages)
- #133467 (tests: Add recursive associated type bound regression tests)
- #133470 (Cleanup: delete `//@ pretty-expanded` directive)
- #133473 (tests: Add regression test for recursive enum with Cow and Clone)
- #133481 (Disable `avr-rjmp-offset` on Windows for now)
- #133495 (add test for alias-bound shadowing, rename folder)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
add test for alias-bound shadowing, rename folder
r? `@BoxyUwU` `@compiler-errors`
|
|
Disable `avr-rjmp-offset` on Windows for now
The linker has been randomly crashing on `x86_64-mingw` that's causing spurious failures (#133480). Disable this test on Windows for now.
cc `@jfrimmel` (nothing actionable, just FYI because linker gonna linker)
cc `@ehuss` (who noticed this)
r? compiler (or anyone really)
|
|
tests: Add regression test for recursive enum with Cow and Clone
I could not find any existing test. `git grep "(Cow<'[^>]\+\["` gave no hits before this tests.
Closes #100347
|
|
Cleanup: delete `//@ pretty-expanded` directive
This PR removes the `//@ pretty-expanded` directive support in compiletest and removes its usage inside ui tests because it does not actually do anything, and its existence is itself misleading. This PR is split into two commits:
1. The first commit just drops `pretty-expanded` directive support in compiletest.
2. The second commit is created by `sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs`[^1], reblessing, and slightly adjusting some leading whitespace in a few tests.
We can tell this is fully removed because compiletest doesn't complain about unknown directive when running the `ui` test suite.
cc #23616
### History
Originally, there was some effort to introduce more test coverage for `-Z unpretty=expanded` (in 2015 this was called `--pretty=expanded`). In [Make it an error to not declare used features #23598][pr-23598], there was a flip from `//@ no-pretty-expanded` (opt-out of `-Z
unpretty=expanded` test) to `//@ pretty-expanded` (opt-in to `-Z unpretty=expanded` test). This was needed because back then the dedicated `tests/pretty` ("pretty") test suite did not existed, and the pretty tests were grouped together under `run-pass` tests (I believe the `ui` test suite didn't exist back then either). Unfortunately, in this process the replacement `//@ pretty-expanded` directives contained a `FIXME #23616` linking to [There are very few tests for `-Z unpretty` expansion #23616][issue-23616]. But this was arguably backwards and somewhat misleading, as noted in [#23616](https://github.com/rust-lang/rust/issues/23616#issuecomment-484999901):
The attribute is off by default and things just work if you don't
test it, people have not been adding the `pretty-expanded`
annotation to new tests even if it would work.
Which basically renders this useless.
### Current status
As of Nov 2024, we have a dedicated `pretty` test suite, and some time over the years the split between `run-pass` into `ui` and `pretty` test suites caused all the `//@ pretty-expanded` in `ui` tests to do absolutely nothing: the compiletest logic for `pretty-expanded` only triggers in the *pretty* test suite, but none of the pretty tests use it. Oops.
Nobody remembers this, nobody uses this, it's misleading in ui tests. Let's get rid of this directive altogether.
[pr-23598]: https://github.com/rust-lang/rust/pull/23598
[issue-23616]: https://github.com/rust-lang/rust/issues/23616
### Follow-ups
- [x] Yeet this directive from rustc-dev-guide docs. https://github.com/rust-lang/rustc-dev-guide/pull/2147
[^1]: https://github.com/chmln/sd
r? compiler
|
|
tests: Add recursive associated type bound regression tests
Add regression tests for https://github.com/rust-lang/rust/issues/129541 as requested in https://github.com/rust-lang/rust/issues/129541#issuecomment-2498514488.
Closes #129541
r? ``@lcnr``
|
|
std::thread: avoid leading whitespace in some panic messages
This:
```
panic!(
"use of std::thread::current() is not possible after the thread's
local data has been destroyed"
)
```
will print a newline followed by a bunch of spaces, since the entire string literal is interpreted literally.
I think the intention was to print the message without the newline and the spaces, so let's add some `\` to make that happen.
r? ``@joboet``
|
|
Use ReadCache for archive reading in bootstrap
Address expensive archive reading in bootstrap. This fixes https://github.com/rust-lang/rust/issues/133268
Enable the `std` feature of `object` to use `ReadCache` instead of reading the entire archive file into memory to check for headers. This takes minimal extra time to compile compared to introducing other expensive dependencies to `bootstrap`.
r? jieyouxu
|
|
Update test expectations to accept LLVM 'initializes' attribute
The test was checking for two `ptr` arguments by matching commas (or non-commas), however after
https://github.com/llvm/llvm-project/pull/117104 LLVM adds an `initializes((0, 16))` attribute, which includes a comma.
So instead, we make the test check for two LLVM values, i.e. something prefixed by %.
(See also https://crbug.com/380707238)
|
|
remove "onur-ozkan" from users_on_vacation

|
|
Remove dead code stemming from the old effects desugaring (II)
Follow-up to #132374.
r? project-const-traits
|
|
Tweak parameter mismatch explanation to not say `{unknown}`
* Tweak parameter mismatch explanation not to call parameters with no identifier `{unknown}`
* Say "both" when there are two parameters
* Backtick a type parameter name for consistency
|
|
Added a doc test for std::path::strip_prefix
I was about 90% sure `Path::new("/test/haha/foo.txt").strip_prefix("/te")` would return an Err, but I couldn't find an example to confirm this behaviour.
This should be an easy merge :)
|
|
the emscripten OS no longer exists on non-wasm targets
https://github.com/rust-lang/rust/pull/117338 removed our asmjs targets, which AFAIK means that emscripten only exists on wasm targets. However at least one place in the code still checked "is wasm or is emscripten". Let's fix that.
Cc ```@workingjubilee```
|
|
|
|
Refactor `where` predicates, and reserve for attributes support
Refactor `WherePredicate` to `WherePredicateKind`, and reserve for attributes support in `where` predicates.
This is a part of #115590 and is split from #132388.
r? petrochenkov
|
|
Update cargo and books
10 commits in 66221abdeca2002d318fde6efff516aab091df0e..4c39aaff66862cc0da52fe529aa1990bb8bb9a22
2024-11-19 21:30:02 +0000 to 2024-11-25 16:36:17 +0000
- feat: Stabilize Edition 2024 (rust-lang/cargo#14828)
- Improve error handling when PathSource is relative (rust-lang/cargo#14854)
- test: address test output nondeterminism (rust-lang/cargo#14855)
- chore: move supports-unicode to workspace deps (rust-lang/cargo#14853)
- Check build target supports std when building with -Zbuild-std=std (rust-lang/cargo#14183)
- fix(publish): Allow dry-run of a non-bumped workspace (rust-lang/cargo#14847)
- test: Switch from 'exec_with_output' to 'run' (rust-lang/cargo#14848)
- test(rustflags): Verify -Cmetadata directly, not through -Cextra-filename (rust-lang/cargo#14846)
- chore: remove bors mentions (rust-lang/cargo#14845)
- Clarify how `cargo::metadata` env var is selected (rust-lang/cargo#14842)
## nomicon
1 commits in eac89a3cbe6c4714e5029ae8b5a1c556fd4e8c42..0674321898cd454764ab69702819d39a919afd68
2024-11-16 14:05:28 +0000 to 2024-11-19 12:35:48 +0000
- races: Clarify a “mostly” that might be misread (rust-lang-nursery/nomicon#468)
## reference
12 commits in 41ccb0e6478305401dad92e8fd3d04a4304edb4c..5c86c739ec71b8bc839310ff47fa94e94635bba9
2024-11-15 21:45:16 +0000 to 2024-11-25 17:23:35 +0000
- Document `gen` keyword as reserved in Rust 2024 (rust-lang-nursery/reference#1501)
- 2024: Update `expr` macro fragment specifier (rust-lang-nursery/reference#1639)
- Add rust_2024 prelude (rust-lang-nursery/reference#1552)
- 2024: Add reserved syntax (rust-lang-nursery/reference#1652)
- Add Lifetime Capture Rules 2024 (rust-lang-nursery/reference#1601)
- Add a section dedicated to Edition 2024 changes to temporary scopes (rust-lang-nursery/reference#1592)
- 2024: Add unsafe attribute differences (rust-lang-nursery/reference#1579)
- 2024: Add updates for unsafe extern blocks (rust-lang-nursery/reference#1565)
- Fix rule for lazy boolean temporary drop scope (rust-lang-nursery/reference#1681)
- Raw lifetimes (rust-lang-nursery/reference#1603)
- Fix some missing emdashes (rust-lang-nursery/reference#1676)
- Added an additional example of lifetime elision (rust-lang-nursery/reference#1678)
## rustc-dev-guide
6 commits in b679e71c2d66c6fe13e06b99ac61773b866213f0..787b4166ccc67bd8f72a6e3ef6685ce9ce82909a
2024-11-18 16:18:15 +0800 to 2024-11-22 11:17:57 +0000
- Remove constants section as it is outdated
- Flatten generic parameter defs section
- Add instructions to test error code docs (rust-lang/rustc-dev-guide#2145)
- Reorganize the "Source Code Representation" chapters (rust-lang/rustc-dev-guide#2142)
- Make `Diag` a clickable link in Suggestion section (rust-lang/rustc-dev-guide#2140)
- update for rustc_intrinsic_const_stable_indirect (rust-lang/rustc-dev-guide#2138)
## edition-guide
6 commits in 915f9b319c2823f310430ecdecd86264a7870d7e..f48b0e842a3911c63240e955d042089e9e0894c7
2024-11-06 07:23:07 +0000 to 2024-11-25 16:20:27 +0000
- Update for 2024 stabilization (rust-lang-nursery/edition-guide#338)
- Enable triagebot merge-conflicts and shortcuts (rust-lang-nursery/edition-guide#336)
- Organize the 2024 chapters into sub-chapters by category (rust-lang-nursery/edition-guide#334)
- Fix broken Cargo Book link in cargo-resolver.md (rust-lang-nursery/edition-guide#335)
- Edition 2024 guide for temporary lifetime changes (rust-lang-nursery/edition-guide#318)
- 2024: rustfmt sorting (rust-lang-nursery/edition-guide#332)
|
|
The linker has been randomly crashing on `x86_64-mingw` that's causing
spurious failures. Disable this test on Windows for now.
|
|
|
|
Done with
```bash
sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs
```
and
```
sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs
```
|
|
Foreword
========
Let us begin the journey to rediscover what the `//@ pretty-expanded`
directive does, brave traveller --
"My good friend, [..] when I wrote that passage, God and I knew what
it meant. It is possible that God knows it still; but as for me, I
have totally forgotten."
-- Johann Paul Friedrich Richter, 1826
We must retrace the steps of those before us, for history shall guide us
in the present and inform us of the future.
The Past
========
Originally there was some effort to introduce more test coverage for `-Z
unpretty=expanded` (in 2015 this was called `--pretty=expanded`). In
[Make it an error to not declare used features #23598][pr-23598], there
was a flip from `//@ no-pretty-expanded` (opt-out of `-Z
unpretty=expanded` test) to `//@ pretty-expanded` (opt-in to `-Z
unpretty=expanded` test). This was needed because back then the
dedicated `tests/pretty` ("pretty") test suite did not existed, and the
pretty tests were grouped together under `run-pass` tests (I believe
`ui` test suite didn't exist back then either). Unfortunately, in this
process the replacement `//@ pretty-expanded` directives contained a
`FIXME #23616` linking to [There are very few tests for `-Z unpretty`
expansion #23616][issue-23616]. But this was arguably backwards and
somewhat misleading, as noted in
<https://github.com/rust-lang/rust/issues/23616#issuecomment-484999901>:
The attribute is off by default and things just work if you don't
test it, people have not been adding the `pretty-expanded`
annotation to new tests even if it would work.
Which basically renders this useless.
The Present
===========
As of Nov 2024, we have a dedicated `pretty` test suite, and some time
over the years the split between `run-pass` into `ui` and `pretty` test
suites caused all of the `//@ pretty-expanded` in `ui` tests to do
absolutely nothing -- the compiletest logic for `pretty-expanded` only
triggered in the *pretty* test suite, but none of the pretty tests use
it. Oops.
The Future
==========
Nobody remembers this, nobody uses this, it's misleading in ui tests.
Let's get rid of this directive altogether.
[pr-23598]: https://github.com/rust-lang/rust/pull/23598
[issue-23616]: https://github.com/rust-lang/rust/issues/23616
|
|
|
|
|
|
|
|
|
|
|
|
The test was checking for two `ptr` arguments by matching commas (or
non-commas), however after
https://github.com/llvm/llvm-project/pull/117104 LLVM adds an
`initializes((0, 16))` attribute, which includes a comma.
So instead, we make the test check for two LLVM values, i.e. something
prefixed by %.
(See also https://crbug.com/380707238)
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
|
|
r=workingjubilee
Reduce integer `Display` implementation size
I was thinking about #128204 and how we could reduce the size of the code and just realized that we didn't need the `_fmt` method to be implemented on signed integers, which in turns allow to simplify greatly the macro call.
r? `@workingjubilee`
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #131523 (Fix asm goto with outputs and move it to a separate feature gate)
- #131664 (Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature))
- #132432 (Add a test to verify that libstd doesn't use protected symbols)
- #132502 (Document possibility to set core features in example config.toml)
- #132529 (ci(triagebot): add more top-level files to A-meta)
- #132533 (Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime)
- #132803 (Fix broken url)
- #132982 (alloc: fix `Allocator` method names in `alloc` free function docs)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=Mark-Simulacrum
alloc: fix `Allocator` method names in `alloc` free function docs
It looks like these got renamed in https://github.com/rust-lang/rust/commit/9274b37d99f608e5fde569788ee79bd72fc3cf13 but the docs never updated.
I couldn't find any history for `Allocator::realloc`. The `grow` API is not 1:1 (e.g., it returns a result), so this may not be the correct change - let me know and I can change the method or even remove this entirely.
|
|
Fix broken url
|
|
Add BorrowedBuf::into_filled{,_mut} methods to allow returning buffer with original lifetime
See https://github.com/rust-lang/libs-team/issues/473 and tracking issue https://github.com/rust-lang/rust/issues/117693.
|
|
ismailarilik:ci/triagebot/fix-name-of-trigger-file-LICENSES, r=Mark-Simulacrum
ci(triagebot): add more top-level files to A-meta
It didn't exist so I changed it with its new versions: `COPYRIGHT`, `LICENSE-APACHE` and `LICENSE-MIT`
I also added some other files I found appropriate under the related label.
|
|
Voultapher:document-core-features-in-config-toml-example, r=Mark-Simulacrum
Document possibility to set core features in example config.toml
|
|
Add a test to verify that libstd doesn't use protected symbols
|
|
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature)
This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output.
This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before.
| Architecture | Register class | Target feature | Allowed types |
| ------------ | -------------- | -------------- | -------------- |
| s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
This matches the list of types that are supported by the vector registers in LLVM:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313
In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable.
Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869.
cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x
cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm
`@rustbot` label +O-SystemZ +A-inline-assembly
|
|
Fix asm goto with outputs and move it to a separate feature gate
Tracking issue: #119364
This PR addresses 3 aspects of asm goto with outputs:
* Codegen is fixed. My initial implementation has an oversight which cause the output to be only stored in fallthrough path, but not in label blocks.
* Outputs can now be used with `options(noreturn)` if a label block is given.
* All of this is moved to a new feature gate, because we likely want to stabilise `asm_goto` before asm goto with outputs.
`@rustbot` labels: +A-inline-assembly +F-asm
|
|
Synchronize Unicode license text from unicode.org
The text of <https://unicode.org/license.txt> was swapped out from "UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE" to "UNICODE LICENSE V3" between the dates of [2023.06.03](https://web.archive.org/web/20230603182532/https://www.unicode.org/license.txt) and [2023.09.11](https://web.archive.org/web/20230911222703/https://www.unicode.org/license.txt), which means between Unicode 15.0.0 ([2022.09.13](https://unicode.org/versions/Unicode15.0.0/)) and Unicode 15.1.0 ([2023.09.12](https://unicode.org/versions/Unicode15.1.0/)). A license wording change is not mentioned in the 15.1.0 [release summary](https://www.unicode.org/versions/Unicode15.1.0/) or [announcement post](http://blog.unicode.org/2023/09/announcing-unicode-standard-version-151.html). But I guess we are intended to infer that data files from Unicode 15.1.0 should be specified as licensed [Unicode-3.0](https://spdx.org/licenses/Unicode-3.0.html) as opposed to [Unicode-DFS-2016](https://spdx.org/licenses/Unicode-DFS-2016.html).
The Rust standard library has been using Unicode 15.1.0+ since https://github.com/rust-lang/rust/pull/120777.
|
|
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- #132730 (std: allow after-main use of synchronization primitives)
- #133105 (only store valid proc macro item for doc link)
- #133260 (Constify the `Deref`/`DerefMut` traits, too)
- #133297 (Remove legacy bitcode for iOS)
- #133298 (Mention that std::fs::remove_dir_all fails on files)
- #133384 (add a test for target-feature-ABI warnings in closures and when calling extern fn)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
add a test for target-feature-ABI warnings in closures and when calling extern fn
Also update the comment regarding the inheritance of target features into closures, to make it more clear that we really shouldn't do this right now.
|
|
Mention that std::fs::remove_dir_all fails on files
This is explicitly mentioned for std::fs::remove_file.
It is more likely for a slightly lazy programmer to believe that removing a file would work and that they do not have to distinguish between directories (with contents) and files themself, because of the function's recursive nature and how it distinguishes between files and directories when removing them.
Follow-up for #133183.
|
|
Remove legacy bitcode for iOS
Follow #117364.
|
|
Constify the `Deref`/`DerefMut` traits, too
One more constification. Rebased on that one commit that makes it so we don't need to provide stability on const impls.
r? fee1-dead
|
|
only store valid proc macro item for doc link
Fixes #132743
The definition item can be detected if it is exported in the doc, so store these items rather than skipping.
r? `@petrochenkov`
|