about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2023-03-13Better names?Michael Goulet-1/+1
2023-03-13Treat projections with infer as placeholder during fast reject in new solverMichael Goulet-2/+2
2023-03-13Auto merge of #108471 - clubby789:unbox-the-syntax, r=Nilstrieb,est31bors-199/+91
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-13:arrow_up: rust-analyzerLaurențiu Nicola-3055/+12635
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-12rustdoc: rename `Type::is_same` to `is_doc_subtype_of`Michael Howell-11/+11
2023-03-12Auto merge of #108872 - cjgillot:simp-const-prop, r=oli-obkbors-21/+24
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-12create `config::tests::detect_src_and_out` test for bootstrapozkanonur-2/+33
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-03-12Auto merge of #2811 - saethlin:readme-nextest, r=RalfJungbors-0/+20
Add a section on using nextest Inspired by this question: https://github.com/rust-lang/miri/issues/2805
2023-03-12tweak readmeRalf Jung-3/+3
2023-03-12Add a section on using nextestBen Kimock-0/+20
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 #109031 - thomcc:config-example-toml, r=ozkanonurMatthias Krüger-13/+13
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 #109009 - notriddle:notriddle/edit-distance, r=GuillaumeGomezMatthias Krüger-149/+223
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-12Add rustdoc-gui eslint check into CIGuillaume Gomez-1/+2
2023-03-12Add eslint check for rustdoc-gui testerGuillaume Gomez-8/+104
2023-03-12Remove `box-syntax` from unstable bookclubby789-22/+0
2023-03-12Remove `box_syntax` from AST and use in toolsclubby789-15/+2
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-162/+89
2023-03-12Prevent stable `libtest` from supporting `-Zunstable-options`Thom Chiovoloni-0/+6
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 #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-11rustdoc: collapse edit distance state into an objectMichael Howell-80/+86
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-11Rename `config.toml.example` to `config.example.toml`Thom Chiovoloni-13/+13
2023-03-11Add rustdoc-js eslint check into CIGuillaume Gomez-1/+2
2023-03-11Improve rustdoc-js tester code clarity a bitGuillaume Gomez-7/+9
2023-03-11Add eslint checks for rustdoc-js testerGuillaume Gomez-38/+134
2023-03-11Implement intrinsics for round_ties_evenBen Kimock-0/+35
2023-03-11Use trimmed instead of line for performanceest31-4/+4
2023-03-11Extend the tidy lint to ftl filesest31-1/+6
2023-03-11tidy: enforce comment blocks to have even number of backticksest31-9/+47
Some comments may be formed like: // This function takes a tuple `(Vec<String>, // Box<[u8]>)` and transforms it into `Vec<u8>`. where the "back-ticked" section wraps around. Therefore, we can't make a single-line based lint. We also cannot make the lint paragraph based, as it would otherwise complain about inline code blocks: /// ``` /// use super::Foo; /// /// fn main() { Foo::new(); } /// ``` For the future, one could introduce some checks to treat code blocks specially, but such code would make the check even more complicated.
2023-03-11tidy: allow direct format args capture in macroest31-4/+4
2023-03-11Update host compiler to LLVM 16Nikita Popov-1/+1
This updates the host compiler for dist-x86_64-linux to LLVM 16, pulling in the BOLT fix at https://github.com/llvm/llvm-project/commit/1de305da428598d79b7d2d9e70962130142f7ca4, which is needed to update Rust to LLVM 16.
2023-03-11Rollup merge of #108950 - cjgillot:inherit-less, r=compiler-errorsMatthias Krüger-33/+32
Directly construct Inherited in typeck. Using `InheritedBuilder` + a closure does not seem necessary any more. + a few opportunistic simplifications to typeck entry point.
2023-03-11Rollup merge of #108927 - Ayush1325:pal-cleanup, r=workingjubileeMatthias Krüger-2/+0
Move __thread_local_inner to sys Move `__thread_local_inner` macro in `crate::thread::local` to `crate::sys`. Initially, I was thinking about removing this macro completely, but I could not find a way to create the generic statics without macros, so in the end, I just moved to code around. This probably will need a rebase once https://github.com/rust-lang/rust/pull/108917 is merged r? ``@workingjubilee``
2023-03-11Rollup merge of #108784 - clubby789:askama-sidebar, r=jsha,GuillaumeGomezMatthias Krüger-644/+616
rustdoc: Migrate sidebar rendering to Askama cc #108757 Renders the sidebar for documentation using an Askama template
2023-03-11Rollup merge of #108757 - clubby789:askama-move, r=notriddle,jsha,GuillaumeGomezMatthias Krüger-43/+84
rustdoc: Migrate `document_item_info` to Askama https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/rustdoc.20allocations.20are.20slow Hoping to piece-by-piece migrate things to template. Had a few failed attempts at more complex parts of the code, so this is just a start.
2023-03-11Rollup merge of #107629 - pitaj:rustdoc-search-deprecated, r=jshaMatthias Krüger-9/+50
rustdoc: sort deprecated items lower in search closes #98759 ### Screenshots `i32::MAX` show sup above `std::i32::MAX` and `core::i32::MAX` ![image](https://user-images.githubusercontent.com/803701/216725619-40afb7b0-e984-4a2e-ab5b-a95b24736b0e.png) If just searching for `min`, the deprecated results show up far below other things: ![image](https://user-images.githubusercontent.com/803701/216725672-e4325d37-9bfe-47eb-a1fe-0e57092aa811.png) one page later ![image](https://user-images.githubusercontent.com/803701/216725932-cd1c4a42-d527-44fb-a4ab-5a6d243659cc.png) ~~And, as you can see, the "Deprecation planned" message shows up in the search results. The same is true for fully-deprecated items like `mem::uninitialized`: ![image](https://user-images.githubusercontent.com/803701/216726268-1657e77a-563f-45a0-85a7-3a0cf4d66d6f.png)~~ Edit: the deprecation message change was removed from this PR. Only the sorting is changed.
2023-03-11Auto merge of #109001 - matthiaskrgr:rollup-a3agnwp, r=matthiaskrgrbors-3/+18
Rollup of 8 pull requests Successful merges: - #105798 (Relax ordering rules for `asm!` operands) - #105962 (Stabilize path_as_mut_os_str) - #106085 (use problem matchers for tidy CI) - #107711 (Stabilize movbe target feature) - #108017 (Add `--no-undefined-version` link flag and fix associated breakage) - #108891 (Remove an extraneous include) - #108902 (no more do while :<) - #108912 (Document tool lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-10Merge from rustcBen Kimock-570/+5119
2023-03-10Preparing for merge from rustcBen Kimock-1/+1
2023-03-10rustdoc: use restricted Damerau-Levenshtein distance for searchMichael Howell-147/+215
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.
2023-03-11Auto merge of #104527 - ferrocene:pa-more-licenses, r=pnkfelixbors-113/+127
Add more license annotations This PR updates the `.reuse/dep5` file to include more accurate licensing data for everything in the repository (*excluding* submodules and dependencies). Some decisions were made in this PR: * The standard copyright attribution for files maintained by us is "The Rust Project Developers (see https://thanks.rust-lang.org)", to avoid having to maintain an in-tree `AUTHORS` file. * For files that have specific licensing terms, we added the terms to the `.reuse/dep5` rather than adding SPDX comments in the files themselves. * REUSE picks up any comment/text line with `Copyright` on it, so I had to sprinkle around `REUSE-IgnoreStart` and `REUSE-IgnoreEnd` comments. The rendered `COPYRIGHT` file is available at https://gist.github.com/pietroalbini/efb81103f69596d39758114f3f6a8688. r? `@pnkfelix`
2023-03-10Render doc sidebar using Askamaclubby789-644/+616
2023-03-10Migrate `document_item_info` to templatesclubby789-43/+84
2023-03-10Rollup merge of #106085 - fee1-dead-contrib:tidy-ci-matchers, r=pietroalbiniMatthias Krüger-3/+18
use problem matchers for tidy CI
2023-03-10Auto merge of #108974 - flip1995:clippyup, r=Manishearthbors-775/+2508
Update Clippy r? `@Manishearth` cc `@m-ou-se` This sync also includes https://github.com/rust-lang/rust-clippy/pull/10275
2023-03-10Directly construct Inherited.Camille GILLOT-33/+32
2023-03-10rustdoc: sort deprecated items lower in searchPeter Jaszkowiak-9/+50
serialize `q` (`itemPaths`) sparsely overall 4% reduction in search index size