| Age | Commit message (Collapse) | Author | Lines |
|
Rustup
also move some fail tests into suitable subdirectories
|
|
|
|
|
|
|
|
|
|
This is intended to be used for Linux kernel RETHUNK builds.
With this commit (optionally backported to Rust 1.73.0), plus a
patched Linux kernel to pass the flag, I get a RETHUNK build with
Rust enabled that is `objtool`-warning-free and is able to boot in
QEMU and load a sample Rust kernel module.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
|
|
miri: add test checking that aggregate assignments reset memory to uninit
Also, `write_aggregate` is really just a helper for evaluating `Aggregate` rvalues, so it should be in `step.rs`, not `place.rs`. Also factor out `Repeat` rvalues into their own function while we are at it.
r? `@saethlin`
Fixes https://github.com/rust-lang/miri/issues/3195
|
|
Fix `PartialEq` args when `#[const_trait]` is enabled
This is based off of your PR that enforces effects on all methods, so just see the last commits.
r? fee1-dead
|
|
Tweak parsing recovery of enums, for exprs and match arm patterns
Tweak recovery of `for (pat in expr) {}` for more accurate spans.
When encountering `match` arm `(pat if expr) => {}`, recover and suggest removing parentheses. Fix #100825.
When encountering malformed enums, try more localized per-variant parse recovery.
Move parser recovery tests to subdirectory.
|
|
Pass +forced-atomics feature for riscv32{i,im,imc}-unknown-none-elf
As said in https://github.com/rust-lang/rust/pull/98333#issuecomment-1666375293, `forced-atomics` target feature is also needed to enable atomic load/store on these targets (otherwise, libcalls are generated): https://godbolt.org/z/433qeG7vd
~~This PR is currently marked as a draft because:~~
- ~~`forced-atomics` target feature is currently broken (https://github.com/rust-lang/rust/issues/114153).~~ EDIT: Fixed
- ~~`forced-atomics` target feature has been added in LLVM 16 (https://github.com/llvm/llvm-project/commit/f5ed0cb217a9988f97b55f2ccb053bca7b41cc0c), but the current minimum LLVM version [is 15](https://github.com/rust-lang/rust/blob/90f0b24ad3e7fc0dc0e419c9da30d74629cd5736/src/bootstrap/llvm.rs#L557). In LLVM 15, the atomic load/store of these targets generates libcalls anyway.~~ EDIT: LLVM 15 has been dropped
Depending on the policy on the minimum LLVM version for these targets, this may be blocked until the minimum LLVM version is increased to 16.
r? `@Amanieu`
|
|
new solver: improve instrument annotations
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Use the same approach used for match arm patterns.
|
|
When encountering match arm (pat if expr) => {}, recover and suggest removing parentheses. Fix #100825.
|
|
|
|
|
|
|
|
likely to appear in for head or match arm
|
|
|
|
|
|
r=wesleywiser
utilize stdlib debug assertion status in compiletest
Implemented a new flag `--with-debug-assertions` on compiletest to pass the stdlib debug assertion status from bootstrap.
Resolves #115171
|
|
Use `usize::repeat_u8` instead of implementing `repeat_byte` in `memchr.rs`
It's simpler that way and the tricks don't actually make a difference: https://godbolt.org/z/zrvYY1dGx
|
|
Rollup of 7 pull requests
Successful merges:
- #118157 (Add `never_patterns` feature gate)
- #118191 (Suggest `let` or `==` on typo'd let-chain)
- #118231 (also add is_empty to const raw slices)
- #118333 (Print list of missing target features when calling a function with target features outside an unsafe block)
- #118426 (ConstProp: Correctly remove const if unknown value assigned to it.)
- #118428 (rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.)
- #118438 (Update nto-qnx.md)
Failed merges:
- #118268 (Pretty print `Fn<(..., ...)>` trait refs with parentheses (almost) always)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Update nto-qnx.md
x.py does not support specifying multiple `--target` keywords. The targets must be specified comma separated.
Error:
`error: the argument '--target <TARGET>' cannot be used multiple times`
|
|
rustdoc: Move `AssocItemRender` and `RenderMode` to `html::render`.
They're only used for HTML, so it makes more sense for them to live their.
|
|
ConstProp: Correctly remove const if unknown value assigned to it.
Closes #118328
The problematic sequence of MIR is:
```rust
_1 = const 0_usize;
_1 = const _; // This is an associated constant we can't know before monomorphization.
_0 = _1;
```
1. When `ConstProp::visit_assign` happens on `_1 = const 0_usize;`, it records that `0x0usize` is the value for `_1`.
2. Next `visit_assign` happens on `_1 = const _;`. Because the rvalue `.has_param()`, it can't be const evaled.
3. Finaly, `visit_assign` happens on `_0 = _1;`. Here it would think the value of `_1` was `0x0usize` from step 1.
The solution is to remove consts when checking the RValue fails, as they may have contained values that should now be invalidated, as that local was overwritten.
This should probably be back-ported to beta. Stable is more iffy, as it's gone unidentified since 1.70, so I only think it's worthwhile if there's another reason for a 1.74.1 release anyway.
|
|
Print list of missing target features when calling a function with target features outside an unsafe block
Fixes https://github.com/rust-lang/rust/issues/108680
Supersedes https://github.com/rust-lang/rust/pull/109710. I used the same wording for the messages, but the implementation is different.
r? `@est31`
|
|
also add is_empty to const raw slices
We have this on mutable raw slices but not const raw slices, which makes little sense.
Cc https://github.com/rust-lang/rust/issues/71146
|
|
Suggest `let` or `==` on typo'd let-chain
When encountering a bare assignment in a let-chain, suggest turning the
assignment into a `let` expression or an equality check.
```
error: expected expression, found `let` statement
--> $DIR/bad-if-let-suggestion.rs:5:8
|
LL | if let x = 1 && i = 2 {}
| ^^^^^^^^^
|
= note: only supported directly in conditions of `if` and `while` expressions
help: you might have meant to continue the let-chain
|
LL | if let x = 1 && let i = 2 {}
| +++
help: you might have meant to compare for equality
|
LL | if let x = 1 && i == 2 {}
| +
```
|
|
Add `never_patterns` feature gate
This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment.
`@scottmcm` has agreed to be my lang-team liaison for this experiment.
|
|
x.py does not support specify multiple --target keywords. The targets must be specified comma separated.
|
|
Rollup of 7 pull requests
Successful merges:
- #116839 (Implement thread parking for xous)
- #118265 (remove the memcpy-on-equal-ptrs assumption)
- #118269 (Unify `TraitRefs` and `PolyTraitRefs` in `ValuePairs`)
- #118394 (Remove HIR opkinds)
- #118398 (Add proper cfgs in std)
- #118419 (Eagerly return `ExprKind::Err` on `yield`/`await` in wrong coroutine context)
- #118422 (Fix coroutine validation for mixed panic strategy)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
explain tests that disable the provenance GC
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #118342 (Dont suggest `!` for path in function call if it has generic args)
- #118383 (Address unused tuple struct fields in the standard library)
- #118401 (`rustc_ast_lowering` cleanups)
- #118409 (format_foreign.rs: unwrap return Option value for `fn position`, as it always returns Some)
- #118413 (Fix the issue of suggesting unwrap/expect for shorthand field)
- #118425 (Update cargo)
- #118429 (Fix a typo in a `format_args!` note)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix a typo in a `format_args!` note
|
|
Update cargo
7 commits in 9b13310ca596020a737aaa47daa4ed9ff8898a2f..26333c732095d207aa05932ce863d850fb309386
2023-11-24 16:20:51 +0000 to 2023-11-28 20:07:39 +0000
- docs: link to the packages lint table from the related workspace table (rust-lang/cargo#13057)
- Add more doc comments for gc changes. (rust-lang/cargo#13055)
- docs: Provide pointers for MSRV (rust-lang/cargo#13056)
- Fixed typo in SemVer Compatibility documentation page (rust-lang/cargo#13054)
- refactor: use custom error instead of anyhow (rust-lang/cargo#13050)
- review and remove ignored tests in rustfix (rust-lang/cargo#13047)
- docs: add doc comments for rustfix (rust-lang/cargo#13048)
r? ghost
|
|
r=compiler-errors
Fix the issue of suggesting unwrap/expect for shorthand field
Fixes #118145
|
|
format_foreign.rs: unwrap return Option value for `fn position`, as it always returns Some
Trivial cleanup.
It will be nice to have way to run exhaustiveness analysis on similar cases to see dead code.
|
|
`rustc_ast_lowering` cleanups
Just some cleanups I found while looking through this code.
r? `@spastorino`
|
|
shepmaster:unused-tuple-struct-field-cleanup-stdlib, r=m-ou-se
Address unused tuple struct fields in the standard library
|
|
Dont suggest `!` for path in function call if it has generic args
Fixes #118335
|
|
Fix coroutine validation for mixed panic strategy
Validation introduced in #113124 allows `UnwindAction::Continue` and `TerminatorKind::Resume` to occur only in functions with ABI that can unwind. The function ABI depends on the panic strategy, which can vary across crates.
Usually MIR is built and validated in the same crate. The coroutine drop glue thus far was an exception. As a result validation could fail when mixing different panic strategies.
Avoid the problem by executing `AbortUnwindingCalls` along with the validation.
Fixes #116953.
|