about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2022-11-18diagnostics: only show one suggestion for method -> assoc fnMichael Howell-19/+22
Fixes #102354
2022-11-18Auto merge of #104330 - CastilloDel:ast_lowering, r=cjgillotbors-13/+10
Remove allow(rustc::potential_query_instability) from rustc_ast_lowering Related to https://github.com/rust-lang/rust/issues/84447. `@cjgillot` Thanks for helping me!
2022-11-17Rollup merge of #104545 - flip1995:diag_item_matches_macro, r=compiler-errorsMatthias Krüger-0/+1
Readd the matches_macro diag item This is now used by Clippy r? `@compiler-errors` This was removed in #104383. But in the meantime Clippy now makes use of it https://github.com/rust-lang/rust-clippy/blob/dac600e32fce89cb4b05ae6edb0c47982b99eb48/clippy_lints/src/manual_is_ascii_check.rs#L153 --- This is blocking the Clippy sync. (kinda. I could work around it, but I don't want to play ping-pong with this change.)
2022-11-17Rollup merge of #104515 - chenyukang:yukang/fix-104510-ice, r=compiler-errorsMatthias Krüger-1/+0
ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug Fixes #104510
2022-11-17Rollup merge of #104508 - compiler-errors:dyn-return, r=oli-obkMatthias Krüger-1/+1
Check `dyn*` return type correctly In `check_fn`, if the declared return type is `dyn Trait`, then we check the return type separately to produce better diagnostics, because this is never valid -- however, when `dyn*` was introduced, this check was never adjusted to only account for *unsized* `dyn Trait` and not *sized* `dyn* Trait`. Fixes #104501
2022-11-17Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errorsMatthias Krüger-233/+255
Convert predicates into Predicate in the Obligation constructor instead of having almost all callers do that. This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17Rollup merge of #104444 - chenyukang:yukang/fix-104390, r=compiler-errorsMatthias Krüger-1/+5
Fix ICE in in_operand for ty error Fixes #104390 By the way, moving some test cases to proper directory for tidy bless.
2022-11-17Rollup merge of #104433 - TaKO8Ki:fix-104392, r=estebankMatthias Krüger-9/+7
Fix `emit_unused_delims_expr` ICE Fixes #104392
2022-11-17Rollup merge of #103852 - compiler-errors:rpitit-early-from-impl, r=lcnrMatthias Krüger-1/+7
Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl` long title :sweat: We don't want to remap early-bound regions that originate from the `impl`s themselves, since they have no corresponding region in the trait. Not sure if there's a better condition than checking if the EBR's def-id's parent is the impl -- maybe we should be checking if the region comes from the method or RPITIT... :shrug: r? types Fixes #103850
2022-11-17Readd the matches_macro diag itemPhilipp Krones-0/+1
This is now used by Clippy
2022-11-17Auto merge of #104361 - vladimir-ea:watchos_fix_linking, r=oli-obkbors-0/+4
[watchos] Dynamic linking is not allowed for watchos targets Dynamic linking of all apple targets was (re-) enabled in PR #100636. However, dynamic linking is not allowed on WatchOS so this broke the build of standard library for WatchOS. This change disables dynamic linking for WatchOS non-simulator targets.
2022-11-17Auto merge of #104219 - bryangarza:async-track-caller-dup, r=eholkbors-7/+32
Support `#[track_caller]` on async fns Adds `#[track_caller]` to the generator that is created when we desugar the async fn. Fixes #78840 Open questions: - What is the performance impact of adding `#[track_caller]` to every `GenFuture`'s `poll(...)` function, even if it's unused (i.e., the parent span does not set `#[track_caller]`)? We might need to set it only conditionally, if the indirection causes overhead we don't want.
2022-11-17Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-deadbors-406/+328
Record `LocalDefId` in HIR nodes instead of a side table This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR. This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed. This first part adds the information to HIR nodes themselves instead of a table. The second part is https://github.com/rust-lang/rust/pull/103902 The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter. The fourth part will be to completely remove the side table.
2022-11-17Auto merge of #103138 - nnethercote:merge-BBs, r=bjorn3bors-348/+423
Merge basic blocks where possible when generating LLVM IR. r? `@ghost`
2022-11-16Auto merge of #102944 - nnethercote:ast-Lit-third-time-lucky, r=petrochenkovbors-386/+469
Use `token::Lit` in `ast::ExprKind::Lit`. Instead of `ast::Lit`. Literal lowering now happens at two different times. Expression literals are lowered when HIR is crated. Attribute literals are lowered during parsing. r? `@petrochenkov`
2022-11-16Check `dyn*` return type correctlyMichael Goulet-1/+1
2022-11-16Rollup merge of #104394 - oli-obk:suggest_method_call, r=lcnrMatthias Krüger-123/+126
various cleanups to try to reduce the use of spans inside method resolution definitely review commit by commit.
2022-11-16Rollup merge of #104335 - Nilstrieb:macrowo, r=compiler-errorsMatthias Krüger-10/+29
Only do parser recovery on retried macro matching Eager parser recovery can break macros, so we don't do it at first. But when we already know that the macro failed, we can retry it with recovery enabled to still emit useful diagnostics. Helps with #103534
2022-11-16Rollup merge of #104317 - RalfJung:ctfe-error-reporting, r=oli-obkMatthias Krüger-126/+99
cleanup and dedupe CTFE and Miri error reporting It looks like most of the time, this error raised from const_prop_lint is just redundant -- it duplicates the error reported when evaluating the const-eval query. This lets us make `ConstEvalErr` private to the const_eval module which I think is a good step. The Miri change mostly replaces a `match` by `if let`, and dedupes the "this error is impossible in Miri" checks. r? ``@oli-obk`` Fixes https://github.com/rust-lang/rust/issues/75461
2022-11-16Rollup merge of #104137 - StackDoubleFlow:err-lsc-unsupported, r=bjorn3Matthias Krüger-5/+14
Issue error when -C link-self-contained option is used on unsupported platforms The documentation was also updated to reflect this. I'm assuming the supported platforms are the same as initially written in [RELEASES.md](https://github.com/rust-lang/rust/blob/master/RELEASES.md#compiler-17). Fixes #103576
2022-11-16Rollup merge of #103750 - calebzulawski:master, r=workingjubileeMatthias Krüger-4/+10
Fix some misleading target feature aliases This is the first half of a fix for #100752. It looks like these aliases were added in #78361 and slipped under the radar, as these features are not AVX512. These features _do_ add AVX512 instructions when used _in combination_ with AVX512F, but without AVX512F, these features still provide 128-bit and 256-bit vector instructions. A user might be mislead into thinking these features imply AVX512F (which is true of the actual AVX512 features). This PR allows using the names as defined by LLVM, which matches Intel documentation. A future PR should change the `std::arch` intrinsics to use these names, and finally remove these aliases from rustc. r? ```@workingjubilee``` cc ```@Amanieu```
2022-11-16fix #104510, Remove is_tainted_by_errors since we have ty_error for delay bugyukang-1/+0
2022-11-16fix #104390, fix ICE in in_operand for ty erroryukang-1/+5
2022-11-16Convert predicates into Predicate in the Obligation constructorOli Scherer-226/+248
2022-11-16Generalize the `ToPredicate` traitOli Scherer-9/+9
Its name is now not accurate anymore, but we'll adjust that later
2022-11-16cleanup and dedupe CTFE and Miri error reportingRalf Jung-126/+99
2022-11-16Rollup merge of #104348 - fmease:iat-vis-stab, r=cjgillotMatthias Krüger-37/+46
Respect visibility & stability of inherent associated types As discussed in #103621, this probably won't be the final location of the code that resolves inherent associated types. Still, I think it's valuable to push correctness fixes for this feature (in regards to visibility and stability). Let me know if I should write a translatable diagnostic instead and if I should move the tests to `privacy/` and `stability-attribute/` respectively. Fixes #104243. ````@rustbot```` label A-visibility F-inherent_associated_types r? ````@cjgillot```` (since you reviewed #103621, feel free to reroll though)
2022-11-16Rollup merge of #104193 - TaKO8Ki:fix-104142, r=cjgillotMatthias Krüger-76/+74
Shift no characters when using raw string literals Fixes #104142 Given the following code: ```rust fn main() { println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); } ``` The current output is: ``` error: invalid format string: unmatched `}` found --> src/main.rs:2:59 | 2 | println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found | ^ unmatched `}` in format string | = note: if you intended to print `}`, you can escape it using `}}` error: could not compile `debug_playground` due to previous error ``` The output should look like: ``` error: invalid format string: unmatched `}` found --> src/main.rs:2:45 | 2 | println!(r#"\'\'\'\'\'\'\'\'\'\'\'\'\'\'}"#); //~ ERROR invalid format string: unmatched `}` found | ^ unmatched `}` in format string | = note: if you intended to print `}`, you can escape it using `}}` error: could not compile `debug_playground` due to previous error ``` This pull request fixes the wrong span for `invalid format string` error and also solves the ICE.
2022-11-16Rollup merge of #103484 - saschanaz:patch-2, r=ehussMatthias Krüger-10/+14
Add `rust` to `let_underscore_lock` example Currently https://doc.rust-lang.org/beta/rustc/lints/listing/deny-by-default.html#let-underscore-lock has no colored grammar and raw `{{produces}}` command is exposed.
2022-11-16Merge basic blocks where possible when generating LLVM IR.Nicholas Nethercote-140/+257
In `codegen_assert_terminator` we decide if a BB's successor is a candidate for merging, which requires that it be the only successor, and that it only have one predecessor. That result then gets passed down, and if it reaches `funclet_br` with the appropriate BB characteristics, then no `br` instruction is issued, a `MergingSucc::True` result is passed back, and the merging proceeds in `codegen_block`. The commit also adds `CachedLlbb`, a new type to help keep track of each BB that has been merged into its predecessor.
2022-11-16Use `&mut Bx` more.Nicholas Nethercote-218/+176
For the next commit, `FunctionCx::codegen_*_terminator` need to take a `&mut Bx` instead of consuming a `Bx`. This triggers a cascade of similar changes across multiple functions. The resulting code is more concise and replaces many `&mut bx` expressions with `bx`.
2022-11-15Auto merge of #102570 - cjgillot:deagg-debuginfo, r=oli-obkbors-16/+549
Perform simple scalar replacement of aggregates (SROA) MIR opt This is a re-open of https://github.com/rust-lang/rust/pull/85796 I copied the debuginfo implementation (first commit) from `@eddyb's` own SROA PR. This pass replaces plain field accesses by simple locals when possible. To be eligible, the replaced locals: - must not be enums or unions; - must not be used whole; - must not have their address taken. The storage and deinit statements are duplicated on each created local. cc `@tmiasko` who reviewed the former version of this PR.
2022-11-16Use `token::Lit` in `ast::ExprKind::Lit`.Nicholas Nethercote-386/+469
Instead of `ast::Lit`. Literal lowering now happens at two different times. Expression literals are lowered when HIR is crated. Attribute literals are lowered during parsing. This commit changes the language very slightly. Some programs that used to not compile now will compile. This is because some invalid literals that are removed by `cfg` or attribute macros will no longer trigger errors. See this comment for more details: https://github.com/rust-lang/rust/pull/102944#issuecomment-1277476773
2022-11-15Merge branch 'master' into patch-2Kagami Sascha Rosylight-8678/+15100
2022-11-15Only do parser recovery on retried macro matchingNilstrieb-10/+29
This prevents issues with eager parser recovery during macro matching.
2022-11-15Enable SROA by at mir-opt level 3.Camille GILLOT-1/+1
2022-11-15Flatten aggregates into locals.Camille GILLOT-0/+350
2022-11-15Introduce composite debuginfo.Camille GILLOT-16/+199
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-853/+1024
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-15Update compiler/rustc_ast_lowering/src/item.rsDaniel del Castillo-7/+1
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2022-11-15Change LoweringContext.children to VecCastilloDel-11/+15
2022-11-15Make clobber_abis use an FxIndexMapCastilloDel-2/+2
It seems to be used more for lookup than iteration, so this could be a perf hit
2022-11-15Remove allow(rustc::potential_query_instability) from rustc_ast_loweringCastilloDel-1/+0
2022-11-15Auto merge of #104437 - matthiaskrgr:rollup-n5jdg9v, r=matthiaskrgrbors-180/+264
Rollup of 9 pull requests Successful merges: - #103439 (Show note where the macro failed to match) - #103734 (Adjust stabilization version to 1.65.0 for wasi fds) - #104148 (Visit attributes of trait impl items during AST validation) - #104241 (Move most of unwind's build script to lib.rs) - #104258 (Deduce closure signature from a type alias `impl Trait`'s supertraits) - #104296 (Walk types more carefully in `ProhibitOpaqueTypes` visitor) - #104309 (Slightly improve error message for invalid identifier) - #104316 (Simplify suggestions for errors in generators.) - #104339 (Add `rustc_deny_explicit_impl`) Failed merges: - #103484 (Add `rust` to `let_underscore_lock` example) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-15Compare picks via `Self` type and associated item idOli Scherer-2/+28
2022-11-15Expose the fallibilty of the unstable lint emission in the method nameOli Scherer-4/+9
2022-11-15Pull the unstable name collision hint emission out of method probingOli Scherer-60/+60
2022-11-15Remove the fishy need for a PartialEq implOli Scherer-3/+3
2022-11-15Remove some redundant span argumentsOli Scherer-57/+32
2022-11-15Remove an unnecessary `resolve_vars_if_possible`Oli Scherer-5/+2