about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-10-06Remove unneeded dependency.Nicholas Nethercote-4/+3
Also sort them.
2023-10-06Factor out `insert_or_error`.Nicholas Nethercote-62/+23
It appears identically as a closure in two functions. Also change its return type from `bool` to `Option<()>` so it can be used with `?`.
2023-10-06Remove unused `FileName::CfgSpec`.Nicholas Nethercote-7/+1
2023-10-06Remove unneeded dependency.Nicholas Nethercote-1/+0
2023-10-05Auto merge of #116417 - ouz-a:trait_type_detective, r=compiler-errorsbors-23/+2
Remove is global hack In attempt to fix https://github.com/rust-lang/rust/issues/114057 we found several issues with how compiler computes layouts, this change removes `is_global` from `and` to stop impl from being shadowed. In depth conversation can be read here https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Getting.20different.20types.20from.20almost.20same.20inputs This is a fix candidate opened for performance run. r? `@lcnr`
2023-10-05remove is global hackOğuz Ağcayazı-23/+2
2023-10-05Rollup merge of #116452 - cjgillot:noassert-erased, r=oli-obkMatthias Krüger-3/+0
Do not assert that hidden types don't have erased regions. cc https://github.com/rust-lang/rust/issues/116306 `args` can have erased regions. In the linked issue, this is reached by computing whether a large type is `Freeze` to compute its ABI. I do not have a minimized test to include.
2023-10-05Rollup merge of #116428 - Alexendoo:note-duplicate-diagnostics, ↵Matthias Krüger-3/+8
r=compiler-errors,estebank Add a note to duplicate diagnostics Helps explain why there may be a difference between manual testing and the test suite output and highlights them as something to potentially look into For existing duplicate diagnostics I just blessed them other than a few files that had other `NOTE` annotations in
2023-10-05Rollup merge of #116415 - ouz-a:move_subtyper, r=oli-obkMatthias Krüger-3/+9
Move subtyper below reveal_all and change reveal_all In previous attempt https://github.com/rust-lang/rust/pull/116378 we tried to handle `Opaque` in few different places, but this isn't necessary, after moving subtyper below reveal_all and calling `super_place` on reveal_all, issues cease to exist. r? ``@oli-obk`` Fixes https://github.com/rust-lang/rust/issues/116332 Fixes https://github.com/rust-lang/rust/issues/116265 Fixes https://github.com/rust-lang/rust/issues/116383 Fixes https://github.com/rust-lang/rust/issues/116333
2023-10-05Rollup merge of #116288 - ouz-a:smir_spans, r=spastorinoMatthias Krüger-62/+137
Add Span to various smir types Had to make few extra changes to few structs to attach spans to them. r? ``@oli-obk``
2023-10-05Rollup merge of #116220 - llogiq:stabilize-option-as-slice, r=BurntSushiMatthias Krüger-1/+0
stabilize `Option::as_`(`mut_`)`slice` This is the stabilization to #108545. Thanks to everyone who helped getting this into Rust proper.
2023-10-05move subtyper change reveal_allouz-a-3/+9
2023-10-05Do not assert that hidden types don't have erased regions.Camille GILLOT-3/+0
2023-10-05Auto merge of #116427 - cjgillot:no-internal, r=oli-obkbors-57/+14
Remove mir::LocalDecl::internal. It does not serve any purpose, as we don't have typeck-based generator witnesses any more.
2023-10-05impl stable for kindsOğuz Ağcayazı-114/+114
2023-10-05add span to statementsouz-a-53/+78
2023-10-05Rollup merge of #116431 - estebank:issue-80476, r=compiler-errorsJubilee-1/+1
Tweak wording of E0562 Fix #80476.
2023-10-05Rollup merge of #116429 - fmease:clean-up-struct-field-suggs, r=compiler-errorsJubilee-102/+58
Diagnostics: Be more careful when suggesting struct fields Consolidate the various places which filter out struct fields that shouldn't be suggested into a single function. Previously, each of those code paths had slightly different and incomplete metrics for no good reason. Now, there's only a single 'complete' metric (namely `is_field_suggestable`) which also filters out hygienic fields that come from different syntax contexts. Fixes #116334.
2023-10-05Rollup merge of #116296 - compiler-errors:default-return, r=estebankJubilee-30/+32
More accurately point to where default return type should go When getting the "default return type" span, instead of pointing to the low span of the next token, point to the high span of the previous token. This: 1. Makes forming return type suggestions more uniform, since we expect them all in the same place. 2. Arguably makes labels easier to understand, since we're pointing to where the implicit `-> ()` would've gone, rather than the starting brace or the semicolon. r? ```@estebank```
2023-10-05Rollup merge of #116223 - catandcoder:master, r=cjgillotJubilee-13/+13
Fix misuses of a vs an Fixes the misuse of "a" vs "an", according to English grammatical expectations and using https://www.a-or-an.com/
2023-10-05Auto merge of #116273 - compiler-errors:refine2, r=tmandrybors-2/+6
Only trigger `refining_impl_trait` lint on reachable traits Public but unreachable traits don't matter 😸 r? `@tmandry`
2023-10-05Auto merge of #116184 - compiler-errors:afit-lint, r=tmandrybors-53/+225
Add `async_fn_in_trait` lint cc https://github.com/rust-lang/rust/pull/115822#issuecomment-1731168465 Mostly unsure what the messaging should be. Feedback required. r? `@tmandry`
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-3/+8
2023-10-04Auto merge of #116370 - nnethercote:more-arena-stuff, r=cjgillotbors-128/+74
Remove the `TypedArena::alloc_from_iter` specialization. It was added in #78569. It's complicated and doesn't actually help performance. r? `@cjgillot`
2023-10-04Apply suggestions from code reviewTyler Mandry-2/+7
Co-authored-by: Travis Cross <tc@traviscross.com>
2023-10-04Point to closure return instead of output if defaultedMichael Goulet-1/+5
2023-10-04Point to where missing return type should goMichael Goulet-29/+27
2023-10-04Auto merge of #114417 - ↵bors-34/+39
chinedufn:fix-expect-unused-in-impl-block-rust-issue-114416, r=cjgillot Fix multiple `expect` attribs in impl block Closes #114416
2023-10-04Tweak wording of E0562Esteban Küber-1/+1
Fix #80476.
2023-10-04clean up struct field suggestionsLeón Orell Valerian Liehr-102/+58
2023-10-04Remove mir::LocalDecl::internal.Camille GILLOT-57/+14
2023-10-04Auto merge of #116413 - nnethercote:rm-E0551, r=compiler-errorsbors-16/+9
Remove E0551 Because it's the same as E0539. Fixes #51489. r? `@Nilstrieb`
2023-10-04Auto merge of #116360 - compiler-errors:async-span, r=oli-obkbors-2/+3
Point to full `async fn` for future Semi-follow-up to https://github.com/rust-lang/rust/pull/116296#discussion_r1342007575 cc `@asquared31415`
2023-10-04Remove E0551.Nicholas Nethercote-11/+4
Because it's the same as E0539. Fixes #51489.
2023-10-04Sort `compiler/rustc_attr/Cargo.toml` dependencies.Nicholas Nethercote-5/+5
It's easier to read in sorted order.
2023-10-04Rollup merge of #116393 - compiler-errors:auto-bad, r=WaffleLapkinMatthias Krüger-1/+7
Emit feature gate *warning* for `auto` traits pre-expansion Auto traits were introduced before we were more careful about not stabilizing new syntax pre-expansion. This is a more conservative step in the general direction we want to go in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Removal.20of.20.60auto.20trait.60.20syntax. Fixes #116121
2023-10-04Fix misuses of a vs ancui fliter-13/+13
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-03Gate against auto traits pre-expansionMichael Goulet-1/+7
2023-10-03Auto merge of #115301 - Zalathar:regions-vec, r=davidtwcobors-198/+190
coverage: Allow each coverage statement to have multiple code regions The original implementation of coverage instrumentation was built around the assumption that a coverage counter/expression would be associated with *up to one* code region. When it was discovered that *multiple* regions would sometimes need to share a counter, a workaround was found: for the remaining regions, the instrumentor would create a fresh expression that adds zero to the existing counter/expression. That got the job done, but resulted in some awkward code, and produces unnecessarily complicated coverage maps in the final binary. --- This PR removes that tension by changing `StatementKind::Coverage`'s code region field from `Option<CodeRegion>` to `Vec<CodeRegion>`. The changes on the codegen side are fairly straightforward. As long as each `CoverageKind::Counter` only injects one `llvm.instrprof.increment`, the rest of coverage codegen is happy to handle multiple regions mapped to the same counter/expression, with only minor option-to-vec adjustments. On the instrumentor/mir-transform side, we can get rid of the code that creates extra (x + 0) expressions. Instead we gather all of the code regions associated with a single BCB, and inject them all into one coverage statement. --- There are several patches here but they can be divided in to three phases: - Preparatory work - Actually switching over to multiple regions per coverage statement - Cleaning up So viewing the patches individually may be easier.
2023-10-03Rollup merge of #116379 - fmease:opaq-hid-inf-bnds-non-lt-bndrs, ↵Matthias Krüger-7/+3
r=compiler-errors non_lifetime_binders: fix ICE in lint opaque-hidden-inferred-bound Opaque types like `impl for<T> Trait<T>` would previously lead to an ICE. r? `@compiler-errors`
2023-10-03Rollup merge of #116328 - nnethercote:rustc_fluent_macro, r=davidtwcoMatthias Krüger-40/+22
Factor out common token generation in `fluent_messages`. The failure and success cases are similar enough that they can share code. r? `@davidtwco`
2023-10-03Rollup merge of #116282 - rustaceanclub:master, r=davidtwcoMatthias Krüger-3/+3
Fix broken links The previous address is no longer available, replace it with the latest available one.
2023-10-03Rollup merge of #116261 - lcnr:wf-only-clause, r=davidtwcoMatthias Krüger-101/+81
a small wf and clause cleanup - remove `Clause::from_projection_clause`, instead use `ToPredicate` - change `predicate_obligations` to directly take a `Clause` - remove some unnecessary `&` - use clause in `min_specialization` checks where easily applicable
2023-10-03Rollup merge of #114654 - estebank:suggest-pin-macro, r=davidtwcoMatthias Krüger-6/+68
Suggest `pin!()` instead of `Pin::new()` when appropriate When encountering a type that needs to be pinned but that is `!Unpin`, suggest using the `pin!()` macro. Fix #57994.
2023-10-03non_lifetime_binders: fix ICE in lint opaque-hidden-inferred-boundLeón Orell Valerian Liehr-7/+3
2023-10-03Auto merge of #116376 - matthiaskrgr:rollup-b3d14gq, r=matthiaskrgrbors-115/+88
Rollup of 5 pull requests Successful merges: - #115863 (Add check_unused_messages in tidy) - #116210 (Ensure that `~const` trait bounds on associated functions are in const traits or impls) - #116358 (Rename both of the `Match` relations) - #116371 (Remove unused features from `rustc_llvm`.) - #116374 (Print normalized ty) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-03Rollup merge of #116374 - ouz-a:correct_message, r=RalfJungMatthias Krüger-20/+30
Print normalized ty Inside `mir_assign_valid_types` we are comparing normalized type of `mir_place` but in debug message we are not printing the normalized value, this changes that.
2023-10-03Rollup merge of #116371 - nnethercote:rustc_llvm, r=bjorn3Matthias Krüger-4/+0
Remove unused features from `rustc_llvm`. r? `@bjorn3`
2023-10-03Rollup merge of #116358 - compiler-errors:match, r=lcnrMatthias Krüger-15/+24
Rename both of the `Match` relations Both of these names kinda were ambiguous. r? lcnr
2023-10-03Rollup merge of #116210 - Raekye:master, r=fee1-deadMatthias Krüger-22/+34
Ensure that `~const` trait bounds on associated functions are in const traits or impls Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/How.20to.2Fshould.20I.20try.20to.20pinpoint.20ICEs.20related.20to.20effects.3F