about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-03-14Don't make projection tys out of anon constsMichael Goulet-21/+10
2023-03-14Assert def-kind is correct for alias typesMichael Goulet-0/+7
2023-03-13Auto merge of #108471 - clubby789:unbox-the-syntax, r=Nilstrieb,est31bors-1054/+979
Remove `box_syntax` r? `@Nilstrieb` This removes the feature `box_syntax`, which allows the use of `box <expr>` to create a Box, and finalises removing use of the feature from the compiler. `box_patterns` (allowing the use of `box <pat>` in a pattern) is unaffected. It also removes `ast::ExprKind::Box` - the only way to create a 'box' expression now is with the rustc-internal `#[rustc_box]` attribute. As a temporary measure to help users move away, `box <expr>` now parses the inner expression, and emits a `MachineApplicable` lint to replace it with `Box::new` Closes #49733
2023-03-13Auto merge of #109011 - jsha:reduce-allocations-inner-full-print, r=notriddlebors-65/+71
rustdoc: reduce allocs in FnDecl::inner_full_print Instead of maintaining parallel buffers for both HTML and non-HTML output, follow the idiom from the rest of format.rs that f.alternate() == true means textual output. Also, add an argument to control line wrapping explicitly. This allows the caller to render once with textual output and no line wrapping, to decide whether line wrapping should be applied in the final HTML output. Also, remove some format! and " ".repeat calls, and remove a dependency on calling `String::replace` to switch from newlines to spaces. This coincidentally fixes some minor bugs where the old code was undercounting the number of characters for a declaration in text mode.
2023-03-12Auto merge of #108872 - cjgillot:simp-const-prop, r=oli-obkbors-330/+249
Strengthen state tracking in const-prop Some/many of the changes are replicated between both the const-prop lint and the const-prop optimization. Behaviour changes: - const-prop opt does not give a span to propagated values. This was useless as that span's primary purpose is to diagnose evaluation failure in codegen. - we remove the `OnlyPropagateInto` mode. It was only used for function arguments, which are better modeled by a write before entry. - the tracking of assignments and discriminants make clearer that we do nothing in `NoPropagation` mode or on indirect places.
2023-03-12Auto merge of #109056 - matthiaskrgr:rollup-9trny1z, r=matthiaskrgrbors-219/+549
Rollup of 8 pull requests Successful merges: - #108651 (Forbid the use of `#[target_feature]` on `main`) - #109009 (rustdoc: use restricted Damerau-Levenshtein distance for search) - #109026 (Introduce `Rc::into_inner`, as a parallel to `Arc::into_inner`) - #109029 (Gate usages of `dyn*` and const closures in macros) - #109031 (Rename `config.toml.example` to `config.example.toml`) - #109032 (Use `TyCtxt::trait_solver_next` in some places) - #109047 (typo) - #109052 (Add eslint check for rustdoc-gui tester) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-12Rollup merge of #109052 - GuillaumeGomez:rustdoc-gui-tester-eslint, r=notriddleMatthias Krüger-9/+106
Add eslint check for rustdoc-gui tester r? `@notriddle`
2023-03-12Rollup merge of #109047 - tshepang:type, r=lcnrMatthias Krüger-1/+1
typo
2023-03-12Rollup merge of #109032 - compiler-errors:shorter, r=BoxyUwUMatthias Krüger-15/+13
Use `TyCtxt::trait_solver_next` in some places Also flip order of if statements to avoid `!`
2023-03-12Rollup merge of #109031 - thomcc:config-example-toml, r=ozkanonurMatthias Krüger-17/+16
Rename `config.toml.example` to `config.example.toml` This had bothered me for a while as it leads to bad (missing) syntax highlighting in most editors I've used, and `@jyn514` suggested I just make the change and that the compatibility concerns I had don't really matter. I suspect it will be a contentious one, so will not be offended if the outcome of this is to close the PR.
2023-03-12Rollup merge of #109029 - compiler-errors:parse-gating, r=jackh726Matthias Krüger-27/+61
Gate usages of `dyn*` and const closures in macros We silently accepted `dyn*` and const closures in macros as long as they didn't expand to anything containing these experimental features, unlike other gated features such as `for<'a>` binders on closures, etc. Let's not do that, to make sure nobody begins relying on this.
2023-03-12Rollup merge of #109026 - joshtriplett:rc-into-inner, r=dtolnayMatthias Krüger-0/+33
Introduce `Rc::into_inner`, as a parallel to `Arc::into_inner` Unlike `Arc`, `Rc` doesn't have the same race condition to avoid, but maintaining an equivalent API still makes it easier to work with both `Rc` and `Arc`.
2023-03-12Rollup merge of #109009 - notriddle:notriddle/edit-distance, r=GuillaumeGomezMatthias Krüger-149/+235
rustdoc: use restricted Damerau-Levenshtein distance for search Based on https://github.com/rust-lang/rust/pull/108200, for the same rationale. > This replaces the existing Levenshtein algorithm with the Damerau-Levenshtein algorithm. This means that "ab" to "ba" is one change (a transposition) instead of two (a deletion and insertion). More specifically, this is a restricted implementation, in that "ca" to "abc" cannot be performed as "ca" → "ac" → "abc", as there is an insertion in the middle of a transposition. I believe that errors like that are sufficiently rare that it's not worth taking into account. Before this change, searching [`prinltn!`] listed `print!` first, followed by `println!`. With this change, `println!` matches more closely. [`prinltn!`]: https://doc.rust-lang.org/nightly/std/?search=prinltn!
2023-03-12Rollup merge of #108651 - LeSeulArtichaut:108645-target-feature-on-main, ↵Matthias Krüger-1/+84
r=Nilstrieb Forbid the use of `#[target_feature]` on `main` Fixes #108645.
2023-03-12Fix formatting of new Rc::into_inner testDavid Tolnay-1/+0
2023-03-12Auto merge of #108845 - Zoxc:par-fix-2, r=cjgillotbors-6/+21
Check that a query has not completed and is not executing before starting it This fixes a race in the query system where we only checked if the query was currently executing, but not if it was already completed, causing queries to re-execute. r? `@cjgillot`
2023-03-12Add rustdoc-gui eslint check into CIGuillaume Gomez-1/+2
2023-03-12Add eslint check for rustdoc-gui testerGuillaume Gomez-8/+104
2023-03-12Auto merge of #108820 - cjgillot:ensure-on-disk, r=oli-obkbors-30/+116
Ensure value is on the on-disk cache before returning from `ensure()`. The current logic for `ensure()` a query just checks that the node is green in the dependency graph. However, a lot of places use `ensure()` to prevent the query from being called later. This is the case before stealing a query result. If the query is actually green but the value is not available in the on-disk cache, `ensure` would return, but a subsequent call to the full query would run the code, and attempt to read from a stolen value. This PR conforms the query system to the usage by checking whether the queried value is loadable from disk before returning. Sadly, I can't manage to craft a proper test... Should fix all instances of "attempted to read from stolen value".
2023-03-12Allow `#[target_feature]` on `main` and `start` for WASMLéo Lanteri Thauvin-2/+14
2023-03-12Forbid the use of `#[target_feature]` on `start`Léo Lanteri Thauvin-0/+39
2023-03-12Forbid the use of `#[target_feature]` on `main`Léo Lanteri Thauvin-1/+33
2023-03-12Add recovery for use of removed `box` syntaxclubby789-10/+105
2023-03-12Remove `box-syntax` from unstable bookclubby789-22/+0
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-95/+40
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-944/+851
2023-03-12typoTshepang Mbambo-1/+1
2023-03-12Auto merge of #109043 - matthiaskrgr:rollup-genkz0e, r=matthiaskrgrbors-87/+914
Rollup of 9 pull requests Successful merges: - #108726 (tidy: enforce comment blocks to have an even number of backticks) - #108797 (Allow binary files to go through the `FileLoader`) - #108841 (Add suggestion to diagnostic when user has array but trait wants slice. (rebased)) - #108984 (bootstrap: document tidy) - #109013 (Give proper error message when tcx wasn't passed to decoder) - #109017 (remove duplicated calls to sort_string) - #109018 (Expand on the allocator comment in `rustc-main`) - #109028 (Add eslint checks for rustdoc-js tester) - #109034 (Commit some tests for the new solver + lazy norm) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-12Rollup merge of #109034 - compiler-errors:lazy-norm-tests, r=jackh726Matthias Krüger-0/+172
Commit some tests for the new solver + lazy norm Also consolidate `typeck/lazy-norm` into `traits/new-solver`, since it's not really useful to maintain a distinction, like when a test really is due to "lazy norm" or "the new solver" (usually both!)
2023-03-12Rollup merge of #109028 - GuillaumeGomez:rustdoc-js-tester-eslint, r=notriddleMatthias Krüger-45/+144
Add eslint checks for rustdoc-js tester r? ``@notriddle``
2023-03-12Rollup merge of #109018 - jyn514:global-allocator-comment, r=lqdMatthias Krüger-0/+9
Expand on the allocator comment in `rustc-main` Before, it said "global_allocator does nothing". Now it gives you suggestions for what to do if you want to change the global allocator (which is likely the main reason you'd be reading the comment). cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/improving.20rustc.20memory.20usage
2023-03-12Rollup merge of #109017 - klensy:dupe, r=cjgillotMatthias Krüger-6/+2
remove duplicated calls to sort_string `with_forced_trimmed_paths!` was removed in https://github.com/rust-lang/rust/commit/62ba3e70a1f01d801d068b84a097e38bd82a8c6e, and this lines became dups.
2023-03-12Rollup merge of #109013 - Nilstrieb:obscurity-is-not-a-necessity, r=fee1-deadMatthias Krüger-5/+18
Give proper error message when tcx wasn't passed to decoder I hit this yesterday and found it very confusing, even though the solution to the problem is very simple.
2023-03-12Rollup merge of #108984 - Teapot4195:issue-106803-fix, r=ozkanonurMatthias Krüger-0/+2
bootstrap: document tidy Enable documentation of tidy, as suggested in #106803. Jyn mentioned they should probably be added to `doc.rust-lang.org`, how should that be done?
2023-03-12Rollup merge of #108841 - jackh726:issue-90528, r=compiler-errorsMatthias Krüger-7/+490
Add suggestion to diagnostic when user has array but trait wants slice. (rebased) Rebase of #91314, except for change to multipart suggestion Resolves #90528 r? ``@compiler-errors`` since you requested the multipart suggestion
2023-03-12Rollup merge of #108797 - thomcc:sourcemap_include_binary_file, ↵Matthias Krüger-3/+8
r=compiler-errors Allow binary files to go through the `FileLoader` I'd like for `include_bytes!` to go through the `FileLoader` in an out-of-tree `rustc_driver` wrapper, and I can't find a reason it's not already done. It seems like most folks providing a custom `FileLoader` would want this too, so I added it. I can solve my problem in other ways if there's a strong reason not to do it, but it seems simple and harmless.
2023-03-12Rollup merge of #108726 - est31:backticks_matchmaking_tidy, r=NilstriebMatthias Krüger-21/+69
tidy: enforce comment blocks to have an even number of backticks After PR #108694, most unmatched backticks in `compiler/` comments have been eliminated. This PR adds a tidy lint to ensure no new unmatched backticks are added, and either addresses the lint in the remaining instances it found, or allows it. Very often, backtick containing sections wrap around lines, for example: ```Rust // This function takes a tuple `(Vec<String>, // Box<[u8]>)` and transforms it into `Vec<u8>`. ``` The lint is implemented to work on top of blocks, counting each line with a `//` into a block, and counting if there are an odd or even number of backticks in the entire block, instead of looking at just a single line.
2023-03-12Auto merge of #108794 - nnethercote:avoid-unnecessary-hashing, r=cjgillotbors-82/+100
Avoid unnecessary hashing I noticed some stable hashing being done in a non-incremental build. It turns out that some of this is necessary to compute the crate hash, but some of it is not. Removing the unnecessary hashing is a perf win. r? `@cjgillot`
2023-03-12Auto merge of #108682 - est31:simplify_dirs, r=davidtwcobors-34/+34
Simplify message paths This makes it easier to open the messages file. Right now I have to first click on the `locales` dir to open it, and then on the `en-US.ftl` file. `Cargo.toml` and `build.rs` files are also in the top level, and I think there should not be more than one file, so a directory isn't really needed. The [chosen strategy for pontoon adoption](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/pontoon.20and.20next.20steps) is out of tree. Even if this descision is changed in the future, the `messages.ftl` approach is also compatible with non-english translations living in-tree, as long as the non-english translations don't live in the `compiler/rustc_foo/` directories but in different ones. That would also be helpful for grepability purposes. The commit was the result of automated changes: ``` for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done ``` r? `@davidtwco`
2023-03-11rustdoc: collapse edit distance state into an objectMichael Howell-80/+86
2023-03-12Auto merge of #108700 - spastorino:new-rpitit-impl-side-2, r=compiler-errorsbors-35/+164
Make RPITITs simple cases work when using lower_impl_trait_in_trait_to_assoc_ty r? `@compiler-errors` It's probably best reviewed commit by commit.
2023-03-11rustdoc: reduce allocs in FnDecl::inner_full_printJacob Hoffman-Andrews-65/+71
Instead of maintaining parallel buffers for both HTML and non-HTML output, follow the idiom from the rest of format.rs that f.alternate() == true means textual output. Also, add an argument to control line wrapping explicitly. This allows the caller to render once with textual output and no line wrapping, to decide whether line wrapping should be applied in the final HTML output. Also, remove some format! and " ".repeat calls, and remove a dependency on calling `String::replace` to switch from newlines to spaces. This coincidentally fixes some minor bugs where the old code was undercounting the number of characters for a declaration in text mode.
2023-03-11Commit some tests for the new solver + lazy normMichael Goulet-0/+172
2023-03-11Use ensure_with_value in a few more places.Camille GILLOT-6/+7
2023-03-11Make the check for cache opt-in.Camille GILLOT-13/+57
2023-03-11Use ensure for thir_abstract_const.Camille GILLOT-5/+2
2023-03-11Ensure value is on the on-disk cache before returning.Camille GILLOT-9/+53
2023-03-11Rename `config.toml.example` to `config.example.toml`Thom Chiovoloni-17/+16
2023-03-11Use TyCtxt::trait_solver_next in some placesMichael Goulet-15/+13
2023-03-11Simplify message pathsest31-34/+34
This makes it easier to open the messages file while developing on features. The commit was the result of automatted changes: for p in compiler/rustc_*; do mv $p/locales/en-US.ftl $p/messages.ftl; rmdir $p/locales; done for p in compiler/rustc_*; do sed -i "s#\.\./locales/en-US.ftl#../messages.ftl#" $p/src/lib.rs; done