about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2022-11-11Auto merge of #104293 - Manishearth:rollup-xj92d0k, r=Manishearthbors-117/+430
Rollup of 8 pull requests Successful merges: - #95292 (Allow specialized const trait impls.) - #100386 (Make `Sized` coinductive, again) - #102215 (Implement the `+whole-archive` modifier for `wasm-ld`) - #103468 (Fix unused lint and parser caring about spaces to won't produce invalid code) - #103531 (Suggest calling the instance method of the same name when method not found) - #103960 (piece of diagnostic migrate) - #104051 (update Miri) - #104129 (rustdoc: use javascript to layout notable traits popups) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-11Auto merge of #104289 - Dylan-DPC:rollup-v7wei2t, r=Dylan-DPCbors-38/+90
Rollup of 9 pull requests Successful merges: - #100633 (Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output`) - #103445 (`#[test]`: Point at return type if `Termination` bound is unsatisfied) - #103924 (Fix broken link in description of error code E0706) - #104146 (Retry binding TCP Socket in remote-test-server) - #104169 (Migrate `:target` rules to use CSS variables) - #104202 (Fix ICE #103748) - #104216 (Don't ICE on operator trait methods with generic methods) - #104217 (Display help message when fluent arg was referenced incorrectly) - #104245 (Reduce default configuration's dependency upon static libstdcpp library (#103606)) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-11Rollup merge of #103960 - AndyJado:var_path_only_diag, r=davidtwcoManish Goregaokar-60/+261
piece of diagnostic migrate r? `@davidtwco`
2022-11-11Rollup merge of #103531 - chenyukang:yukang/fix-103474, r=estebankManish Goregaokar-12/+12
Suggest calling the instance method of the same name when method not found Fixes #103474
2022-11-11Rollup merge of #103468 - chenyukang:yukang/fix-103435-extra-parentheses, ↵Manish Goregaokar-20/+52
r=estebank Fix unused lint and parser caring about spaces to won't produce invalid code Fixes #103435
2022-11-11Rollup merge of #102215 - alexcrichton:wasm-link-whole-archive, r=estebankManish Goregaokar-2/+2
Implement the `+whole-archive` modifier for `wasm-ld` This implements the `Linker::{link_whole_staticlib,link_whole_rlib}` methods for the `WasmLd` linker used on wasm targets. Previously these methods were noops since I think historically `wasm-ld` did not have support for `--whole-archive` but nowadays it does, so the flags are passed through.
2022-11-11Rollup merge of #100386 - compiler-errors:sized-coinductive-redux, r=lcnrManish Goregaokar-1/+5
Make `Sized` coinductive, again A revival of #83647 --- What exactly makes co-induction sound? Better question: are there any unsoundness risks from this? `Sized` can't be implemented by custom `impl` blocks, nor can it be conditionally implemented based on anything other than child fields being `Sized`, right? r? `@nikomatsakis` for whenever he gets back from vacation
2022-11-11Rollup merge of #95292 - BGR360:const-trait-specialize, r=lcnrManish Goregaokar-22/+98
Allow specialized const trait impls. Fixes #95186. Fixes #95187. I've done my best to create a comprehensive test suite for the interaction between `min_specialization` and `const_trait_impls`. I wouldn't be surprised if there are interesting cases I haven't tested, please let me know.
2022-11-11Rollup merge of #104217 - Nilstrieb:funny-dollar-syntax, r=TaKO8KiDylan DPC-10/+31
Display help message when fluent arg was referenced incorrectly The fluent argument syntax is a little special and easy to get wrong, so we emit a small help message when someone gets it wrong. Example: ``` parser_mismatched_closing_delimiter = mismatched closing delimiter: `${delimiter}` ``` panics with ``` thread 'rustc' panicked at 'Encountered errors while formatting message for `parser_mismatched_closing_delimiter` help: Argument `delimiter` exists but was not referenced correctly. Try using `{$delimiter}` instead attr: `None` args: `FluentArgs([("delimiter", String("}"))])` errors: `[ResolverError(Reference(Message { id: "delimiter", attribute: None }))]`', compiler/rustc_errors/src/translation.rs:123:21 ``` fixes #103539
2022-11-11Rollup merge of #104216 - Nilstrieb:dont-ice-invalid-operator-traits, r=estebankDylan DPC-1/+19
Don't ICE on operator trait methods with generic methods Emit a fatal error instead. fixes #104213
2022-11-11Rollup merge of #104202 - camsteffen:103748, r=estebankDylan DPC-1/+2
Fix ICE #103748 Fixes #103748
2022-11-11Rollup merge of #103924 - PeteDevoy:patch-1, r=estebankDylan DPC-1/+1
Fix broken link in description of error code E0706 Corresponding subsection in async book is `07.05` not `07.06`. The information on the linked page is the same so it may be reasonable to remove the whole sentence.
2022-11-11Rollup merge of #103445 - fmease:fix-50291, r=estebankDylan DPC-6/+12
`#[test]`: Point at return type if `Termination` bound is unsatisfied Together with #103142 (already merged) this fully fixes #50291. I don't consider my current solution of changing a few spans “here and there” very clean since the failed obligation is a `FunctionArgumentObligation` and we point at a type instead of a function argument. If you agree with me on this point, I can offer to keep the spans of the existing nodes and instead inject `let _: AssertRetTyIsTermination<$ret_ty>;` (type to be defined in `libtest`) similar to `AssertParamIsEq` etc. used by some built-in derive-macros. I haven't tried that approach yet though and cannot promise that it would actually work out or be “cleaner” for that matter. ````@rustbot```` label A-libtest A-diagnostics r? ````@estebank````
2022-11-11Rollup merge of #100633 - estebank:must_use_async_fn_return, r=tmandryDylan DPC-19/+25
Consider `#[must_use]` annotation on `async fn` as also affecting the `Future::Output` No longer lint against `#[must_use] async fn foo()`. When encountering a statement that awaits on a `Future`, check if the `Future`'s parent item is annotated with `#[must_use]` and emit a lint if so. This effectively makes `must_use` an annotation on the `Future::Output` instead of only the `Future` itself. Fix #78149.
2022-11-11Auto merge of #102872 - mikebenfield:better-get-discr, r=nagisabors-49/+145
rustc_codegen_ssa: Better code generation for niche discriminants. In some cases we can avoid arithmetic before checking whether a niche is a tag. Also rename some identifiers around niches. This is relevant to #101872
2022-11-11rustc_codegen_ssa: Better code generation for niche discriminants.Michael Benfield-49/+145
In some cases we can avoid arithmetic before checking whether a niche represents an untagged variant. This is relevant to #101872
2022-11-11Auto merge of #103898 - Nilstrieb:match-macro, r=nnethercotebors-143/+289
Retry failed macro matching for diagnostics When a declarative macro fails to match, retry the matching to collect diagnostic info instead of collecting it on the fly in the hot path. Split out of #103439. You made a bunch of changes to declarative macro matching, so r? `@nnethercote` This change should produce a few small perf wins: https://github.com/rust-lang/rust/pull/103439#issuecomment-1294249602
2022-11-11Auto merge of #99918 - WaffleLapkin:fnFnfun, r=estebankbors-42/+132
Recover wrong-cased keywords that start items (_this pr was inspired by [this tweet](https://twitter.com/Azumanga/status/1552982326409367561)_) r? `@estebank` We've talked a bit about this recovery, but I just wanted to make sure that this is the right approach :) For now I've only added the case insensitive recovery to `use`s, since most other items like `impl` blocks, modules, functions can start with multiple keywords which complicates the matter.
2022-11-10review commentsEsteban Küber-3/+10
2022-11-10Consider `#[must_use]` annotation on `async fn` as also affecting the ↵Esteban Küber-13/+15
`Future::Output` No longer lint against `#[must_use] async fn foo()`. When encountering a statement that awaits on a `Future`, check if the `Future`'s parent item is annotated with `#[must_use]` and emit a lint if so. This effectively makes `must_use` an annotation on the `Future::Output` instead of only the `Future` itself. Fix #78149.
2022-11-10Tweak span for `#[must_use]`Esteban Küber-6/+3
Do not point at whole statement, only at the expression (skip pointing at `;`)
2022-11-10More nitsMichael Goulet-4/+5
2022-11-10make `Sized` coinductivelcnr-1/+4
2022-11-10Auto merge of #104164 - cjgillot:u64-cache, r=compiler-errorsbors-3/+2
Use 64 bits for incremental cache in-file positions We currently use a 32-bit integer to encode byte positions into the incremental cache. This is not enough when the query chache file is >4GB. As the overflow check was a `debug_assert`, it was removed in released compilers, making compilation succeed silently. At the next compilation, cache decoding would try to read unrelated data because of garbled file position, triggering an ICE. Fixes https://github.com/rust-lang/rust/issues/79786 (I'm closing that bug since it the original report and the subsequent questions are probably different instances. A new bug should be opened for new instances of that ICE.)
2022-11-10Apply PR feedback.Ben Reeves-10/+9
2022-11-10Require `~const` qualifier on trait bounds in specializing impls if present ↵Ben Reeves-16/+43
in base impl.
2022-11-10Disallow specializing on const impls with non-const impls.Ben Reeves-4/+31
2022-11-10Allow specialized const trait impls.Ben Reeves-21/+44
Fixes #95186. Fixes #95187.
2022-11-10Rollup merge of #104235 - compiler-errors:more-ct-guar, r=oli-obkManish Goregaokar-15/+51
Use `const_error_with_guaranteed` more Better to pass down an ErrorGuaranteed rather than making a new one out of thin air, for some usages. Also for the ones where we *do* need to delay a bug, that delayed bug will have a more descriptive message.
2022-11-10Rollup merge of #104233 - compiler-errors:issue-104209, r=lcnrManish Goregaokar-1/+1
Don't ICE when encountering `ConstKind::Error` in `RequiredConstsVisitor` Fixes #104209
2022-11-10Rollup merge of #104194 - BoxyUwU:early_binder_docs, r=compiler-errorsManish Goregaokar-0/+3
`EarlyBinder` docs
2022-11-10Rollup merge of #104186 - chenyukang:yukang/fix-104086-let-binding-issue, ↵Manish Goregaokar-18/+17
r=oli-obk Tighten the 'introduce new binding' suggestion Fixes #104086
2022-11-10Rollup merge of #104077 - nicholasbishop:bishop-uefi-aapcs, r=nagisaManish Goregaokar-0/+1
Use aapcs for efiapi calling convention on arm On arm, [llvm treats the C calling convention as `aapcs` on soft-float targets and `aapcs-vfp` on hard-float targets](https://github.com/rust-lang/compiler-builtins/issues/116#issuecomment-261057422). UEFI specifies in the arm calling convention that [floating point extensions aren't used](https://uefi.org/specs/UEFI/2.10/02_Overview.html#detailed-calling-convention), so always translate `efiapi` to `aapcs` on arm. https://github.com/rust-lang/rust/issues/65815
2022-11-10Rollup merge of #104036 - compiler-errors:option-sugg, r=petrochenkovManish Goregaokar-4/+60
Suggest `is_some` when we've found `Option` but expected `bool` Thanks `@lunasorcery` for the suggestion.
2022-11-10Rollup merge of #103863 - compiler-errors:fulfillcx-less, r=wesleywiserManish Goregaokar-10/+12
Use `TraitEngine` in more places, restrict visibility of `FulfillmentCtxt` constructor Most places that are constructing a `FulfillmentContext` should be constructing a `TraitEngine` generically, so later on if/when we're transitioning it'll be easier. Logical extension of #99746
2022-11-10Rollup merge of #101939 - zhaixiaojuan:loongarch64-abi, r=oli-obkManish Goregaokar-0/+344
Add loongarch64 abi support
2022-11-10broken links go brrrrrBoxy-1/+1
2022-11-10Auto merge of #104236 - compiler-errors:rollup-adjshd6, r=compiler-errorsbors-32/+93
Rollup of 9 pull requests Successful merges: - #102763 (Some diagnostic-related nits) - #103443 (Parser: Recover from using colon as path separator in imports) - #103675 (remove redundent "<>" for ty::Slice with reference type) - #104046 (bootstrap: add support for running Miri on a file) - #104115 (Migrate crate-search element to CSS variables) - #104190 (Ignore "Change InferCtxtBuilder from enter to build" in git blame) - #104201 (Add check in GUI test for file loading failure) - #104211 (:arrow_up: rust-analyzer) - #104231 (Update mailmap) Failed merges: - #104169 (Migrate `:target` rules to use CSS variables) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-09Rollup merge of #103675 - lyming2007:issue-103271-fix, r=fee1-deadMichael Goulet-0/+50
remove redundent "<>" for ty::Slice with reference type this fix #103271
2022-11-09Rollup merge of #103443 - mucinoab:recover-colon-as-path-separetor, ↵Michael Goulet-0/+17
r=compiler-errors Parser: Recover from using colon as path separator in imports I don't know if this is the right approach, any feedback is welcome. r? ```@compiler-errors``` Fixes #103269
2022-11-09Rollup merge of #102763 - compiler-errors:nits, r=cjgillotMichael Goulet-32/+26
Some diagnostic-related nits 1. Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` 2. Make `diag.span_suggestions` take an `IntoIterator` instead of `Iterator`, just to remove some `.into_iter` calls on the caller. idk if I should add a lint to make sure people use `&mut Diagnostic` instead of `&mut DiagnosticBuilder<'_, T>` in cases where we're just, e.g., adding subdiagnostics to the diagnostic... maybe a followup.
2022-11-10Use const_error_with_guaranteed moreMichael Goulet-15/+51
2022-11-10Auto merge of #103636 - chenyukang:yukang/fix-103587-sugg-if-let, ↵bors-4/+107
r=jackh276,davidtwco Recover from common if let syntax mistakes/typos Fixes #103587
2022-11-10Don't ICE when encountering ConstKind::Error in RequiredConstsVisitorMichael Goulet-1/+1
2022-11-10Use TraitEngine in more places, make FulfillmentCtxt constructor more privateMichael Goulet-10/+12
2022-11-10Auto merge of #101990 - clubby789:dont-machine-apply-placeholder-method, ↵bors-20/+121
r=compiler-errors Fix auto-application of associated generic functions with placeholders Fixes #101920
2022-11-09remove redundent "<>" for ty::Slice with reference typeYiming Lei-0/+50
this fix #103271
2022-11-09Display help message when fluent arg was referenced incorrectlyNilstrieb-10/+31
The fluent argument syntax is a little special and easy to get wrong, so we emit a small help message when someone gets it wrong. Example: ``` parser_mismatched_closing_delimiter = mismatched closing delimiter: `${delimiter}` ``` panics with ``` thread 'rustc' panicked at 'Encountered errors while formatting message for `parser_mismatched_closing_delimiter` help: Argument `delimiter` exists but was not referenced correctly. Try using `{$delimiter}` instead attr: `None` args: `FluentArgs([("delimiter", String("}"))])` errors: `[ResolverError(Reference(Message { id: "delimiter", attribute: None }))]`', compiler/rustc_errors/src/translation.rs:123:21 ```
2022-11-09Don't ICE on operator trait methods with generic methodsNilstrieb-1/+19
Emit a fatal error instead.
2022-11-09Rollup merge of #104184 - jyn514:rustdoc-version, r=davidtwcoManish Goregaokar-27/+40
Fix `rustdoc --version` when used with download-rustc Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source. Fix it by changing `rustc_driver::version` to a macro expanded at invocation time. cc https://github.com/rust-lang/rust/issues/103206#issuecomment-1284123084