| Age | Commit message (Collapse) | Author | Lines |
|
extra sanity check against consts pointing to mutable memory
This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.
|
|
|
|
just impossible
|
|
no alignment check during interning
This should fix https://github.com/rust-lang/rust/issues/101034
r? `@oli-obk`
Unfortunately we don't have a self-contained testcase for this problem. I am not sure how it can be triggered...
|
|
|
|
r=Mark-Simulacrum
Stabilize `const_ptr_offset_from`.
Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP.
Closes #92980.
|
|
initialized Scalar
|
|
|
|
|
|
Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848)
with a FCP.
|
|
|
|
fix ICE with extra-const-ub-checks
Fixes https://github.com/rust-lang/rust/issues/100771
|
|
|
|
|
|
|
|
suggest `once_cell::Lazy` for non-const statics
Addresses https://github.com/rust-lang/rust/issues/100410
Some questions:
- removing the `if` seems to include too many cases (e.g. calls to non-const functions inside a `const fn`), but this code excludes the following case:
```rust
const FOO: Foo = non_const_fn();
```
Should we suggest `once_cell` in this case as well?
- The original issue mentions suggesting `AtomicI32` instead of `Mutex<i32>`, should this PR address that as well?
|
|
make NOP dyn casts not require anything about the vtable
As suggested [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/dyn-upcasting.20stabilization/near/292151439). This matches what the codegen backends already do, and what Miri did do until https://github.com/rust-lang/rust/pull/99420 when I made it super extra paranoid.
|
|
|
|
|
|
Those intrinsics either panic or do nothing. They are safe.
|
|
add -Zextra-const-ub-checks to enable more UB checking in const-eval
Cc https://github.com/rust-lang/rust/issues/99923
r? `@oli-obk`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=oli-obk
Deeply deny fn and raw ptrs in const generics
I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter.
We now reject both of these in the same way:
```
#![feature(adt_const_params)]
#[derive(Eq, PartialEq)]
struct Wrapper();
fn foo<const W: Wrapper>() {}
fn foo2<const F: fn()>() {}
```
This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place.
cc: ``@b-naber`` who introduced that test^
fixes #99641
|
|
|
|
|
|
|
|
|
|
Logarithmus:feature/99255-omit-const-generic-suffixes, r=petrochenkov
feat: omit suffixes in const generics (e.g. `1_i32`)
Closes #99255
|
|
|
|
|
|
|
|
Closes #99255
|
|
r=cjgillot
gather body owners
Issue #96341
|
|
|
|
|
|
This doesn't stabilize methods working on mutable pointers.
|
|
fix ICE in ConstProp
Fixes https://github.com/rust-lang/rust/issues/96169
|
|
Track implicit `Sized` obligations in type params
When we evaluate `ty::GenericPredicates` we introduce the implicit
`Sized` predicate of type params, but we do so with only the `Predicate`
its `Span` as context, we don't have an `Obligation` or
`ObligationCauseCode` we could influence. To try and carry this
information through, we add a new field to `ty::GenericPredicates` that
tracks both which predicates come from a type param and whether that
param has any bounds already (to use in suggestions).
We also suggest adding a `?Sized` bound if appropriate on E0599.
Address part of #98539.
|
|
|
|
When a binding is declared without a value, borrowck verifies that all
codepaths have *one* assignment to them to initialize them fully. If
there are any cases where a condition can be met that leaves the binding
uninitialized or we attempt to initialize a field of an unitialized
binding, we emit E0381.
We now look at all the statements that initialize the binding, and use
them to explore branching code paths that *don't* and point at them. If
we find *no* potential places where an assignment to the binding might
be missing, we display the spans of all the existing initializers to
provide some context.
|
|
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting
the HIR Generics. (Fix #98539)
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
|
|
|
|
|