Unify and deduplicate bits conv float tests
cc rust-lang/rust#141726
This is a proposal to unify and deduplicate the bits conv tests for f16, f32, f64 and f128
Update the LoongArch target documentation
This patch defines minimum CPU feature requirements, updates toolchain baseline, and streamlines maintainer list:
- Specify double-precision floating-point and LSX as mandatory CPU features
- Raise the minimum required binutils version to 2.42+, due to relocations introduced by the default medium code model
- Remove outdated maintainers to reduce irrelevant notifications
r? `@jieyouxu`
disable core dumps for panic-uninitialized-zeroed
That test causes a large amount of crashes. If a system has a /proc/sys/kernel/core_pattern that uploads core dumps enabled, it will take a long time to complete. Set dumpable to 0 to avoid that.
Before:
```
$ time ./panic-uninitialized-zeroed
real 0m47.457s
user 0m0.023s
sys 0m0.021s
```
After:
```
$ ./panic-uninitialized-zeroed
real 0m0.029s
user 0m0.019s
sys 0m0.010s
```
core::ptr: deduplicate docs for as_ref, addr, and as_uninit_ref
also add INFO.md file explaining the purpose of the ptr/docs dir, and give some pointers (heh) to future maintainers.
follow up to rust-lang/rust#142101
part of rust-lang/rust#139190
r? `@workingjubilee`
This reverts commit 1eeb8e8b151d1da7daa73837a25dc5f7a1a7fa28, reversing
changes made to 324bf2b9fd8bf9661e7045c8a93f5ff0ec1a8ca5.
Unfortunately the assert desugaring change is not backwards compatible,
see RUST-145770.
Code such as
```rust
#[derive(Debug)]
struct F {
data: bool
}
impl std::ops::Not for F {
type Output = bool;
fn not(self) -> Self::Output { !self.data }
}
fn main() {
let f = F { data: true };
assert!(f);
}
```
would be broken by the assert desugaring change. We may need to land
the change over an edition boundary, or limit the editions that the
desugaring change impacts.
The Rust Embedded Devices Working Group (wg-embedded) Arm Team (t-arm)
agreed to listed as maintainers of:
* aarch64-unknown-none
* aarch64-unknown-none-softfloat
* armv7a-none-eabi
* armv7r-none-eabi
* armv7r-none-eabihf
The aarch64-unknown-none* target didn't have a page so I added it.
wg-embedded t-arm did not want to take over:
* armebv7r-none-eabi
* armebv7r-none-eabihf
So I gave them their own target page. The current maintainer remains.
Improve C-variadic error messages: part 2
tracking issue: https://github.com/rust-lang/rust/issues/44930
a reimplementation of https://github.com/rust-lang/rust/pull/143546 that builds on https://github.com/rust-lang/rust/pull/146165.
This PR
- disallows coroutines (e.g. `async fn`) from having a `...` argument
- disallows associated functions (both in traits and standard impl blocks) from having a `...` argument
- splits up a generic "ill-formed C-variadic function" into specific errors about using an incorrect ABI, not specifying an ABI, or missing the unsafe keyword
C-variadic coroutines probably don't make sense? C-variadic functions are for FFI purposes, combining that with async functions seems weird.
For associated functions, we're just cutting scope. It's probably fine, but it's probably better to explicitly allow it. So for now, at least give a more targeted error message.
Made to be reviewed commit-by-commit.
cc `@workingjubilee`
r? compiler
Strip frontmatter in fewer places
* Stop stripping frontmatter in `proc_macro::Literal::from_str` (RUST-146132)
* Stop stripping frontmatter in expr-ctxt (but not item-ctxt!) `include`s (RUST-145945)
* Stop stripping shebang (!) in `proc_macro::Literal::from_str`
* Not a breaking change because it did compare spans already to ensure there wasn't extra whitespace or comments (`Literal::from_str("#!\n0")` already yields `Err(_)` thankfully!)
* Stop stripping frontmatter+shebang inside some rustdoc code where it doesn't make any observable difference (see self review comments)
* (Stop stripping frontmatter+shebang inside internal test code)
Fixes https://github.com/rust-lang/rust/issues/145945.
Fixes https://github.com/rust-lang/rust/issues/146132.
r? fee1-dead
Make Barrier RefUnwindSafe again
This commit manually implements `RefUnwindSafe` for `std::sync::Barrier` to fixrust-lang/rust#146087. This is a fix for a regression indroduced by e95db591a4
Minor symbol comment fixes.
- The empty symbol is no longer a keyword.
- I don't think any of the special reserved identifiers are used for error recovery.
r? ```@petrochenkov```
Suggest examples of format specifiers in error messages
Format macro now suggests adding `{}` if no formatting specifiers are present. It also gives an example:
```rust
LL | println!("Hello", "World");
| ------- ^^^^^^^ argument never used
| |
| formatting specifier missing
|
= note: format specifiers use curly braces: `{}`
help: consider adding format specifier
|
LL | println!("Hello{}", "World");
| ++
```
When one or more `{}` are present, it doesn't show 'format specifiers use curly braces: `{}`' and example, just small hint on how many you missing:
```rust
LL | println!("list: {}", 1, 2, 3);
| ---------- ^ ^ argument never used
| | |
| | argument never used
| multiple missing formatting specifiers
|
= help: consider adding 2 format specifiers
```
Original issue: rust-lang/rust#68293
Based on discussion in this PR: rust-lang/rust#76443
Let me know if something is missing
default auto traits: use default supertraits instead of `Self: Trait` bounds on associated items
First commit: the motivation has been discussed [here](https://github.com/rust-lang/rust/pull/144679).
Second commit: the only new places where new implicit `DefaultAutoTrait` bounds are generated are supertraits and trait object so `?Trait` syntax should be extended to these places only.
r? `@lcnr`
std: make address resolution weirdness local to SGX
Currently, the implementations of `TcpStream::connect` and its cousins take an `io::Result<&SocketAddr>` as argument, which is very weird, as most of them then `?`-try the result immediately to access the actual address. This weirdness is however necessitated by a peculiarity of the SGX networking implementation:
SGX doesn't support DNS resolution but rather accepts hostnames in the same place as socket addresses. So, to make e.g.
```rust
TcpStream::connect("example.com:80")`
```
work, the DNS lookup returns a special error (`NonIpSockAddr`) instead, which contains the hostname being looked up. When `.to_socket_addrs()` fails, the `each_addr` function used to select an address will pass the error to the inner `TcpStream::connect` implementation, which in SGX's case will inspect the error and try recover the hostname from it. If
that succeeds, it continues with the found hostname.
This is pretty obviously a terrible hack and leads to buggy code (for instance, when users use the result of `.to_socket_addrs()` in their own `ToSocketAddrs` implementation to select from a list of possible URLs, the only URL used will be that of the last item tried). Still, without changes to the SGX usercall ABI, it cannot be avoided.
Therefore, this PR aims to minimise the impact of that weirdness and remove it from all non-SGX platforms. The inner `TcpStream::connect`, et al. functions now receive the `ToSocketAddrs` type directly and call `each_addr` (which is moved to `sys::net::connection`) themselves. On SGX, the implementation uses a special `each_addr` which contains the whole pass-hostname-through-error hack.
As well as making the code cleaner, this also opens up the possibility of reusing newly created sockets even if a connection request fails – but I've left that for another PR.
CC `@raoulstrackx`
Trim paths less in MIR dumping
With this PR, the paths MIR dump filters and that are printed at the start of a dump file are no longer trimmed. They don't include the crate that is being compiled, however.
CI: rfl: move job forward to Linux v6.17-rc5 to remove temporary commits
v6.17-rc5 contains the equivalent of the two commits we had here, thus move the Rust for Linux job forward to that so that we don't need the temporary commits anymore.
r? ```@lqd``` ```@Kobzol```
try-job: x86_64-rust-for-linux
```@rustbot``` label A-rust-for-linux
```@bors``` try