about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-10-05Move DefLocation from rustc_codegen_ssa to rustc_middleTomasz Miąsko-16/+18
2023-10-05Remove small dominators optimization from SsaLocalsTomasz Miąsko-41/+23
The optimization is now part of the general implementation.
2023-10-05Optimize dominators for small path graphsTomasz Miąsko-10/+65
Generalizes the small dominators approach from #107449.
2023-10-05Remove redundant Dominators::start_node fieldTomasz Miąsko-3/+2
2023-10-05Test immediate dominators using public APITomasz Miąsko-24/+21
2023-10-05fix fast-path for try_eval_scalar_intRalf Jung-15/+15
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-05Allow file names to end with '>'Martin Nordholts-1/+0
The `rustc_span::FileName` enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`.
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-05compute NLL loan scopes with liveness in `-Zpolonius=next`Rémy Rakic-28/+339
2023-10-05Do not assert that hidden types don't have erased regions.Camille GILLOT-3/+0
2023-10-05allow access to liveness' `PointIndex`esRémy Rakic-0/+5
2023-10-05add note why a function is pubRémy Rakic-0/+1
2023-10-05Keep fluent slugs in alphabetical orderfrancorbacho-2/+2
2023-10-05Only give autofix suggestion when no named args are presentfrancorbacho-2/+8
2023-10-05Highlight redundant arguments instead of the whole format stringfrancorbacho-5/+4
2023-10-05Plurals in format redundant arguments suggestionfrancorbacho-1/+4
2023-10-05Fix diagnostics being cancelled even with unused argumentsfrancorbacho-11/+17
2023-10-05Remove unused variablefrancorbacho-5/+4
2023-10-05Document report_redundant_format_arguments()francorbacho-0/+2
2023-10-05Rename report_redundant_placeholders() to report_redundant_format_arguments()francorbacho-2/+2
2023-10-05Use diagnostic impls and add suggestions in redundant format!() argsfrancorbacho-25/+65
2023-10-05Separate report_redundant_placeholders() into its own functionfrancorbacho-52/+62
2023-10-05Suggest removing redundant arguments in format!()francorbacho-4/+80
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-05Use a closure when setting `State::Active`.Nicholas Nethercote-6/+1
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-05Use `declared_features` to avoid two lookups.Nicholas Nethercote-4/+2
2023-10-05Add two setter functions to `Features`.Nicholas Nethercote-11/+21
2023-10-05Record all declared features.Nicholas Nethercote-0/+4
Currently `rust_20XX_preview` features aren't recorded as declared even when they are explicit declared. Similarly, redundant edition-dependent features (e.g. `test_2018_feature`) aren't recorded as declared. This commit marks them as recorded. There is no detectable functional change, but it makes things more consistent.
2023-10-05Rename `Resolver::active_features`.Nicholas Nethercote-9/+4
For the reasons described in the previous commit.
2023-10-05Rename `Features::active_features`.Nicholas Nethercote-12/+15
The word "active" is currently used in two different and confusing ways: - `ACTIVE_FEATURES` actually means "available unstable features" - `Features::active_features` actually means "features declared in the crate's code", which can include feature within `ACTIVE_FEATURES` but also others. (This is also distinct from "enabled" features which includes declared features but also some edition-specific features automatically enabled depending on the edition in use.) This commit changes the `Features::active_features` to `Features::declared_features` which actually matches its meaning. Likewise, `Features::active` becomes `Features::declared`.
2023-10-05Overhaul `config::features`.Nicholas Nethercote-57/+46
The new way of doing things: - Avoids some code duplication. - Distinguishes the `crate_edition` (which comes from `--edition`) and the `features_edition` (which combines `--edition` along with any `rustc_20XX_preview` features), which is useful. - Has a simpler initial loop, one that just looks for `rustc_20XX_preview` features in order to compute `features_edition`. - Creates a fallible alternative to `Features::enabled`, which is useful. It's not easy to see how exactly the old and new code are equivalent, but it's reassuring to know that the test coverage is quite good for this stuff.
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-05Merge `STABLE_REMOVED_FEATURES` list into `REMOVED_FEATURES`.Nicholas Nethercote-35/+9
There is a single features (`no_stack_check`) in `STABLE_REMOVED_FEATURES`. But the treatment of `STABLE_REMOVED_FEATURES` and `REMOVED_FEATURES` is actually identical. So this commit just merges them, and uses a comment to record `no_stack_check`'s unique "stable removed" status. This also lets `State::Stabilized` (which was a terrible name) be removed.
2023-10-05Inline and remove `feature_removed` function.Nicholas Nethercote-8/+4
It has a single call site. This increases consistency because other errors within `features` are emitted directly.
2023-10-05Factor out some repeated feature-getting code.Nicholas Nethercote-18/+11