| Age | Commit message (Collapse) | Author | Lines |
|
[stable] 1.61 stable rebuild
* New version of release notes (from as-yet unmerged https://github.com/rust-lang/rust/pull/96539)
* Manual patch to drop clippy's needless_match lint to nursery, per [discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/release.201.2E61.2E0/near/282717457)
r? `@Mark-Simulacrum`
|
|
This lint has a false positive and there's not an easy backport available,
particularly given how late in the cycle we are at this point.
|
|
|
|
[stable] Rust 1.61
* Cherry-picking release notes from not yet landed #96539.
r? `@Mark-Simulacrum`
|
|
|
|
Cherry-picking from not yet landed PR#96539.
|
|
Forbid nested opaque types to reference HRTB from opaque types.
Backport version of https://github.com/rust-lang/rust/pull/97039 if useful.
r? `@Mark-Simulacrum`
|
|
|
|
|
|
[beta] backports
This backports/rolls up:
* Quick fix for #96223. #96679
* [beta] Revert #92519 on beta #96556
* [beta] Clippy backport ICE/infinite loop fix #96740
* Revert "Prefer projection candidates instead of param_env candidates for Sized predicates" #96593
|
|
for Sized predicates
|
|
|
|
|
|
This simplifies the visitor code a bit and prevents checking expressions
multiple times. I still think this lint should be removed for now,
because its code isn't really tested.
|
|
|
|
|
|
This reverts commit ba2d5ede70ed7e37d7f13a397b9d554e2386a19c, reversing
changes made to 9b701e7eaa08c2b2ef8c6e59b8b33436cb10aa45.
|
|
[beta] Beta backports
* Revert diagnostic duplication and accidental stabilization #96516
* Revert "Re-export core::ffi types from std::ffi" #96492
* Make [e]println macros eagerly drop temporaries (for backport) #96490
* Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>" #96489
* Cargo:
* move workspace inheritance unstable docs to the correct place (rust-lang/cargo#10616)
|
|
r=jackh726
Revert diagnostic duplication and accidental stabilization
fixes #96460
this is an accidental stabilization that we should put into the beta. I believe it is low-risk, because it was literally what we had before #94081
The effect on tests is massive, but mostly deduplication of diagnostics and some minor span changes.
|
|
Revert "Re-export core::ffi types from std::ffi"
This reverts commit 9aed829fe6cdf5eaf278c6c3972f7acd0830887d.
Fixes https://github.com/rust-lang/rust/issues/96435 , a regression
in crates doing `use std::ffi::*;` and `use std::os::raw::*;`.
We can re-add this re-export once the `core::ffi` types
are stable, and thus the `std::os::raw` types can become re-exports as
well, which will avoid the conflict. (Type aliases to the same type
still conflict, but re-exports of the same type don't.)
|
|
Make [e]println macros eagerly drop temporaries (for backport)
This PR extracts the subset of #96455 which is only the parts necessary for fixing the 1.61-beta regressions in #96434.
My larger PR #96455 contains a few other changes relative to the pre-#94868 behavior; those are not necessary to backport into 1.61.
argument position | before #94868 | after #94868 | after this PR
--- |:---:|:---:|:---:
`write!($tmp, "…", …)` | :rage: | :rage: | :rage:
`write!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`writeln!($tmp, "…", …)` | :rage: | :rage: | :rage:
`writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage:
`print!("…", $tmp)` | :rage: | :rage: | :rage:
`println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`eprint!("…", $tmp)` | :rage: | :rage: | :rage:
`eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat:
`panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
|
|
Revert "impl From<&[T; N]> and From<&mut [T; N]> for Vec<T>"
This reverts commit 5dd702763ae0e112332a4447171adbed51aeee3d.
|
|
|
|
[beta] backports rollup
* Remove NodeIdHashingMode. #95656
* Check that all hidden types are the same and then deduplicate them. #95731
r? `@Mark-Simulacrum`
|
|
|
|
|
|
|
|
|
|
[beta] Revert: Make TLS __getit #[inline(always)] on non-Windows
Fixes #96132
r? `@Mark-Simulacrum`
|
|
This reverts commit 035a717ee8bf548868fb50b5c7ca562fc4a657a7, reversing
changes made to 761e8884858759b21f3374ad610494e68c087a38.
|
|
[beta] Bump stage0 to 1.60.0
r? `@Mark-Simulacrum`
|
|
|
|
Prepare 1.61.0 beta release
Just a channel and RLS bump this time.
r? `@ghost`
|
|
|
|
|
|
Do not use `ParamEnv::and` when building a cache key from a param-env and trait eval candidate
Do not use `ParamEnv::and` to cache a param-env with a selection/evaluation candidate.
This is because if the param-env is `RevealAll` mode, and the candidate looks global (i.e. it has erased regions, which can show up when we normalize a projection type under a binder<sup>1</sup>), then when we use `ParamEnv::and` to pair the candidate and the param-env for use as a cache key, we will throw away the param-env's caller bounds, and we'll end up caching a candidate that we inferred from the param-env with a empty param-env, which may cause cache-hit later when we have an empty param-env, and possibly mess with normalization like we see in the referenced issue during codegen.
Not sure how to trigger this with a more structured test, but changing `check-pass` to `build-pass` triggers the case that https://github.com/rust-lang/rust/issues/94903 detected.
<sup>1.</sup> That is, we will replace the late-bound region with a placeholder, which gets canonicalized and turned into an infererence variable, which gets erased during region freshening right before we cache the result. Sorry, it's quite a few steps.
Fixes #94903
r? `@Aaron1011` (or reassign as you see fit)
|
|
linker: Implicitly link native libs as whole-archive in some more cases
Partially revert changes from https://github.com/rust-lang/rust/pull/93901 to address regressions like https://github.com/rust-lang/rust/issues/95561.
Fixes https://github.com/rust-lang/rust/issues/95561
r? `@wesleywiser`
|
|
Mark Location::caller() as #[inline]
This function gets compiled to a single register move as it actually gets it's return value passed in as argument.
|
|
Rollup of 5 pull requests
Successful merges:
- #95202 (Reduce the cost of loading all built-ins targets)
- #95553 (Don't emit non-asm contents error for naked function composed of errors)
- #95613 (Fix rustdoc attribute display)
- #95617 (Fix &mut invalidation in ptr::swap doctest)
- #95618 (core: document that the align_of* functions return the alignment in bytes)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
core: document that the align_of* functions return the alignment in bytes
|
|
Fix &mut invalidation in ptr::swap doctest
Under Stacked Borrows with raw pointer tagging, the previous code was UB
because the code which creates the the second pointer borrows the array
through a tag in the borrow stacks below the Unique tag that our first
pointer is based on, thus invalidating the first pointer.
This is not definitely a bug and may never be real UB, but I desperately
want people to write code that conforms to SB with raw pointer tagging
so that I can write good diagnostics. The alternative aliasing models
aren't possible to diagnose well due to state space explosion.
Therefore, it would be super cool if the standard library nudged people
towards writing code that is valid with respect to SB with raw pointer
tagging.
The diagnostics that I want to write are implemented in a branch of Miri and the one for this case is below:
```
error: Undefined Behavior: attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location
--> /home/ben/rust/library/core/src/intrinsics.rs:2103:14
|
2103 | unsafe { copy_nonoverlapping(src, dst, count) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| attempting a read access using <2170> at alloc1068[0x0], but that tag does not exist in the borrow stack for this location
| this error occurs as part of an access at alloc1068[0x0..0x8]
|
= help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental
= help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information
help: <2170> was created due to a retag at offsets [0x0..0x10]
--> ../libcore/src/ptr/mod.rs:640:9
|
8 | let x = array[0..].as_mut_ptr() as *mut [u32; 2]; // this is `array[0..2]`
| ^^^^^^^^^^^^^^^^^^^^^^^
help: <2170> was later invalidated due to a retag at offsets [0x0..0x10]
--> ../libcore/src/ptr/mod.rs:641:9
|
9 | let y = array[2..].as_mut_ptr() as *mut [u32; 2]; // this is `array[2..4]`
| ^^^^^
= note: inside `std::intrinsics::copy_nonoverlapping::<[u32; 2]>` at /home/ben/rust/library/core/src/intrinsics.rs:2103:14
= note: inside `std::ptr::swap::<[u32; 2]>` at /home/ben/rust/library/core/src/ptr/mod.rs:685:9
note: inside `main::_doctest_main____libcore_src_ptr_mod_rs_635_0` at ../libcore/src/ptr/mod.rs:12:5
--> ../libcore/src/ptr/mod.rs:644:5
|
12 | ptr::swap(x, y);
| ^^^^^^^^^^^^^^^
note: inside `main` at ../libcore/src/ptr/mod.rs:15:3
--> ../libcore/src/ptr/mod.rs:647:3
|
15 | } _doctest_main____libcore_src_ptr_mod_rs_635_0() }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
error: aborting due to previous error
```
|
|
Fix rustdoc attribute display
Fixes #81482.
r? `@notriddle`
|
|
Don't emit non-asm contents error for naked function composed of errors
## Motivation
For naked functions an error is emitted when they are composed of anything other than a single asm!() block. However, this error triggers in a couple situations in which it adds no additional information or is actively misleading.
One example is if you do have an asm!() block but simply one with a syntax error:
```rust
#[naked]
unsafe extern "C" fn compiler_errors() {
asm!(invalid_syntax)
}
```
This results in two errors, one for the syntax error itself and another telling you that you need an asm block in your function:
```rust
error[E0787]: naked functions must contain a single asm block
--> src/main.rs:6:1
|
6 | / unsafe extern "C" fn naked_compile_error() {
7 | | asm!(blah)
8 | | }
| |_^
```
This issue also comes up when [utilizing `compile_error!()` for improving your diagnostics](https://twitter.com/steveklabnik/status/1509538243020218372), such as raising a compiler error when compiling for an unsupported target.
## Implementation
The rules this PR implements are as follows:
1. If any non-erroneous non-asm statement is included, an error will still occur
2. If multiple asm statements are included, an error will still occur
3. If 0 or 1 asm statements are present, as well as any non-zero number of erroneous statements, then this error will *not* be raised as it is likely either redundant or incorrect
The rule of thumb is effectively "if an error is present and its correction could change things, don't raise an error".
|
|
Reduce the cost of loading all built-ins targets
This PR started by measuring the exact slowdown of checking of well known conditional values.
Than this PR implemented some technics to reduce the cost of loading all built-ins targets.
cf. https://github.com/rust-lang/rust/issues/82450#issuecomment-1073992323
|
|
Under Stacked Borrows with raw pointer tagging, the previous code was UB
because the code which creates the the second pointer borrows the array
through a tag in the borrow stacks below the Unique tag that our first
pointer is based on, thus invalidating the first pointer.
This is not definitely a bug and may never be real UB, but I desperately
want people to write code that conforms to SB with raw pointer tagging
so that I can write good diagnostics. The alternative aliasing models
aren't possible to diagnose well due to state space explosion.
Therefore, it would be super cool if the standard library nudged people
towards writing code that is valid with respect to SB with raw pointer
tagging.
|
|
|
|
|
|
|
|
|
|
Improve doc example of DerefMut
It is more illustrative, after using `*x` to modify the field, to show
in the assertion that the field has indeed been modified.
|