about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2024-06-17Rollup merge of #126584 - cjgillot:issue-122736, r=michaelwoeristerMatthias Krüger-2/+6
Do not ICE in privacy when type inference fails. Fixes https://github.com/rust-lang/rust/issues/122736
2024-06-17Rollup merge of #126577 - oli-obk:static_valtrees, r=RalfJungMatthias Krüger-9/+0
const_refs_to_static test and cleanup r? ``@RalfJung`` test the existing behaviour of adt_const_params combined with const_refs_to_static. also remove a dead error variant about consts referring to statics
2024-06-17Rollup merge of #126568 - bvanjoi:fix-126376, r=petrochenkovMatthias Krüger-9/+16
mark undetermined if target binding in current ns is not got Fixes #126376 Fixes #126389 Add a branch to handle more cases... r? `@petrochenkov`
2024-06-17Remove an unused validation error variantOli Scherer-9/+0
2024-06-17Do not ICE in privacy when type inference fails.Camille GILLOT-2/+6
2024-06-17Auto merge of #126581 - GuillaumeGomez:rollup-dx4fadn, r=GuillaumeGomezbors-47/+70
Rollup of 3 pull requests Successful merges: - #126226 (Make suggestion to change `Fn` to `FnMut` work with methods as well) - #126570 (Convert a `span_bug` to a `span_delayed_bug`.) - #126580 (Add `run-make/const_fn_mir` missing test annotation) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-17Rollup merge of #126570 - nnethercote:fix-126385, r=lcnrGuillaume Gomez-3/+1
Convert a `span_bug` to a `span_delayed_bug`. PR #121208 converted this from a `span_delayed_bug` to a `span_bug` because nothing in the test suite caused execution to hit this path. But now fuzzing has found a test case that does hit it. So this commit converts it back to `span_delayed_bug` and adds the relevant test. Fixes #126385. r? `@lcnr`
2024-06-17Rollup merge of #126226 - gurry:125325-improve-closure-arg-sugg, r=oli-obkGuillaume Gomez-44/+69
Make suggestion to change `Fn` to `FnMut` work with methods as well Fixes #125325 The issue occurred because the code that emitted the suggestion to change `Fn` to `FnMut` worked only for function calls and not method calls. This PR makes it work with methods as well.
2024-06-17Auto merge of #126492 - compiler-errors:more-uplifting, r=lcnrbors-163/+222
More preparation for new trait solver uplifting Getting closer to being able to uplift the whole solver 🙏 Each commit should be self-justifying. r? lcnr
2024-06-17Convert a `span_bug` to a `span_delayed_bug`.Nicholas Nethercote-3/+1
PR #121208 converted this from a `span_delayed_bug` to a `span_bug` because nothing in the test suite caused execution to hit this path. But now fuzzing has found a test case that does hit it. So this commit converts it back to `span_delayed_bug` and adds the relevant test. Fixes #126385.
2024-06-17Rollup merge of #126538 - Zalathar:graph, r=nnethercote许杰友 Jieyou Xu (Joe)-154/+46
coverage: Several small improvements to graph code This PR combines a few small improvements to coverage graph handling code: - Remove some low-value implementation tests that were getting in the way of other changes. - Clean up `pub` visibility. - Flatten some code using let-else. - Prefer `.copied()` over `.cloned()`. `@rustbot` label +A-code-coverage
2024-06-17Rollup merge of #126535 - Zalathar:covspans, r=nnethercote许杰友 Jieyou Xu (Joe)-204/+232
coverage: Arrange span extraction/refinement as a series of passes The old code for extracting/refining coverage spans from MIR has been dismantled and split up into several passes (e.g. see #126294), but because this was done incrementally, the resulting code is disorganised. This PR addresses that by moving the main control-flow into a single function (`coverage::spans::extract_refined_covspans`) that more clearly shows the process as a series of separate steps, most delegated to helper functions in the same file. This should make it easier to understand and modify the refinement process. It also means that submodule `from_mir` is now only concerned with the details of extracting relevant spans from the various kinds of MIR statement/terminator. There should be no change to the resulting coverage maps, as demonstrated by the lack of changes to tests.
2024-06-17Rollup merge of #125258 - compiler-errors:static-if-no-lt, r=nnethercote许杰友 Jieyou Xu (Joe)-59/+110
Resolve elided lifetimes in assoc const to static if no other lifetimes are in scope Implements the change to elided lifetime resolution in *associated consts* subject to FCP here: https://github.com/rust-lang/rust/issues/125190#issue-2301532282 Specifically, walk the enclosing lifetime ribs in an associated const, and if we find no other lifetimes, then resolve to `'static`. Also make it work for traits, but don't lint -- just give a hard error in that case.
2024-06-17mark undetermined if target binding in current ns is not gotbohan-9/+16
2024-06-16Auto merge of #126543 - petrochenkov:upctxt4, r=cjgillotbors-15/+25
rustc_span: Optimize more hygiene operations using `Span::map_ctxt` I missed these in https://github.com/rust-lang/rust/pull/125017.
2024-06-16Rollup merge of #126561 - kadiwa4:boxed_slice_into_iter_doc, r=jieyouxu许杰友 Jieyou Xu (Joe)-1/+1
`boxed_slice_into_iter`: tiny doc correction `CURRENT_RUSTC_VERSION` isn't flexible enough for this, so it got replaced by 1.80.0 instead of 1.79.0 in #126273 :/
2024-06-16Rollup merge of #126365 - Dirbaio:collapse-debuginfo-statics, r=workingjubilee许杰友 Jieyou Xu (Joe)-2/+2
Honor collapse_debuginfo for statics. fixes #126363 <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-16Rollup merge of #126192 - bjorn3:redox_patches, r=petrochenkov许杰友 Jieyou Xu (Joe)-1/+35
Various Redox OS fixes and add i686 Redox OS target All of these come from the fork used by Redox OS available at https://gitlab.redox-os.org/redox-os/rust/-/commits/redox-2024-05-11/?ref_type=heads. cc `@jackpot51`
2024-06-16boxed_slice_into_iter: tiny doc correctionKalle Wachsmuth-1/+1
2024-06-16Uplift OpaqueTypeKey too, use it in responseMichael Goulet-51/+66
2024-06-16Add a noteMichael Goulet-0/+6
2024-06-16Uplift ExternalConstraintDataMichael Goulet-43/+79
2024-06-16Make ExternalConstraints just carry outlivesMichael Goulet-20/+23
2024-06-16Stop using AssocKind in new solverMichael Goulet-13/+11
2024-06-16Move InferCtxtSelectExt out of eval_ctxt moduleMichael Goulet-3/+3
2024-06-16Uplift Reveal to rustc_type_irMichael Goulet-48/+49
2024-06-16Use Linux file locking on RedoxJeremy Soller-0/+4
2024-06-16Add i686-unknown-redox targetbjorn3-0/+28
Co-Authored-By: Jeremy Soller <jackpot51@gmail.com>
2024-06-16Several fixes to the redox target specsJeremy Soller-1/+3
* Allow crt-static for dylibs * Pass -lgcc to the linker
2024-06-16rustc_span: Minor improvementsVadim Petrochenkov-14/+33
Introduce `{IndexNewtype,SyntaxContext}::from_u16` for convenience because small indices are sometimes encoded as `u16`. Use `SpanData::span` instead of `Span::new` where appropriate. Add a clarifying comment about decoding span parents.
2024-06-16rustc_span: Optimize more hygiene operations using `Span::map_ctxt`Vadim Petrochenkov-15/+25
2024-06-16Auto merge of #126540 - jhpratt:rollup-fzzz8j3, r=jhprattbors-1/+1
Rollup of 4 pull requests Successful merges: - #125112 (Document behavior of `create_dir_all` wrt. empty path) - #126127 (Spell out other trait diagnostic) - #126309 (unify git command preperation) - #126539 (Update `Arc::try_unwrap()` docs) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-16Rollup merge of #126127 - Alexendoo:other-trait-diag, r=pnkfelixJacob Pratt-1/+1
Spell out other trait diagnostic I recently saw somebody confused about the diagnostic thinking it was suggesting to add an `as` cast. This change is longer but I think it's clearer
2024-06-16coverage: Prefer `Iterator::copied`Zalathar-1/+1
2024-06-16coverage: Flatten some graph code with let-elseZalathar-18/+17
2024-06-16coverage: Reduce/simplify visibility in `coverage::graph`Zalathar-24/+28
Using `pub(super)` makes it harder to move code between modules, and doesn't provide much privacy benefit over `pub(crate)`.
2024-06-16coverage: Remove some old low-value unit tests for graph traversalZalathar-111/+0
These tests might have originally been useful as an implementation aid, but now they don't provide enough value to justify the burden of updating them as the underlying code changes. The code they test is still exercised by the main end-to-end coverage tests.
2024-06-16Auto merge of #126505 - compiler-errors:no-vtable, r=lcnrbors-195/+141
Only compute vtable information during codegen This PR removes vtable information from the `Object` and `TraitUpcasting` candidate sources in the trait solvers, and defers the computation of relevant information to `Instance::resolve`. This is because vtables really aren't a thing in the trait world -- they're an implementation detail in codegen. Previously it was just easiest to tangle this information together since we were already doing the work of looking at all the supertraits in the trait solver, and specifically because we use traits to represent when it's possible to call a method via a vtable (`Object` candidate) and do upcasting (`Unsize` candidate). but I am somewhat suspicious we're doing a *lot* of extra work, especially in polymorphic contexts, so let's see what perf says.
2024-06-16coverage: Split span refinement into two separate stepsZalathar-10/+12
2024-06-16coverage: Split out a function for dividing coverage spans into bucketsZalathar-34/+52
2024-06-16coverage: Eagerly convert coverage spans to a simpler formZalathar-49/+55
2024-06-16coverage: Move most span processing back into `coverage::spans`Zalathar-155/+157
2024-06-16coverage: More consistent variable names for span processingZalathar-25/+25
2024-06-15Rollup merge of #126525 - jieyouxu:traitsel-docs, r=compiler-errorsGuillaume Gomez-2/+2
trait_selection: remove extra words Tiny doc cleanup. Fixes https://github.com/rust-lang/rust/issues/88231.
2024-06-15Rollup merge of #126508 - beepster4096:minor_borrowck_cherrypick, ↵Guillaume Gomez-4/+4
r=compiler-errors Make uninitialized_error_reported a set of locals Another artifact of how places used to be able to be based on statics and not just locals. This set is exclusively filled with PlaceRefs that are just locals, so it should just contain locals directly.
2024-06-15Rollup merge of #126496 - compiler-errors:more-generics, r=lcnrGuillaume Gomez-143/+157
Make proof tree probing and `Candidate`/`CandidateSource` generic over interner `<TyCtxt<'tcx>>` is ugly, but will become `<I>` when things actually become generic. r? lcnr
2024-06-15Rollup merge of #126410 - RalfJung:smir-const-operand, r=oli-obkGuillaume Gomez-51/+48
smir: merge identical Constant and ConstOperand types The first commit renames the const operand visitor functions on regular MIR to match the type name, that was forgotten in the original rename. The second commit changes stable MIR, fixing https://github.com/rust-lang/project-stable-mir/issues/71. Previously there were two different smir types for the MIR type `ConstOperand`, one used in `Operand` and one in `VarDebugInfoContents`. Maybe we should have done this with https://github.com/rust-lang/rust/pull/125967, so there's only a single breaking change... but I saw that PR too late. Fixes https://github.com/rust-lang/project-stable-mir/issues/71
2024-06-15Rollup merge of #126404 - compiler-errors:alias-relate-terms, r=lcnrGuillaume Gomez-1/+40
Check that alias-relate terms are WF if reporting an error in alias-relate Check that each of the left/right term is WF when deriving a best error obligation for an alias-relate goal. This will make sure that given `<i32 as NotImplemented>::Assoc = ()` will drill down into `i32: NotImplemented` since we currently treat the projection as rigid. r? lcnr
2024-06-15trait_selection: remove extra words许杰友 Jieyou Xu (Joe)-2/+2
2024-06-15Auto merge of #126518 - matthiaskrgr:rollup-wb70rzq, r=matthiaskrgrbors-149/+370
Rollup of 9 pull requests Successful merges: - #125829 (rustc_span: Add conveniences for working with span formats) - #126361 (Unify intrinsics body handling in StableMIR) - #126417 (Add `f16` and `f128` inline ASM support for `x86` and `x86-64`) - #126424 ( Also sort `crt-static` in `--print target-features` output) - #126428 (Polish `std::path::absolute` documentation.) - #126429 (Add `f16` and `f128` const eval for binary and unary operationations) - #126448 (End support for Python 3.8 in tidy) - #126488 (Use `std::path::absolute` in bootstrap) - #126511 (.mailmap: Associate both my work and my private email with me) r? `@ghost` `@rustbot` modify labels: rollup