about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-15coverage: Don't bother storing the source file in `Instrumentor`Zalathar-4/+3
We can just as easily look it up again from the source map and body span when needed.
2023-12-15coverage: Extract `is_eligible_for_coverage`Zalathar-14/+25
2023-12-15coverage: Simplify parts of `InstrumentCoverage::run_pass`Zalathar-8/+6
Changes in this patch: - Extract local variable `def_id` - Check `is_fn_like` without retrieving HIR - Inline some locals that are used once and aren't needed for clarity
2023-12-15coverage: Assert that the instrumentor never sees promoted MIRZalathar-9/+3
2023-12-15Split `Handler::emit_diagnostic` in two.Nicholas Nethercote-45/+64
Currently, `emit_diagnostic` takes `&mut self`. This commit changes it so `emit_diagnostic` takes `self` and the new `emit_diagnostic_without_consuming` function takes `&mut self`. I find the distinction useful. The former case is much more common, and avoids a bunch of `mut` and `&mut` occurrences. We can also restrict the latter with `pub(crate)` which is nice.
2023-12-15Remove `Handler::emit_diag_at_span`.Nicholas Nethercote-23/+9
Compare `Handler::warn` and `Handler::span_warn`. Conceptually they are almost identical. But their implementations are weirdly different. `warn`: - calls `DiagnosticBuilder::<()>::new(self, Warning(None), msg)`, then `emit()` - which calls `G::diagnostic_builder_emit_producing_guarantee(self)` - which calls `handler.emit_diagnostic(&mut db.inner.diagnostic)` `span_warn`: - calls `self.emit_diag_at_span(Diagnostic::new(Warning(None), msg), span)` - which calls `self.emit_diagnostic(diag.set_span(sp))` I.e. they both end up at `emit_diagnostic`, but take very different routes to get there. This commit changes `span_*` and similar ones to not use `emit_diag_at_span`. Instead they just call `struct_span_*` + `emit`. Some nice side-effects of this: - `span_fatal` and `span_fatal_with_code` don't need `FatalError.raise()`, because `emit` does that. - `span_err` and `span_err_with_code` doesn't need `unwrap`. - `struct_span_note`'s `span` arg type is changed from `Span` to `impl Into<MultiSpan>` like all the other functions.
2023-12-15Avoid `DiagnosticBuilder::<T>::new` calls.Nicholas Nethercote-4/+4
The `Handler` functions that directly emit diagnostics can be more easily implemented using `struct_foo(msg).emit()`. This mirrors `Handler::emit_err` which just does `create_err(err).emit()`. `Handler::bug` is not converted because of weirdness involving conflation bugs and fatal errors with `EmissionGuarantee`. I'll fix that later.
2023-12-15Change `msg: impl Into<String>` for bug diagnostics.Nicholas Nethercote-13/+15
To `msg: impl Into<DiagnosticMessage>`, like all the other diagnostics. For consistency.
2023-12-14Auto merge of #16125 - HKalbasi:rustc-tests, r=HKalbasibors-5/+288
Run rust-analyzer on rustc tests in metrics fix #15947
2023-12-15Run rust-analyzer on rustc tests in metricshkalbasi-5/+288
2023-12-14Auto merge of #118949 - matthiaskrgr:rollup-rdzlb9h, r=matthiaskrgrbors-108/+168
Rollup of 4 pull requests Successful merges: - #118910 ([rustdoc] Use Map instead of Object for source files and search index) - #118914 (Unconditionally register alias-relate in projection goal) - #118935 (interpret: extend comment on the inhabitedness check in downcast) - #118945 (rustc_codegen_ssa: Remove trailing spaces in Display impl for CguReuse) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-14fix `x clean` for cross-compiled artifactsonur-ozkan-2/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-14Rollup merge of #118945 - Enselic:remove-trailing, r=compiler-errorsMatthias Krüger-2/+2
rustc_codegen_ssa: Remove trailing spaces in Display impl for CguReuse Otherwise errors will look like this: error: CGU-reuse for `cgu_invalidated_via_import-bar` is `PreLto ` but should be `PostLto ` ### Background I noticed that error messages looked wonky while investigating if https://github.com/rust-lang/rust/blob/529047cfc3f4f7b3ea5aaac054408f368d153727/compiler/rustc_codegen_ssa/src/assert_module_sources.rs#L281-L287 should not be wrapped by `sess.emit_err(...)`. Right now it looks like the error is accidentally ignored. It looks like https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0 might have accidentally started ignoring it (by removing the `diag.span_err()` call). I am still investigating, but regardless of the outcome we should fix the trailing whitespace.
2023-12-14Rollup merge of #118935 - RalfJung:interpret-downcast, r=saethlinMatthias Krüger-0/+18
interpret: extend comment on the inhabitedness check in downcast Cc https://github.com/rust-lang/rust/issues/115145 r? ``@saethlin``
2023-12-14Rollup merge of #118914 - compiler-errors:eager-alias-relate, r=lcnrMatthias Krüger-13/+71
Unconditionally register alias-relate in projection goal Follow-up to #118725, which subtly broke closure signature inference on combinators like `Result::map` which I noticed in syn. Essentially, instead of using `eq` which will eagerly infer `?1 := <?2 as Trait>::Assoc`, we can directly emit an alias-relate goal, which will stay ambiguous for as long as `?2` is ambiguous. This also more closely models the conceptual framing that projects-to acts like an alias-relate when solving, and like a normalizes-to when in a param env. r? lcnr
2023-12-14Rollup merge of #118910 - GuillaumeGomez:js-object-to-map, r=notriddleMatthias Krüger-93/+77
[rustdoc] Use Map instead of Object for source files and search index It's cleaner and is also easier to manipulate `Map` rather than `Object` types. r? `@notriddle`
2023-12-14Auto merge of #118375 - ouz-a:add_emit_stable_mir_tests, r=celinvalbors-14/+280
Add -Zunpretty=stable-mir output test As strongly suggested here https://github.com/rust-lang/rust/pull/118364#issuecomment-1827974148 this adds output test for `-Zunpretty=stable-mir`, added test shows almost all the functionality of the current printer. r? `@compiler-errors`
2023-12-14Move special methods from ClosureKind back into rustcMichael Goulet-57/+27
2023-12-14Unconditionally register alias-relate in projection goalMichael Goulet-13/+71
2023-12-14Use the Waker::noop API in testsMichael Goulet-82/+41
2023-12-14Change expr_trailing_brace to an exhaustive match to force new expression ↵GearsDatapacks-3/+428
kinds to specify whether they contain a brace Add inline const and other possible curly brace expressions to expr_trailing_brace Add tests for `}` before `else` in `let...else` error Change to explicit cases for expressions with optional values when being checked for trailing braces Add tests for more complex cases of `}` before `else` in `let..else` statement Move other possible `}` cases into separate arm and add FIXME for future reference
2023-12-14rustc_mir_build: Enforce `rustc::potential_query_instability` lintMartin Nordholts-1/+0
Stop allowing `rustc::potential_query_instability` on all of `rustc_mir_build` and instead allow it on a case-by-case basis if it is safe to do so. In this crate there was no instance of the lint remaining.
2023-12-14rustc_mir_build: Make non-exhaustive non-empty match diagnotics deterministicMartin Nordholts-3/+3
2023-12-14Recurse into let bindings if possible in ref casting lintUrgau-9/+41
2023-12-14Refactor and rename some functions in ref casting lintUrgau-40/+54
2023-12-14Extract casting detection logic in it's own functionUrgau-19/+24
2023-12-14remove `instant` from allowed dependenciesRémy Rakic-1/+0
2023-12-14rustc_codegen_ssa: Remove trailing spaces in Display impl for CguReuseMartin Nordholts-2/+2
Otherwise errors will look like this: error: CGU-reuse for `cgu_invalidated_via_import-bar` is `PreLto ` but should be `PostLto `
2023-12-14update measureme to 10.1.2 to deduplicate parking_lotRémy Rakic-34/+9
2023-12-14Auto merge of #118937 - lcnr:rename-solver-flag, r=compiler-errorsbors-333/+345
`-Ztrait-solver=next` to `-Znext-solver` renames the feature flag to enable the new trait solver. still want some feedback before merging: https://rust-lang.zulipchat.com/#narrow/stream/364551-t-types.2Ftrait-system-refactor/topic/renaming.20the.20feature.20flag.20to.20.60-Znew-solver.60. The idea is to make it easier to add another option, e.g. to enable the solver in wfcheck or to optionally change its behavior to our new coinduction approach. r? `@compiler-errors`
2023-12-14add stable_mir output testouz-a-14/+280
2023-12-14Include an additional cherry-pickNikita Popov-0/+0
2023-12-14Fix bootstrap test failuresNikita Popov-21/+21
There are a number of fixes here: * if-unchanged is supposed to be the default for channel=dev, but actually used different logic. Make sure it is the same. * If no llvm section was specified at all, different logic was also used. Go through the standard helper. * Some more assertions should depend on if_unchanged.
2023-12-14update use of feature flagslcnr-1/+1
2023-12-14reviewlcnr-1/+1
2023-12-14consistently use "next solver" instead of "new solver"lcnr-16/+16
2023-12-14update use of feature flagslcnr-228/+227
2023-12-14rename `-Ztrait-solver` to `-Znext-solver`lcnr-89/+102
2023-12-14Fix target_feature config in portable-simdUrgau-1/+1
2023-12-14Don't forget pure rustc target features in check-cfgUrgau-3/+10
2023-12-14Rustup to rustc 1.76.0-nightly (eeff92ad3 2023-12-13)bjorn3-1/+1
2023-12-14Use all the known features in check-cfgUrgau-17/+26
2023-12-14Move rustc_codegen_ssa target features to rustc_targetUrgau-442/+450
2023-12-14Auto merge of #118789 - jyn514:dry-run, r=onur-ozkanbors-2/+2
fix --dry-run when the change-id warning is printed previously: ``` Building bootstrap Compiling bootstrap v0.0.0 (/home/jyn/src/rust2/src/bootstrap) Finished dev [unoptimized] target(s) in 4.23s thread 'main' panicked at src/bin/main.rs:147:17: fs::write(warned_id_path, latest_change_id.to_string()) failed with No such file or directory (os error 2) ```
2023-12-14Fix cases where std accidentally relied on inline(never)Ben Kimock-11/+37
2023-12-14Sync from rust eeff92ad32c2627876112ccfe812e19d38494087bjorn3-60/+0
2023-12-14Remove `ModuleId` from `TypeOwnerId`Lukas Wirth-45/+112
2023-12-14Use Map instead of Object for source files and search indexGuillaume Gomez-93/+77
2023-12-14Auto merge of #118566 - klensy:cstr-new, r=WaffleLapkinbors-97/+68
use c literals in compiler and library Relands refreshed https://github.com/rust-lang/rust/pull/111647
2023-12-14Auto merge of #16121 - Veykril:assert-messages, r=Veykrilbors-2/+2
minor: Add messages to some asserts for better debugging cc https://github.com/rust-lang/rust-analyzer/issues/16118