about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2024-05-03Rollup merge of #124588 - compiler-errors:ocx, r=lcnrMatthias Krüger-112/+148
Use `ObligationCtxt` in favor of `TraitEngine` in many more places r? lcnr
2024-05-03Rollup merge of #124492 - Strophox:adjust-allocbytes, r=RalfJungMatthias Krüger-7/+5
Generalize `adjust_from_tcx` for `Allocation` Previously, `adjust_from_tcx` would take an `Allocation` and "adjust allocation from the ones in `tcx` to a custom Machine instance [...]". This PR generalizes this so the Machine instance can also determine the `Bytes` type of the output `Allocation`. r? `@RalfJung`
2024-05-03remove trait bounds on AllocBytesStrophox-3/+1
2024-05-03Cow::from(&*...) changed to Cow::Owned(Vec::from(...))Strophox-1/+1
2024-05-03generalize adjust_from_tcxStrophox-4/+4
2024-05-03Rollup merge of #124637 - fmease:ast-pretty-ty-asc-builtin-syn, ↵Matthias Krüger-11/+19
r=compiler-errors AST pretty: Use `builtin_syntax` for type ascription Follow-up to #122806. CC #124619.
2024-05-03Rollup merge of #124610 - nnethercote:typenum, r=lcnrMatthias Krüger-8/+4
Tweak `consts_may_unify` r? ````@lcnr````
2024-05-02Take ocx by move for pending obligationsMichael Goulet-4/+11
2024-05-02Use ObligationCtxt in favor of TraitEngine in many placesMichael Goulet-112/+141
2024-05-03AST pretty: Use `builtin_syntax` for type ascriptionLeón Orell Valerian Liehr-11/+19
2024-05-03Refactor `Frame`.Nicholas Nethercote-48/+50
It is currently an enum and the `tts` and `idx` fields are repeated across the two variants. This commit splits it into a struct `Frame` and an enum `FrameKind`, to factor out the duplication. The commit also renames `Frame::new` as `Frame::new_delimited` and adds `Frame::new_sequence`. I.e. both variants now have a constructor.
2024-05-03Type annotate `repeats`.Nicholas Nethercote-1/+1
Because the type is not obvious, and this clarifies things.
2024-05-03Introduce `Invocation::span_mut`.Nicholas Nethercote-5/+9
Alongside the existing `Invocation::span`.
2024-05-03Replace a hard-to-read line.Nicholas Nethercote-1/+2
Too clever by half, IMO.
2024-05-03Tweak `fully_expand_fragment` loop.Nicholas Nethercote-11/+9
Control flow never gets past the end of the `ExpandResult::Retry` match arm, due to the `span_bug` and the `continue`. Therefore, the code after the match can only be reached from the `ExpandResult::Ready` arm. This commit moves that code after the match into the `ExpandResult::Ready` arm, avoiding the need for the `continue` in the `ExpandResult::Retry` arm.
2024-05-03Remove unnecessary `pub`s.Nicholas Nethercote-11/+12
2024-05-03Fix some comment formatting.Nicholas Nethercote-12/+16
2024-05-03Inline and remove three `DummyResult` methods.Nicholas Nethercote-32/+22
They each have a single call site.
2024-05-03Remove unnecessary re-export of `MacroKind`.Nicholas Nethercote-3/+1
2024-05-03De-`pub` some `rustc_expand` modules.Nicholas Nethercote-7/+5
2024-05-03Remove unused `ExpCtxt` methods.Nicholas Nethercote-27/+0
2024-05-03Remove an unnecessary `#[macro_use]`.Nicholas Nethercote-1/+0
2024-05-03Remove an unnecessary re-export of `rustc_span::hygiene`.Nicholas Nethercote-2/+1
2024-05-03rustc_expand: clean up attributes.Nicholas Nethercote-5/+5
Sort them, and remove the unused ones (`lint_reasons` and `proc_macro_span`).
2024-05-03Tweak `consts_may_unify`.Nicholas Nethercote-8/+4
`ConstKind::Value` is the only variant where control flow leaves the first match on `impl_ct.kind()`, so there is no need for a second match on the same expression later on.
2024-05-02Rollup merge of #124627 - RalfJung:interpret-doc-no-inline, r=fmeaseMatthias Krüger-0/+1
interpret: hide some reexports in rustdoc Cc https://github.com/rust-lang/rust/issues/124608
2024-05-02Rollup merge of #124624 - WaffleLapkin:old_unit, r=fmeaseMatthias Krüger-56/+50
Use `tcx.types.unit` instead of `Ty::new_unit(tcx)` I don't think there is any need for the function, given that we can just access the `.types`, similarly to all other primitives?
2024-05-02Rollup merge of #124623 - lcnr:coherence-uwu, r=compiler-errorsMatthias Krüger-36/+44
shallow resolve in orphan check r? ``@compiler-errors`` cc https://github.com/rust-lang/rust/pull/124588#pullrequestreview-2036012292
2024-05-02Rollup merge of #124579 - RalfJung:align-bytes-usize, r=fmeaseMatthias Krüger-1/+11
Align: add bytes_usize and bits_usize This matches `Size::bytes/bits_usize`. I recently wanted this in Miri as well.
2024-05-02Rollup merge of #124414 - lqd:subdiagnostics, r=davidtwcoMatthias Krüger-1/+0
remove extraneous note on `UnableToRunDsymutil` diagnostic If I understand [this FIXME](https://github.com/rust-lang/rust/blob/1367827eac3d813a261a4c444037af9736996daa/compiler/rustc_macros/src/diagnostics/diagnostic.rs#L205) correctly, it seems we don't yet validate subdiagnostics, so `#[note]` and co in the `#[derive(Diagnostic]` item could be out-of-sync with the fluent message, without causing compile errors. It was the case for `rustc_codegen_ssa::errors::UnableToRunDsymutil`, causing the ICE in #124392. I've grepped and scripted my way through most of our diagnostics structs and fluent bundles and the above was the only such extraneous `#[note]`/`#[note(name)]`/`#[help]`/`#[warning]` I could find, so hopefully there aren't many others like it. I haven't checked if the opposite can happen, a `.note = ` in a fluent message that is lacking a corresponding `#[note]` on the struct and not causing an error, but maybe it's possible? r? ``@davidtwco`` fixes #124392
2024-05-02interpret: hide some reexports in rustdocRalf Jung-0/+1
2024-05-02Inline & delete `Ty::new_unit`, since it's just a field accessWaffle Lapkin-56/+50
2024-05-02shallow resolve in orphan checklcnr-36/+44
2024-05-02Rollup merge of #124582 - RalfJung:std-not-found, r=NilstriebGuillaume Gomez-4/+1
always print nice 'std not found' error when std is not found Fixes https://github.com/rust-lang/miri/issues/3529 Arguably Miri is doing something odd by letting people create no-std sysroots for arbitrary targets -- but equally arguably, there's no good reason for rustc to special-case the host triple here. Being a non-host triple does not imply the target is a no-std target, after all.
2024-05-02Rollup merge of #124568 - Urgau:non-local-defs-doctest, ↵Guillaume Gomez-4/+19
r=michaelwoerister,GuillaumeGomez Adjust `#[macro_export]`/doctest help suggestion for non_local_defs lint This PR adjust the help suggestion of the `non_local_definitions` lint when encountering a `#[macro_export]` at top-level doctest. So instead of a non-sentential help suggestion to move the `macro_rules!` up above the `rustdoc`-generated function. We now suggest users to declare their own function. Fixes *(partially, needs backport)* #124534
2024-05-02Auto merge of #124521 - Mark-Simulacrum:bootstrap-bump, r=albertlarsan68bors-31/+23
Bump bootstrap compiler to latest beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday This also cherry-picks d716d72586548963f32e5c8d57c41db0065fa6e0 from the beta branching, to continue to workaround #122758. r? bootstrap
2024-05-02Auto merge of #123939 - WaffleLapkin:never-fallback-unsafe-lint, ↵bors-21/+346
r=compiler-errors Add a lint against never type fallback affecting unsafe code ~~I'm not very happy with the code quality... `VecGraph` not allowing you to get predecessors is very annoying. This should work though, so there is that.~~ (ended up updating `VecGraph` to support getting predecessors) ~~First few commits are from https://github.com/rust-lang/rust/pull/123934 https://github.com/rust-lang/rust/pull/123980~~
2024-05-01Step bootstrap cfgsMark Rousskov-17/+3
2024-05-02Split `hir_typeck_never_type_fallback_flowing_into_unsafe` into 5 slugsWaffle Lapkin-30/+44
2024-05-02Add proper support for all kinds of unsafe ops to the lintWaffle Lapkin-44/+146
(never_type_fallback_flowing_into_unsafe)
2024-05-02Add `UnordMap::try_insert`Waffle Lapkin-0/+7
2024-05-02Reorganize `use`sWaffle Lapkin-13/+11
2024-05-02Add an explanation about never type fallbackMaybe Waffle-2/+38
2024-05-02Add a lint against never type fallback affecting unsafe codeMaybe Waffle-10/+183
2024-05-02Convert `if` to `match`Maybe Waffle-11/+6
2024-05-01Mark more entries in rustc_data_structures as no_inline for docsMark Rousskov-0/+6
This is a workaround for #122758, but it's not clear why 1.79 requires a more extensive amount of no_inline than the previous release. Seems like there's something relatively subtle happening here.
2024-05-01Replace version placeholders for 1.79Mark Rousskov-14/+14
2024-05-02Auto merge of #124529 - compiler-errors:select, r=lcnrbors-328/+156
Rewrite select (in the new solver) to use a `ProofTreeVisitor` We can use a proof tree visitor rather than collecting and recomputing all the nested goals ourselves. Based on #124415
2024-05-01Rewrite select to use a ProofTreeVisitorMichael Goulet-328/+156
2024-05-01Rollup merge of #124566 - lcnr:normalizes-to-proof-tree, r=compiler-errorsMatthias Krüger-50/+120
fix `NormalizesTo` proof tree issue fixes #124422 cc #121848 r? ``@compiler-errors``