about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-02-06Don't inline query_cache_hit to reduce code size of the query hot path.John Kåre Alsaker-2/+4
2023-02-06Auto merge of #107667 - cjgillot:no-on-hit, r=lcnr,Zoxcbors-127/+68
Remove `OnHit` callback from query caches. This is not useful now that query results are `Copy`.
2023-02-06Auto merge of #107697 - kiranshila:patch-1, r=the8472bors-1/+1
Fix typo in HashMap::with_capacity
2023-02-06Auto merge of #107141 - notriddle:notriddle/max-lev-distance-2023, ↵bors-74/+108
r=GuillaumeGomez rustdoc: compute maximum Levenshtein distance based on the query Preview: https://notriddle.com/notriddle-rustdoc-demos/search-lev-distance-2023/std/index.html?search=regex The heuristic is pretty close to the name resolver, maxLevDistance = `Math.floor(queryLen / 3)`. Fixes #103357 Fixes #82131 Similar to https://github.com/rust-lang/rust/pull/103710, but following the suggestion in https://github.com/rust-lang/rust/pull/103710#issuecomment-1296360267 to use `floor` instead of `ceil`, and unblocked now that https://github.com/rust-lang/rust/pull/105796 made it so that setting the max lev distance to `0` doesn't cause substring matches to be removed.
2023-02-05Auto merge of #107627 - nnethercote:optimize-fold_ty, r=compiler-errorsbors-99/+104
Optimize `fold_ty` Micro-optimizing the heck out of the important `fold_ty` methods. r? `@oli-obk`
2023-02-06Split and inline `TypeFreshener::fold_ty`.Nicholas Nethercote-68/+61
2023-02-06Split and inline `ShallowResolver::fold_ty`.Nicholas Nethercote-24/+33
2023-02-06Inline `OpportunisticVarResolver::fold_ty`.Nicholas Nethercote-0/+1
2023-02-06Improve early bailout test in `resolve_vars_if_possible`.Nicholas Nethercote-2/+2
`!t.has_non_region_infer()` is the test used in `OpportunisticVarResolver`, and catches a few cases that `!t.needs_infer()` misses.
2023-02-06Put a `ShallowResolver` within `OpportunisticVarResolver`.Nicholas Nethercote-5/+7
So one doesn't have to be constructed every time.
2023-02-05Auto merge of #107526 - obeis:for-missing-iterator, r=estebank,compiler-errorsbors-0/+48
Recover form missing expression in `for` loop Close #78537 r? `@estebank`
2023-02-05Fix typo in HashMap::with_capacityKiran Shila-1/+1
2023-02-05Auto merge of #107663 - matthiaskrgr:107423-point-at-EOF-code, r=compiler-errorsbors-0/+43
don't point at nonexisting code beyond EOF when warning about delims Previously we would show this: ``` warning: unnecessary braces around block return value --> /tmp/bad.rs:1:8 | 1 | fn a(){{{ | ^ ^ | = note: `#[warn(unused_braces)]` on by default help: remove these braces | 1 - fn a(){{{ 1 + fn a(){{ | ``` which is now hidden in this case. We would create a span spanning between the pair of redundant {}s but there is only EOF instead of the `}` so we would previously point at nothing. This would cause the debug assertion ice to trigger. I would have loved to just only point at the second delim and say "you can remove that" but I'm not sure how to do that without refactoring the entire diagnostic which seems tricky. :( But given that this does not seem to regress any other tests we have, I think this edge-casey enough be acceptable. Fixes https://github.com/rust-lang/rust/issues/107423 r? `@compiler-errors`
2023-02-05Add ui test for missing expression in for loopObei Sideg-0/+18
2023-02-05Recover from missing expression in for loopObei Sideg-0/+30
2023-02-05Auto merge of #102842 - rol1510:issue-85566-fix, r=notriddlebors-22/+65
rustdoc: change trait bound formatting Fixes #85566 Before <img width="268" alt="image" src="https://user-images.githubusercontent.com/29011024/208326689-cc9b4bae-529c-473c-81e2-fc5ddb738f07.png"> Now <img width="268" alt="image" src="https://user-images.githubusercontent.com/29011024/216216918-d7923787-3e3b-486d-9735-4cecd2988dba.png">
2023-02-05Auto merge of #107679 - est31:less_import_overhead, r=compiler-errorsbors-376/+356
Less import overhead for errors This removes huge (3+ lines) import lists found in files that had their error reporting migrated. These lists are bad for developer workflows as adding, removing, or editing a single error's name might cause a chain reaction that bloats the git diff. As the error struct names are long, the likelihood of such chain reactions is high. Follows the suggestion by `@Nilstrieb` in the [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/massive.20use.20statements) to replace the `use errors::{FooErr, BarErr};` with `use errors;` and then changing to `errors::FooErr` on the usage sites. I have used sed to do most of the changes, i.e. something like: ``` sed -i -E 's/(create_err|create_feature_err|emit_err|create_note|emit_fatal|emit_warning)\(([[:alnum:]]+|[A-Z][[:alnum:]:]*)( \{|\))/\1(errors::\2\3/' path/to/file.rs ``` & then I manually fixed the errors that occured. Most manual changes were required in `compiler/rustc_parse/src/parser/expr.rs`. r? `@compiler-errors`
2023-02-05Auto merge of #107434 - BoxyUwU:nll_const_equate, r=compiler-errorsbors-21/+92
emit `ConstEquate` in `TypeRelating<D>` emitting `ConstEquate` during mir typeck is useful since it can help catch bugs in hir typeck incase our impl of `ConstEquate` is wrong. doing this did actually catch a bug, when relating `Expr::Call` we `==` the types of all the argument consts which spuriously returns false if the type contains const projections/aliases which causes us to fall through to the `expected_found` error arm. Generally its an ICE if the `Const`'s `Ty`s arent equal but `ConstKind::Expr` is kind of special since they are sort of like const items that are `const CALL<F: const Fn(...), const N: F>` though we dont actually explicitly represent the `F` type param explicitly in `Expr::Call` so I just made us relate the `Const`'s ty field to avoid getting ICEs from the tests I added and the following existing test: ```rust // tests/ui/const-generics/generic_const_exprs/different-fn.rs #![feature(generic_const_exprs)] #![allow(incomplete_features)] use std::mem::size_of; use std::marker::PhantomData; struct Foo<T>(PhantomData<T>); fn test<T>() -> [u8; size_of::<T>()] { [0; size_of::<Foo<T>>()] //~^ ERROR unconstrained generic constant //~| ERROR mismatched types } fn main() { test::<u32>(); } ``` which has us relate two `ConstKind::Value` one for the fn item of `size_of::<Foo<T>>` and one for the fn item of `size_of::<T>()`, these only differ by their `Ty` and if we don't relate the `Ty` we'll end up getting an ICE from the checks that ensure the `ty` fields always match. In theory `Expr::UnOp` has the same problem so I added a call to `relate` for the ty's, although I was unable to create a repro test.
2023-02-05emit `ConstEquate` in `TypeRelating<D>`Boxy-21/+92
2023-02-05rustc_session: remove huge error importsest31-29/+23
2023-02-05rustc_parse: remove huge error importsest31-121/+111
2023-02-05rustc_interface: remove huge error importsest31-18/+16
2023-02-05rustc_passes: remove huge error importsest31-56/+57
2023-02-05rustc_const_eval: remove huge error importsest31-37/+35
2023-02-05rustc_metadata: remove huge error importsest31-92/+89
2023-02-05rustc_expand: remove huge error importsest31-23/+25
2023-02-04Auto merge of #107672 - matthiaskrgr:rollup-7e6dbuk, r=matthiaskrgrbors-284/+139
Rollup of 3 pull requests Successful merges: - #107116 (consolidate bootstrap docs) - #107646 (Provide structured suggestion for binding needing type on E0594) - #107661 (Remove Esteban from review queues for a while) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-04Rollup merge of #107661 - oli-obk:breathing_room, r=oli-obkMatthias Krüger-6/+3
Remove Esteban from review queues for a while r? `@estebank`
2023-02-04Rollup merge of #107646 - estebank:specific-span, r=compiler-errorsMatthias Krüger-30/+98
Provide structured suggestion for binding needing type on E0594 Partially address #45405.
2023-02-04Rollup merge of #107116 - ozkanonur:consolidate-bootstrap-docs, r=jyn514Matthias Krüger-248/+38
consolidate bootstrap docs With this diff, I tried to consolidate bootstrap documentations and remove the duplicated informations. Coupled with https://github.com/rust-lang/rustc-dev-guide/pull/1563 Resolves #90686 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-02-04Auto merge of #107549 - Zoxc:rustc-shared, r=jyn514bors-1415/+1437
Move code in `rustc_driver` out to a new `rustc_driver_impl` crate to allow pipelining That adds a `rustc_shared` library which contains all the rustc library crates in a single dylib. It takes over this role from `rustc_driver`. This is done so that `rustc_driver` can be compiled in parallel with other crates. `rustc_shared` is intentionally left empty so it only does linking. An alternative could be to move the code currently in `rustc_driver` into a new crate to avoid changing the name of the distributed library.
2023-02-04rustdoc: trait bound formattingRoland Strasser-22/+65
rustdoc: fix item-spacer rustdoc: use proper comment style rustdoc: change formatting where clauses for traits rustdoc: remove semicolon from provided methods update provided methods formatting
2023-02-04consolidate bootstrap docsozkanonur-248/+38
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-02-04Support parallel compiler.Camille GILLOT-3/+3
2023-02-04Remove `OnHit` callback from query caches.Camille GILLOT-124/+65
This is not useful now that query results are `Copy`.
2023-02-04Auto merge of #107267 - cjgillot:keep-aggregate, r=oli-obkbors-1039/+658
Do not deaggregate MIR This turns out to simplify a lot of things. I haven't checked the consequences for miri yet. cc `@JakobDegen` r? `@oli-obk`
2023-02-04don't point at nonexisting code beyond EOF when warning about unused delimsMatthias Krüger-0/+43
Previously we would show this: ``` warning: unnecessary braces around block return value --> /tmp/bad.rs:1:8 | 1 | fn a(){{{ | ^ ^ | = note: `#[warn(unused_braces)]` on by default help: remove these braces | 1 - fn a(){{{ 1 + fn a(){{ | ``` which is now hidden in this case. We would create a span spanning between the pair of redundant {}s but there is only EOF instead of the `}` so we would previously point at nothing. This would cause the debug assertion ice to trigger. I would have loved to just only point at the second delim and say "you can remove that" but I'm not sure how to do that without refactoring the entire diagnostic which seems tricky. :( But given that this does not seem to regress any other tests we have, I think this edge-casey enough be acceptable. Fixes https://github.com/rust-lang/rust/issues/107423 r? @compiler-errors
2023-02-04Remove Esteban from review queues for a whileOli Scherer-6/+3
2023-02-04Auto merge of #107618 - chriswailes:linker-arg, r=albertlarsan68bors-0/+0
Add a linker argument back to boostrap.py In https://github.com/rust-lang/rust/pull/101783 I accidentally removed a load-bearing linker argument. This PR adds it back in. r? jyn514
2023-02-04Auto merge of #107591 - krasimirgg:llvm-17-pgoopts, r=cuviperbors-8/+30
llvm-wrapper: adapt for LLVM API changes Adapts the wrapper for https://github.com/llvm/llvm-project/commit/516e301752560311d2cd8c2b549493eb0f98d01b, where the constructor of PGOOptions gained a new FileSystem argument. Adapted to use the real file system, similarly to the changes inside of LLVM: https://github.com/llvm/llvm-project/commit/516e301752560311d2cd8c2b549493eb0f98d01b#diff-f409934ba27ad86494f3012324e9a3995b56e0743609ded7a387ba62bbf5edb0R236 Found via our experimental Rust + LLVM at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/16853#01860e2e-5eba-4f07-8359-0325913ff410/219-517
2023-02-03review commentsEsteban Küber-14/+17
2023-02-03Auto merge of #107650 - compiler-errors:rollup-4pntchf, r=compiler-errorsbors-249/+391
Rollup of 8 pull requests Successful merges: - #106887 (Make const/fn return params more suggestable) - #107519 (Add type alias for raw OS errors) - #107551 ( Replace `ConstFnMutClosure` with const closures ) - #107595 (Retry opening proc-macro DLLs a few times on Windows.) - #107615 (Replace nbsp in all rustdoc code blocks) - #107621 (Intern external constraints in new solver) - #107631 (loudly tell people when they change `Cargo.lock`) - #107632 (Clarifying that .map() returns None if None.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-03Rollup merge of #107632 - ameknite:issue-107622-fix, r=jyn514Michael Goulet-2/+4
Clarifying that .map() returns None if None. Fix #107622
2023-02-03Rollup merge of #107631 - BoxyUwU:triagebot_cargo_lock, r=compiler-errorsMichael Goulet-0/+8
loudly tell people when they change `Cargo.lock` It keeps happening that people accidentally commit changes to `Cargo.lock` and then have to be told by a reviewer to undo this. I've also seen cases where PRs are merged that accidentally changed `Cargo.lock` during a rebase.. I figure that purposeful changes to `Cargo.lock` are likely rarer than these accidental ones?
2023-02-03Rollup merge of #107621 - compiler-errors:intern-external-constraints, r=lcnrMichael Goulet-22/+80
Intern external constraints in new solver Makes the query response `Copy`, fixing a few FIXMEs.
2023-02-03Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomezMichael Goulet-17/+19
Replace nbsp in all rustdoc code blocks Based on #106125 by `@dtolnay` — this PR fixes the line wrapping bug. Fixes #106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
2023-02-03Rollup merge of #107595 - michaelwoerister:retry_proc_macro_loading, ↵Michael Goulet-2/+40
r=petrochenkov Retry opening proc-macro DLLs a few times on Windows. On Windows, the compiler [sometimes](https://users.rust-lang.org/t/error-loadlibraryexw-failed/77603) fails with the message `error: LoadLibraryExW failed` when trying to load a proc-macro crate. The error seems to occur intermittently, similar to https://github.com/rust-lang/rust/issues/86929, however, it seems to be almost impossible to reproduce outside of CI environments and thus very hard to debug. The fact that the error only occurs intermittently makes me think that this is a timing related issue. This PR is an attempt to mitigate the issue by letting the compiler retry a few times when encountering this specific error (which resolved the issue described in https://github.com/rust-lang/rust/issues/86929).
2023-02-03Rollup merge of #107551 - fee1-dead-contrib:rm_const_fnmut_helper, r=oli-obkMichael Goulet-129/+51
Replace `ConstFnMutClosure` with const closures Also fixes a parser bug. cc `@oli-obk` for compiler changes
2023-02-03Rollup merge of #107519 - joboet:raw_os_error_ty, r=AmanieuMichael Goulet-10/+26
Add type alias for raw OS errors Implement rust-lang/libs-team#173. `@rustbot` label +S-waiting-on-ACP +T-libs-api
2023-02-03Rollup merge of #106887 - compiler-errors:suggest-types-more, r=oli-obkMichael Goulet-67/+163
Make const/fn return params more suggestable Bumps const item type suggestions to MachineApplicable (fixes #106843), also replaces FnDef with FnPtr items in return type suggestions to make more things suggestable. r? diagnostics