| Age | Commit message (Collapse) | Author | Lines |
|
RunCompiler::new takes non-optional params, and optional
params can be set using set_*field_name* method.
finally `run` will forward all fields to `run_compiler`.
|
|
more case""
This reverts commit b20bce8ce54ea9d47c2e3eb0b17cbb6baf916ae2.
It retains the test added in that commit as a check-pass test, intended to
prevent future (unintentional) regressions.
|
|
[beta] Revert "Promote missing_fragment_specifier to hard error #75516"
This reverts "Promote missing_fragment_specifier to hard error #75516" on just beta. I would like us to explore a more principled fix, perhaps along the lines `@petrochenkov` suggested in #76605, on master when we have more time to test it but I don't want us shipping the breakage in the meantime. I don't personally feel comfortable immediately backporting anything more than a revert here.
cc `@matklad`
This matches #77456 for 1.47 but targets 1.48 (current beta) instead.
r? `@petrochenkov`
|
|
Fix #77218. Fix #77238.
|
|
Fix #77919.
|
|
This optimization can result in unsoundness, because it introduces
additional uses of a place holding the discriminant value without
ensuring that it is valid to do so.
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.
|
|
This reverts commit 84fcd0dc991e2f5b9035d118d8c016f35ab37d0a.
|
|
|
|
|
|
|
|
|
|
Permit ty::Bool in const generics for v0 mangling
This should unbreak using new-symbol-mangling = true in config.toml (once it lands in beta anyway).
Fixes #76365 (well, it will, but seems fine to close as soon as we have support)
r? @eddyb (for mangling) but I'm okay with some other reviewer too :)
|
|
Revert "resolve: Avoid "self-confirming" import resolutions in one more case"
And remove the assert that https://github.com/rust-lang/rust/pull/70236 tried to avoid instead.
Closes https://github.com/rust-lang/rust/issues/74556.
|
|
Bypass const_item_mutation if const's type has Drop impl
Follow-up to #75573. This PR disables the const_item_mutation lint in cases that the const has a Drop impl which observes the mutation.
```rust
struct Log { msg: &'static str }
const LOG: Log = Log { msg: "" };
impl Drop for Log {
fn drop(&mut self) { println!("{}", self.msg); }
}
LOG.msg = "wow"; // prints "wow"
```
r? @Aaron1011
|
|
Move Wrapping<T> ui tests into library
Part of #76268
r? @matklad
|
|
Rollup of 12 pull requests
Successful merges:
- #76101 (Update RELEASES.md for 1.47.0)
- #76739 (resolve: prohibit anon const non-static lifetimes)
- #76811 (Doc alias name restriction)
- #77405 (Add tracking issue of iter_advance_by feature)
- #77409 (Add example for iter chain struct)
- #77415 (Better error message for `async` blocks in a const-context)
- #77423 (Add `-Zprecise-enum-drop-elaboration`)
- #77432 (Use posix_spawn on musl targets)
- #77441 (Fix AVR stack corruption bug)
- #77442 (Clean up on example doc fixes for ptr::copy)
- #77444 (Fix span for incorrect pattern field and add label)
- #77453 (Stop running macOS builds on Azure Pipelines)
Failed merges:
r? `@ghost`
|
|
Fix span for incorrect pattern field and add label
Address #73750.
|
|
Better error message for `async` blocks in a const-context
Improves the error message for the case in #77361.
r? @oli-obk
|
|
r=oli-obk,ollie27
Doc alias name restriction
Fixes #76705.
|
|
davidtwco:issue-75323-non-static-lifetime-in-anonconst, r=varkor
resolve: prohibit anon const non-static lifetimes
Fixes #75323, fixes #74447 and fixes #73375.
This PR prohibits non-static lifetimes in anonymous constants when only the `min_const_generics` feature is enabled. ~~To do so, `to_region_vid`'s `bug!` had to be changed into a delayed bug, which unfortunately required providing it a `TyCtxt`.~~
---
~~While I am happy with how the implementation of the error turned out in `rustc_passes::check_const`, emitting an error wasn't sufficient to avoid hitting the ICE later. I also tried implementing the error in `rustc_mir::transform::check_consts::validation` and that worked, but it didn't silence the ICE either. To silence the ICE, I changed it to a delayed bug which worked but was more invasive that I would have liked, and required I return an incorrect lifetime. It's possible that this check should be implemented earlier in the compiler to make the invasive changes unnecessary, but I wasn't sure where that would be and wanted to get some feedback first.~~
The approach taken by this PR has been changed to implement the error in name resolution, which ended up being much simpler.
cc @rust-lang/wg-const-eval
r? @lcnr
|
|
|
|
|
|
|
|
This commit modifies name resolution to emit an error when non-static
lifetimes are used in anonymous constants when the `min_const_generics`
feature is enabled.
Signed-off-by: David Wood <david@davidtw.co>
|
|
Disable the SimplifyArmIdentity mir-opt
The optimization still has some bugs that need to be worked out
such as #77359.
We can try re-enabling this again after the known issues are resolved.
r? `@oli-obk`
|
|
|
|
The optimization still has some bugs that need to be worked out
such as #77359.
We can try re-enabling this again after the known issues are resolved.
|
|
rustc_metadata: Do not forget to encode inherent impls for foreign types
So I tried to move FFI interface for LLVM from `rustc_codegen_llvm` to `rustc_llvm` and immediately encountered this fascinating issue.
Fixes https://github.com/rust-lang/rust/issues/46665.
|
|
Split sys_common::Mutex in StaticMutex and MovableMutex.
The (unsafe) `Mutex` from `sys_common` had a rather complicated interface. You were supposed to call `init()` manually, unless you could guarantee it was neither moved nor used reentrantly.
Calling `destroy()` was also optional, although it was unclear if 1) resources might be leaked or not, and 2) if `destroy()` should only be called when `init()` was called.
This allowed for a number of interesting (confusing?) different ways to use this `Mutex`, all captured in a single type.
In practice, this type was only ever used in two ways:
1. As a static variable. In this case, neither `init()` nor `destroy()` are called. The variable is never moved, and it is never used reentrantly. It is only ever locked using the `LockGuard`, never with `raw_lock`.
2. As a `Box`ed variable. In this case, both `init()` and `destroy()` are called, it will be moved and possibly used reentrantly.
No other combinations are used anywhere in `std`.
This change simplifies things by splitting this `Mutex` type into two types matching the two use cases: `StaticMutex` and `MovableMutex`.
The interface of both new types is now both safer and simpler. The first one does not call nor expose `init`/`destroy`, and the second one calls those automatically in its `new()` and `Drop` functions. Also, the locking functions of `MovableMutex` are no longer unsafe.
---
This will also make it easier to conditionally box mutexes later, by moving that decision into sys/sys_common. Some of the mutex implementations (at least those of Wasm and 'sys/unsupported') are safe to move, so wouldn't need a box. ~~(But that's blocked on #76932 for now.)~~ (See #77380.)
|
|
|
|
Refactor memchr to allow optimization
Closes #75659
The implementation already uses naive search if the slice if short enough, but the case is complicated enough to not be optimized away. This PR refactors memchr so that it exists early when the slice is short enough.
Codegen-wise, as shown in #75659, memchr was not inlined previously so the only way I could find to test this is to check if there is no memchr call. Let me know if there is a more robust solution here.
|
|
|
|
|
|
Implement multiple return terminator optimization
Closes #72022
|
|
|
|
|
|
|
|
Overhaul const-checking diagnostics
The primary purpose of this PR was to remove `NonConstOp::STOPS_CONST_CHECKING`, which causes any additional errors found by the const-checker to be silenced. I used this flag to preserve diagnostic parity with `qualify_min_const_fn.rs`, which has since been removed.
However, simply removing the flag caused a deluge of errors in some cases, since an error would be emitted any time a local or temporary had a wrong type. To remedy this, I added an alternative system (`DiagnosticImportance`) to silence additional error messages that were likely to distract the user from the underlying issue. When an error of the highest importance occurs, all less important errors are silenced. When no error of the highest importance occurs, all less important errors are emitted after checking is complete. Following the suggestions from the important error is usually enough to fix the less important errors, so this should lead to better UX most of the time.
There's also some unrelated diagnostics improvements in this PR isolated in their own commits. Splitting them out would be possible, but a bit of a pain. This isn't as tidy as some of my other PRs, but it should *only* affect diagnostics, never whether or not something passes const-checking. Note that there are a few trivial exceptions to this, like banning `Yield` in all const-contexts, not just `const fn`.
As always, meant to be reviewed commit-by-commit.
r? `@oli-obk`
|
|
|
|
|
|
|
|
|
|
r=davidtwco
Improve wording for external crate resolution error
I think it reads better this way.
|
|
Remove trailing space in error message
- Add test for error message
- Remove trailing space in error message
|