| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
adjust dangling-int-ptr error message
based on suggestions by `@saethlin` in https://github.com/rust-lang/miri/issues/2163
Fixes https://github.com/rust-lang/miri/issues/2163
I also did a bit of refactoring on this, so we have a helper method to create a `Pointer` with `None` provenance.
|
|
|
|
lints: mostly translatable diagnostics
As lints are created slightly differently than other diagnostics, intended to try make them translatable first and then look into the applicability of diagnostic structs but ended up just making most of the diagnostics in the crate translatable (which will still be useful if I do make a lot of them structs later anyway).
r? ``@compiler-errors``
|
|
r=Mark-Simulacrum
Add regression test for #50439
closes #50439
|
|
|
|
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
|
|
|
|
|
|
r=Mark-Simulacrum
Add regression test for #85907
closes #85907
|
|
|
|
make const_err show up in future breakage reports
As tracked in https://github.com/rust-lang/rust/issues/71800, const_err should become a hard error Any Day Now (TM). I'd love to move forward with that sooner rather than later; it has been deny-by-default for many years and a future incompat lint since https://github.com/rust-lang/rust/pull/80394 (landed more than a year ago). Some CTFE errors are already hard errors since https://github.com/rust-lang/rust/pull/86194. But before we truly make it a hard error in all cases, we now have one more intermediate step we can take -- to make it show up in future breakage reports.
Cc `````@rust-lang/wg-const-eval`````
|
|
|
|
|
|
|
|
r=compiler-errors
Point to type parameter definition when not finding variant, method and associated item
fixes #77391
|
|
use `def_ident_span` , `body_owner_def_id` instead of `in_progress_typeck_results`, `guess_head_span`
use `body_id.owner` directly
add description to label
|
|
|
|
|
|
|
|
Move some tests to more reasonable directories
r? ```@petrochenkov```
|
|
|
|
|
|
|