about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-22Rid the AST & HIR pretty printers of syntactic cruftLeón Orell Valerian Liehr-37/+4
2023-12-22Auto merge of #119173 - compiler-errors:direct-coro-kind, r=TaKO8Kibors-4/+19
Encode `CoroutineKind` directly Probably a quick optimization? r? `@ghost`
2023-12-22Auto merge of #119163 - fmease:refactor-ast-trait-bound-modifiers, ↵bors-200/+194
r=compiler-errors Refactor AST trait bound modifiers Instead of having two types to represent trait bound modifiers in the parser / the AST (`parser::ty::BoundModifiers` & `ast::TraitBoundModifier`), only to map one to the other later, just use `parser::ty::BoundModifiers` (moved & renamed to `ast::TraitBoundModifiers`). The struct type is more extensible and easier to deal with (see [here](https://github.com/rust-lang/rust/pull/119099/files#r1430749981) and [here](https://github.com/rust-lang/rust/pull/119099/files#r1430752116) for context) since it more closely models what it represents: A compound of two kinds of modifiers, constness and polarity. Modeling this as an enum (the now removed `ast::TraitBoundModifier`) meant one had to add a new variant per *combination* of modifier kind, which simply isn't scalable and which lead to a lot of explicit non-DRY matches. NB: `hir::TraitBoundModifier` being an enum is fine since HIR doesn't need to worry representing invalid modifier kind combinations as those get rejected during AST validation thereby immensely cutting down the number of possibilities.
2023-12-22Auto merge of #119097 - nnethercote:fix-EmissionGuarantee, r=compiler-errorsbors-701/+605
Fix `EmissionGuarantee` There are some problems with the `DiagCtxt` API related to `EmissionGuarantee`. This PR fixes them. r? `@compiler-errors`
2023-12-21Auto merge of #119190 - matthiaskrgr:rollup-jvl8vkj, r=matthiaskrgrbors-53/+252
Rollup of 5 pull requests Successful merges: - #118729 (Add release notes for 1.75.0) - #119124 (don't build `rust-analyzer-proc-macro-srv` on def config ) - #119154 (Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders) - #119176 (Fix name error in aarch64_apple_watchos tier 3 target) - #119182 (Update sysinfo version to 0.30.0) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-21Rollup merge of #119182 - GuillaumeGomez:update-sysinfo, r=onur-ozkanMatthias Krüger-7/+7
Update sysinfo version to 0.30.0 Following last `sysinfo` update. Nothing much needs to be changed here apparently. r? `@onur-ozkan`
2023-12-21Rollup merge of #119176 - leohowell:fix-apple-watchos-target-name-error, r=lqdMatthias Krüger-1/+1
Fix name error in aarch64_apple_watchos tier 3 target fix llvm_target wrong name `aarch-apple-watchos` to `aarch64-apple-watchos`, sorry for my mistake. previous pr: https://github.com/rust-lang/rust/pull/119074 r? compiler-team
2023-12-21Rollup merge of #119154 - surechen:fix_119067, r=fmeaseMatthias Krüger-40/+91
Simple modification of `non_lifetime_binders`'s diagnostic information to adapt to type binders fixes #119067 Replace diagnostic information "lifetime bounds cannot be used in this context" to "bounds cannot be used in this context". ```rust #![allow(incomplete_features)] #![feature(non_lifetime_binders)] trait Trait {} trait Trait2 where for <T: Trait> ():{} //~^ ERROR bounds cannot be used in this context ```
2023-12-21Rollup merge of #119124 - onur-ozkan:help-118861, r=Mark-SimulacrumMatthias Krüger-5/+28
don't build `rust-analyzer-proc-macro-srv` on def config Should be very easy to understand when reviewing commit-by-commit. Blocker for #118861
2023-12-21Rollup merge of #118729 - cuviper:relnotes-1.75.0, r=pietroalbiniMatthias Krüger-0/+125
Add release notes for 1.75.0 cc `@rust-lang/release` r? `@Mark-Simulacrum`
2023-12-21add a new change in change-trackeronur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-21apply last suggestions from code reviewPietro Albini-1/+1
2023-12-21Update sysinfo version to 0.30.0Guillaume Gomez-7/+7
2023-12-21Auto merge of #119181 - pietroalbini:pa-1.77, r=pietroalbinibors-1/+1
Bump version number to 1.77.0
2023-12-21bump version number to 1.77.0Pietro Albini-1/+1
2023-12-21Fix name error in aarch64_apple_watchos tier 3 targetLeo Howell-1/+1
2023-12-21Auto merge of #119056 - cjgillot:codegen-overalign, r=wesleywiserbors-1/+37
Tolerate overaligned MIR constants for codegen. Fixes https://github.com/rust-lang/rust/issues/117761 cc `@saethlin`
2023-12-21Simple modification of diagnostic informationsurechen-40/+91
fixes #119067
2023-12-21Encode CoroutineKind directlyMichael Goulet-4/+19
2023-12-21Auto merge of #119170 - matthiaskrgr:rollup-nllgdf2, r=matthiaskrgrbors-45/+182
Rollup of 5 pull requests Successful merges: - #119135 (Fix crash due to `CrateItem::kind()` not handling constructors) - #119141 (Add method to get instance instantiation arguments) - #119145 (Give `VariantData::Struct` named fields, to clairfy `recovered`.) - #119167 (E0761: module directory has .rs suffix) - #119168 (resolve: Stop feeding visibilities for import list stems) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-20Rollup merge of #119168 - petrochenkov:feedvis4, r=compiler-errorsMatthias Krüger-2/+21
resolve: Stop feeding visibilities for import list stems Fixes https://github.com/rust-lang/rust/issues/119126
2023-12-20Rollup merge of #119167 - alef:patch-1, r=compiler-errorsMatthias Krüger-1/+1
E0761: module directory has .rs suffix `rustc --explain E0761` example seems wrong.
2023-12-20Rollup merge of #119145 - aDotInTheVoid:variantdata-struct-struct, ↵Matthias Krüger-40/+51
r=compiler-errors Give `VariantData::Struct` named fields, to clairfy `recovered`. Implements https://github.com/rust-lang/rust/pull/119121#discussion_r1431467066. Supersedes #119121 This way, it's clear what the bool fields means, instead of having to find where it's generated. Changes both ast and hir. r? `@compiler-errors`
2023-12-20Rollup merge of #119141 - celinval:smir-instance-args, r=compiler-errorsMatthias Krüger-0/+15
Add method to get instance instantiation arguments Add a method to get the instance instantiation arguments, and include that information in the instance debug.
2023-12-20Rollup merge of #119135 - celinval:smir-small-changes, r=compiler-errorsMatthias Krüger-2/+94
Fix crash due to `CrateItem::kind()` not handling constructors Also add a method to get the instance instantiation arguments, and include that information in the instance debug.
2023-12-20Add method to get instance instantiation argumentsCelina G. Val-0/+15
2023-12-20Add `ItemKind::Ctor` to stable mirCelina G. Val-11/+22
2023-12-20Add a small test for the case that was crashingCelina G. Val-0/+78
2023-12-20Fix crash for `CrateItem::kind()` with constructorsCelina G. Val-5/+8
Change how we classify item kind for DefKind::Ctor
2023-12-20Refactor AST trait bound modifiersLeón Orell Valerian Liehr-200/+194
2023-12-20Auto merge of #119037 - RalfJung:repr-c-abi-mismatch, r=scottmcmbors-2/+33
do not allow ABI mismatches inside repr(C) types In https://github.com/rust-lang/rust/pull/115476 we allowed ABI mismatches inside `repr(C)` types. This wasn't really discussed much; I added it because from how I understand calling conventions, this should actually be safe in practice. However I entirely forgot to actually allow this in Miri, and in the mean time I have learned that too much ABI compatibility can be a problem for CFI (it can reject fewer calls so that gives an attacker more room to play with). So I propose we take back that part about ABI compatibility in `repr(C)`. It is anyway something that C and C++ do not allow, as far as I understand. In the future we might want to introduce a class of ABI compatibilities where we say "this is a bug and it may lead to aborting the process, but it won't lead to arbitrary misbehavior -- worst case it'll just transmute the arguments from the caller type to the callee type". That would give CFI leeway to reject such calls without introducing the risk of arbitrary UB. (The UB can still happen if the transmute leads to bad results, of course, but it wouldn't be due to ABI weirdness.) #115476 hasn't reached beta yet so if we land this before Dec 22nd we can just pretend this all never happened. ;) Otherwise we should do a beta backport (of the docs change at least). Cc `@rust-lang/opsem` `@rust-lang/types`
2023-12-20resolve: Stop feeding visibilities for import list stemsVadim Petrochenkov-2/+21
2023-12-20E0761: module directory has .rs suffixalef-1/+1
2023-12-20Auto merge of #119166 - GuillaumeGomez:rollup-qfgj76w, r=GuillaumeGomezbors-41/+150
Rollup of 3 pull requests Successful merges: - #119115 (Update documentation for `--env` compilation flag) - #119155 (coverage: Check for `async fn` explicitly, without needing a heuristic) - #119159 (Update LLVM submodule) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-20Rollup merge of #119159 - petrochenkov:llvmup, r=nikicGuillaume Gomez-0/+0
Update LLVM submodule to pick up "[M68k] Fix ODR violation in GISel code (#72797)" https://github.com/rust-lang/llvm-project/pull/159. Fixes https://github.com/rust-lang/rust/issues/107668
2023-12-20Rollup merge of #119155 - Zalathar:async-fn, r=compiler-errorsGuillaume Gomez-40/+130
coverage: Check for `async fn` explicitly, without needing a heuristic The old code used a heuristic to detect async functions and adjust their coverage spans to produce better output. But there's no need to resort to a heuristic when we can just look back at the original definition and check whether the current function is actually an `async fn`. In addition to being generally nicer, this also gets rid of the one piece of code that specifically cares about `CoverageSpan::is_closure` representing an actual closure. All remaining code that inspects that field just uses it as an indication that the span is a hole that should be carved out of other spans, and then discarded. That opens up the possibility of introducing other kinds of “hole” spans, e.g. for nested functions/types/macros, and having them all behave uniformly. --- `@rustbot` label +A-code-coverage
2023-12-20Rollup merge of #119115 - GuillaumeGomez:env-docs, r=NilstriebGuillaume Gomez-1/+20
Update documentation for `--env` compilation flag Part of https://github.com/rust-lang/rust/issues/80792. As mentioned in https://github.com/rust-lang/rust/pull/118830. It adds a mention to `tracked_env::var` and also clarifies what triggers a new compilation. r? `@Nilstrieb`
2023-12-20Add link to explanations about dep-info filesGuillaume Gomez-1/+2
2023-12-20Auto merge of #119136 - petrochenkov:feedvis3, r=WaffleLapkinbors-22/+23
resolve: Eagerly feed closure visibilities Also factor out all tcx-dependent operations performed for every created definition into `TyCtxt::create_def`. Addresses https://github.com/rust-lang/rust/pull/118657#discussion_r1421424277
2023-12-20Update LLVM submoduleVadim Petrochenkov-0/+0
to pick up "[M68k] Fix ODR violation in GISel code (#72797)" https://github.com/rust-lang/llvm-project/pull/159
2023-12-20Auto merge of #119134 - petrochenkov:feedvis2, r=compiler-errorsbors-2/+45
resolve: Feed visibilities for unresolved trait impl items Fixes https://github.com/rust-lang/rust/issues/119073
2023-12-20resolve: Eagerly feed closure visibilitiesVadim Petrochenkov-22/+23
Also factor out all tcx-dependent operations performed for every created definition into `TyCtxt::create_def`
2023-12-20Auto merge of #119156 - matthiaskrgr:rollup-482ow65, r=matthiaskrgrbors-267/+1419
Rollup of 7 pull requests Successful merges: - #118691 (Add check for possible CStr literals in pre-2021) - #118973 (rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work) - #119071 (-Znext-solver: adapt overflow rules to avoid breakage) - #119089 (effects: fix a comment) - #119094 (Add function ABI and type layout to StableMIR) - #119102 (Add arm-none-eabi and armv7r-none-eabi platform-support documentation.) - #119107 (subtype_predicate: remove unnecessary probe) Failed merges: - #119135 (Fix crash due to `CrateItem::kind()` not handling constructors) - #119141 (Add method to get instance instantiation arguments) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-20Rollup merge of #119107 - lcnr:uwuwu, r=compiler-errorsMatthias Krüger-12/+3
subtype_predicate: remove unnecessary probe There is no reason to probe here. The failure either results in an actual type error, in which cases the probe is useless, or it is used inside of evaluate, in which case we're already inside of the `fn evaluation_probe`, so it is also not necessary.
2023-12-20Rollup merge of #119102 - chrisnc:arm-none-eabi-docs, r=wesleywiserMatthias Krüger-106/+176
Add arm-none-eabi and armv7r-none-eabi platform-support documentation. Mostly collecting existing information that's common to all arm-none-eabi targets and putting it in one file and adding a new file with specific details about armv7r.
2023-12-20Rollup merge of #119094 - celinval:smir-layout, r=compiler-errorsMatthias Krüger-25/+796
Add function ABI and type layout to StableMIR This change introduces a new module to StableMIR named `abi` with information from `rustc_target::abi` and `rustc_abi`, that allow users to retrieve more low level information required to perform bit-precise analysis. The layout of a type can be retrieved via `Ty::layout`, and the instance ABI can be retrieved via `Instance::fn_abi()`. To properly handle errors while retrieve layout information, we had to implement a few layout related traits. r? ```@compiler-errors```
2023-12-20Rollup merge of #119089 - fmease:dont-ice-on-tilde-const-non-const-trait, ↵Matthias Krüger-1/+1
r=fee1-dead effects: fix a comment r? fee1-dead or compiler
2023-12-20Rollup merge of #119071 - lcnr:overflowo, r=compiler-errorsMatthias Krüger-104/+269
-Znext-solver: adapt overflow rules to avoid breakage Do not erase overflow constraints if they are from equating the impl header when normalizing[^1]. This should be the minimal change to not break crates depending on the old project behavior of "apply impl constraints while only lazily evaluating any nested goals". Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/70, see https://hackmd.io/ATf4hN0NRY-w2LIVgeFsVg for the reasoning behind this. Only keeping constraints on overflow for `normalize-to` goals as that's the only thing needed for backcompat. It also allows us to not track the origin of root obligations. The issue with root goals would be something like the following: ```rust trait Foo {} trait Bar {} trait FooBar {} impl<T: Foo + Bar> FooBar for T {} // These two should behave the same, rn we can drop constraints for both, // but if we don't drop `Misc` goals we would only drop the constraints for // `FooBar` unless we track origins of root obligations. fn func1<T: Foo + Bar>() {} fn func2<T: FooBaz>() {} ``` [^1]: mostly, the actual rules are slightly different r? ``@compiler-errors``
2023-12-20Rollup merge of #118973 - Enselic:fix-IncorrectCguReuseType, r=michaelwoeristerMatthias Krüger-12/+16
rustc_codegen_ssa: Don't drop `IncorrectCguReuseType` , make `rustc_expected_cgu_reuse` attr work In [100753], `IncorrectCguReuseType` accidentally stopped being emitted by removing `diag.span_err(...)`. Begin emitting it again rather than just blindly dropping it, and adjust tests accordingly. We assume that there are no bugs and that the currently actual CGU reuse is correct. If there are bugs, they will be discovered and fixed eventually, and the tests will then be updated. [100753]: https://github.com/rust-lang/rust/pull/100753/commits/706452eba74026c51e8d0fa30aee2497c69eafc0#diff-048389738ddcbe0f9765291a29db1fed9a5f03693d4781cfb5aaa97ffb3c7f84 Closes #118972
2023-12-20Rollup merge of #118691 - chfogelman:improve-cstr-error, r=fmeaseMatthias Krüger-7/+158
Add check for possible CStr literals in pre-2021 Fixes [#118654](https://github.com/rust-lang/rust/issues/118654) Adds information to errors caused by possible CStr literals in pre-2021. The lexer separates `c"str"` into two tokens if the edition is less than 2021, which later causes an error when parsing. This error now has a more helpful message that directs them to information about editions. However, the user might also have written `c "str"` in a later edition, so to not confuse people who _are_ using a recent edition, I also added a note about whitespace. We could probably figure out exactly which scenario has been encountered by examining spans and editions, but I figured it would be better not to overcomplicate the creation of the error too much. This is my first code PR and I tried to follow existing conventions as much as possible, but I probably missed something, so let me know!