about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2022-11-20Auto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholkbors-6/+7
Check fat pointer metadata compatibility modulo regions Regions don't really mean anything anyways during hir typeck. If this `erase_regions` makes anyone nervous, it's probably equally valid to just equate the types using a type relation, but regardless we should _not_ be using strict type equality while region variables are present. Fixes #103384
2022-11-20Auto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errorsbors-7/+55
Minimal implementation of implicit deref patterns for Strings cc `@compiler-errors` `@BoxyUwU` https://github.com/rust-lang/lang-team/issues/88 #87121 ~~I forgot to add a feature gate, will do so in a minute~~ Done
2022-11-20Auto merge of #104629 - JohnTitor:rollup-vp3m98i, r=JohnTitorbors-10/+7
Rollup of 6 pull requests Successful merges: - #103901 (Add tracking issue for `const_arguments_as_str`) - #104112 (rustdoc: Add copy to the description of repeat) - #104435 (`VecDeque::resize` should re-use the buffer in the passed-in element) - #104467 (Fix substraction with overflow in `wrong_number_of_generic_args.rs`) - #104608 (Cleanup macro matching recovery) - #104626 (Fix doctest errors related to rustc_middle) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-20Rollup merge of #104626 - reez12g:issue-99144-2, r=jyn514Yuki Okushi-3/+5
Fix doctest errors related to rustc_middle Helps with https://github.com/rust-lang/rust/issues/99144
2022-11-20Rollup merge of #104608 - Nilstrieb:fixmed, r=compiler-errorsYuki Okushi-6/+0
Cleanup macro matching recovery The retry has been implemented already in #104335. Also removes a `HACK` comment that's not really needed anymore because the "don't recover during macro matching" isn't really a hack but correct behavior.
2022-11-20Rollup merge of #104467 - ↵Yuki Okushi-1/+2
fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compiler-errors Fix substraction with overflow in `wrong_number_of_generic_args.rs` Fixes #104287 This issue happens in the `suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path` function, which seems to run before the error checking facilities can catch an invalid use of generic arguments. Thus we get a subtraction with overflow because the code implicitly assumes that the source program makes sense (or is this assumption not true even if the program is correct?).
2022-11-20Fix doctest errors related to rustc_middlereez12g-3/+5
2022-11-20Auto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obkbors-1/+3
try_normalize_after_erasing_regions: promote an assertion to always run In https://github.com/rust-lang/miri/issues/2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
2022-11-19Auto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, ↵bors-53/+140
r=oli-obk Constify `is_aligned` via `align_offset` Alternative to https://github.com/rust-lang/rust/pull/102753 Make `align_offset` work in const eval (and not always return `usize::MAX`) and then use that to constify `is_aligned{_to}`. Tracking Issue: https://github.com/rust-lang/rust/issues/104203
2022-11-19Fix substraction with overflow in `wrong_number_of_generic_args.rs`Mahmoud Mazouz-1/+2
Rarranging the substration and equality check into an addition and an equality check is sufficient. Algebra is cool, isn't it? Co-authored-by: Michael Goulet <michael@errs.io>
2022-11-19Cleanup macro matching recoveryNilstrieb-6/+0
The retry has been implemented already.
2022-11-19Revert "don't call `align_offset` during const eval, ever"Lukas Markeffsky-90/+44
This reverts commit f3a577bfae376c0222e934911865ed14cddd1539.
2022-11-19fix const `align_offset` implementationLukas Markeffsky-3/+6
2022-11-19replace potential ICE with graceful error (`no_core` only)Lukas Markeffsky-3/+2
2022-11-19don't call `align_offset` during const eval, everLukas Markeffsky-43/+88
2022-11-19make const `align_offset` usefulLukas Markeffsky-23/+106
2022-11-19unify inherent impls of `CompileTimeEvalContext`Lukas Markeffsky-46/+44
2022-11-19constify `exact_div` intrinsicLukas Markeffsky-0/+5
2022-11-19Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, ↵Matthias Krüger-12/+31
r=fee1-dead Improve spans for RPITIT object-safety errors No reason why we can't point at the `impl Trait` that causes the object-safety violation. Also [drive-by: Add is_async fn to hir::IsAsync](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.
2022-11-19Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-deadMatthias Krüger-7/+24
detect () to avoid redundant <> suggestion for type fix #104379
2022-11-19Rollup merge of #104469 - estebank:long-types, r=oli-obkMatthias Krüger-49/+153
Make "long type" printing type aware and trim types in E0275 Instead of simple string cutting, use a custom printer to hide parts of long printed types. On E0275, check for type length before printing.
2022-11-19Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholkMatthias Krüger-11/+11
Use `IsTerminal` in place of `atty` In any crate that can use nightly features, use `IsTerminal` rather than `atty`: - Use `IsTerminal` in `rustc_errors` - Use `IsTerminal` in `rustc_driver` - Use `IsTerminal` in `rustc_log` - Use `IsTerminal` in `librustdoc`
2022-11-19Auto merge of #103509 - compiler-errors:opaques-w-bound-vars-r-hard, r=oli-obkbors-2/+2
Revert "Normalize opaques with escaping bound vars" This caused a perf regression in #103423, cc `@skyzh` this should fix #103423. reverts #100980 r? `@oli-obk`
2022-11-19Rollup merge of #104580 - notriddle:notriddle/issue-102354-hide-sugg, ↵Dylan DPC-19/+22
r=compiler-errors diagnostics: only show one suggestion for method -> assoc fn Fixes #102354
2022-11-19Rollup merge of #104566 - matthiaskrgr:clippy_perf_nov18, r=oli-obkDylan DPC-12/+10
couple of clippy::perf fixes
2022-11-19Rollup merge of #104554 - BoxyUwU:less_unchecked_pls, r=lcnrDylan DPC-123/+171
Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them
2022-11-19Rollup merge of #104411 - lcnr:bivariance-nll, r=compiler-errorsDylan DPC-85/+104
nll: correctly deal with bivariance fixes #104409 when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions. r? types cc ``@RalfJung``
2022-11-19Rollup merge of #104001 - Ayush1325:custom-entry, r=bjorn3Dylan DPC-36/+161
Improve generating Custom entry function This commit is aimed at making compiler-generated entry functions (Basically just C `main` right now) more generic so other targets can do similar things for custom entry. This was initially implemented as part of https://github.com/rust-lang/rust/pull/100316. Currently, this moves the entry function name and Call convention to the target spec. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-19Improve spans for RPITIT object-safety errorsMichael Goulet-8/+23
2022-11-19Auto merge of #97870 - eggyal:inplace_fold_spec, r=wesleywiserbors-34/+2
Use liballoc's specialised in-place vec collection liballoc already specialises in-place vector collection, so manually reimplementing it in `IdFunctor::try_map_id` was superfluous.
2022-11-19drive-by: Add is_async fn to hir::IsAsyncMichael Goulet-4/+8
2022-11-18Auto merge of #104591 - Manishearth:rollup-b3ser4e, r=Manishearthbors-31/+2514
Rollup of 8 pull requests Successful merges: - #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`) - #103378 (Fix mod_inv termination for the last iteration) - #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS) - #103701 (Simplify some pointer method implementations) - #104047 (Diagnostics `icu4x` based list formatting.) - #104338 (Enforce that `dyn*` coercions are actually pointer-sized) - #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`) - #104556 (rustdoc: use `code-header` class to format enum variants) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-18Rollup merge of #104498 - pierwill:stash-diag-docs, r=compiler-errorsManish Goregaokar-2/+3
Edit docs for `rustc_errors::Handler::stash_diagnostic` Clarify that the diagnostic can be retrieved with `steal_diagnostic`. r? ```@compiler-errors```
2022-11-18Rollup merge of #104338 - compiler-errors:pointer-sized, r=eholkManish Goregaokar-8/+56
Enforce that `dyn*` coercions are actually pointer-sized Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*. This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now. r? ```@eholk``` cc ```@tmandry``` (though feel free to claim/reassign) Fixes #102141 Fixes #102173
2022-11-18Update crate documentation of `rustc_baked_icu_data` crateCharles Lew-21/+20
2022-11-18Fix compilation issue after rebaseCharles Lew-0/+3
2022-11-18Include `zh` locale in icu dataCharles Lew-8/+9
2022-11-18Enable icu sync feature for parallel compilerCharles Lew-1/+10
2022-11-18Import icu locale fallback dataCharles Lew-13/+1108
2022-11-18Migrate diagnostics list output to use icu list formatter.Charles Lew-26/+122
2022-11-18Add `rustc_baked_icu_data` crate.Charles Lew-0/+1231
2022-11-18Auto merge of #104573 - matthiaskrgr:rollup-k36ybtp, r=matthiaskrgrbors-371/+926
Rollup of 8 pull requests Successful merges: - #101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1) - #103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)) - #103405 (Detect incorrect chaining of if and if let conditions and recover) - #103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets) - #104006 (Add variant_name function to `LangItem`) - #104494 (Migrate GUI test to use functions) - #104516 (rustdoc: clean up sidebar width CSS) - #104550 (fix a typo) Failed merges: - #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-18Only enforce ABI-mandated align, not preferred align is compatibleMichael Goulet-1/+1
2022-11-18Check both align and size in PointerSizedMichael Goulet-1/+2
2022-11-18Enforce that dyn* casts are actually pointer-sizedMichael Goulet-8/+55
2022-11-18Revert "Normalize opaques with escaping bound vars"Michael Goulet-2/+2
This reverts commit 43119d643857efc366bfca527ac2dadfc3f2e906.
2022-11-18diagnostics: only show one suggestion for method -> assoc fnMichael Howell-19/+22
Fixes #102354
2022-11-18Auto merge of #101562 - nnethercote:shrink-ast-Expr-harder, r=petrochenkovbors-195/+262
Shrink `ast::Expr` harder r? `@ghost`
2022-11-18review commentEsteban Küber-13/+7
2022-11-18Only use `...` instead of `_` for type elisionEsteban Küber-5/+1
`_` might confuse people into believing that the type isn't known, while `...` is not used anywhere else for types and is not valid syntax, making it more likely to convey the right understanding.