| Age | Commit message (Collapse) | Author | Lines |
|
We use more specific `mk_*` functions in most places, might as well use
them as much as possible.
|
|
|
|
These are in places where a `tcx` is easily obtained.
|
|
Extend support for `implies_by` (from `#[stable]` and `#[unstable]`)
to `#[rustc_const_stable]` and `#[rustc_const_unstable]`.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Rename `PointerSized` to `PointerLike`
The old name was unnecessarily vague. This PR renames a nightly language feature that I added, so I don't think it needs any additional approval, though anyone can feel free to speak up if you dislike the rename.
It's still unsatisfying that we don't the user which of {size, alignment} is wrong, but this trait really is just a stepping stone for a more generalized mechanism to create `dyn*`, just meant for nightly testing, so I don't think it really deserves additional diagnostic machinery for now.
Fixes #107696, cc ``@RalfJung``
r? ``@eholk``
|
|
Rollup of 8 pull requests
Successful merges:
- #107719 (Remove `arena_cache` modifier from `upstream_monomorphizations_for`)
- #107740 (Avoid locking the global context across the `after_expansion` callback)
- #107746 (Split fn_ctxt/adjust_fulfillment_errors from fn_ctxt/checks)
- #107749 (allow quick-edit convenience)
- #107750 (make more readable)
- #107755 (remove binder from query constraints)
- #107756 (miri: fix ICE when running out of address space)
- #107764 (llvm-16: Use Triple.h from new header location.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
miri: fix ICE when running out of address space
Fixes https://github.com/rust-lang/miri/issues/2769
r? `@oli-obk`
I didn't add a test since that requires https://github.com/oli-obk/ui_test/issues/38 (host must be 64bit and target 32bit). Also the test takes ~30s, so I am not sure if we want to have it in the test suite?
|
|
r=compiler-errors
Modify existing bounds if they exist
Fixes #107335.
This implementation is kinda gross but I don't really see a better way to do it.
This primarily does two things: Modifies `suggest_constraining_type_param` to accept a new parameter that indicates a span to be replaced instead of added, if presented, and limit the additive suggestions to either suggest a new bound on an existing bound (see newly added unit test) or add the generics argument if a generics argument wasn't found.
The former change is required to retain the capability to add an entirely new bounds if it was entirely omitted.
r? ``@compiler-errors``
|
|
|
|
interpret: move discriminant reading and writing to separate file
This is quite different from the otherwise fairly general read and write functions in place.rs and operand.rs, and also it's nice to have these two functions close together as they are basically inverses of each other.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Improve enum checks
Some light refactoring.
|
|
Bump bootstrap compiler to 1.68
This also changes our stage0.json to include the rustc component for the rustfmt pinned nightly toolchain, which is currently necessary due to rustfmt dynamically linking to that toolchain's librustc_driver and libstd.
r? `@pietroalbini`
|
|
|
|
|
|
|
|
|
|
Use stable metric for const eval limit instead of current terminator-based logic
This patch adds a `MirPass` that inserts a new MIR instruction `ConstEvalCounter` to any loops and function calls in the CFG. This instruction is used during Const Eval to count against the `const_eval_limit`, and emit the `StepLimitReached` error, replacing the current logic which uses Terminators only.
The new method of counting loops and function calls should be more stable across compiler versions (i.e., not cause crates that compiled successfully before, to no longer compile when changes to the MIR generation/optimization are made).
Also see: #103877
|
|
|
|
|
|
|
|
EarlyBinder to fn_sig in metadata
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #97373 (impl DispatchFromDyn for Cell and UnsafeCell)
- #106625 (Remove backwards compat for LLVM 12 coverage format)
- #106779 (Avoid __cxa_thread_atexit_impl on Emscripten)
- #106811 (Append .dwp to the binary filename instead of replacing the existing extension.)
- #106836 (Remove optimistic spinning from `mpsc::SyncSender`)
- #106946 (implement Hash for proc_macro::LineColumn)
- #107074 (remove unnecessary check for opaque types)
- #107287 (Improve fn pointer notes)
- #107304 (Use `can_eq` to compare types for default assoc type error)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
remove unnecessary check for opaque types
this isn't needed and may hide some errors.
after analysis there are no opaque types so it's a noop anyways
before analysis there are opaque types but due to `Reveal::UserFacing` we don't reveal them. `is_subtype` simply discards the opaque type constraints as these will get checked again during mir borrowck.
r? types
want to land this after the beta-cutoff as mir validator changes are apparently pretty scary
|
|
Rollup of 11 pull requests
Successful merges:
- #106407 (Improve proc macro attribute diagnostics)
- #106960 (Teach parser to understand fake anonymous enum syntax)
- #107085 (Custom MIR: Support binary and unary operations)
- #107086 (Print PID holding bootstrap build lock on Linux)
- #107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`)
- #107204 (suggest qualifying bare associated constants)
- #107248 (abi: add AddressSpace field to Primitive::Pointer )
- #107272 (Implement ObjectSafe and WF in the new solver)
- #107285 (Implement `Generator` and `Future` in the new solver)
- #107286 (ICE in new solver if we see an inference variable)
- #107313 (Add Style Team Triagebot config)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
abi: add AddressSpace field to Primitive::Pointer
...and remove it from `PointeeInfo`, which isn't meant for this.
There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string (and various other changes),
which will be done in a followup.
(That is, if it's actually worth it to support multiple different pointer sizes.
There is a lot of code that would be affected by that.)
Fixes #106367
r? ``@oli-obk``
cc ``@Patryk27``
|
|
InstCombine away intrinsic validity assertions
This optimization (currently) fires 246 times on the standard library. It seems to fire hardly at all on the big crates in the benchmark suite. Interesting.
|
|
|
|
|
|
Added it back because it's used by Miri, but in the compiler itself, it
will not do anything (just return `Ok(())`.
|
|
- Remove logic that limits const eval based on terminators, and use the
stable metric instead (back edges + fn calls)
- Add unstable flag `tiny-const-eval-limit` to add UI tests that do not
have to go up to the regular 2M step limit
|
|
|
|
This patch adds a `MirPass` that tracks the number of back-edges and
function calls in the CFG, adds a new MIR instruction to increment a
counter every time they are encountered during Const Eval, and emit a
warning if a configured limit is breached.
|
|
use LocalDefId instead of HirId in trait resolution to simplify
the obligation clause resolution
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
|
|
...and remove it from `PointeeInfo`, which isn't meant for this.
There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string, which will be done in a followup.
|
|
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
|
|
|
|
|
|
Switching them to `Break(())` and `Continue(())` instead.
libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
|
|
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
|