about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-05-05 make `compare_generic_param_kinds` errors consistentEllen-48/+94
2022-05-05exit out of `compare_number_of_generics` earlyEllen-31/+18
2022-05-05 handle mismatched generic parameter kindsEllen-0/+104
2022-05-04Auto merge of #96693 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 7 commits in f63f23ff1f1a12ede8585bbd1bbf0c536e50293d..a44758ac805600edbb6ba51e7e6fb81a6077c0cd 2022-04-28 03:15:50 +0000 to 2022-05-04 02:29:34 +0000 - Add support for `-Zbuild-std` to `cargo fetch` (rust-lang/cargo#10129) - Migrate tests of `cargo-init` to snapbox (rust-lang/cargo#10620) - dedupe toml_edit crate, followup rust-lang/cargo#10603 (rust-lang/cargo#10619) - Update GitHub Actions actions/checkout@v2 to v3 (rust-lang/cargo#10618) - Integrate snapbox in with cargo-test-support (rust-lang/cargo#10581) - Fix zsh completion (rust-lang/cargo#10613) - Update documentation for workspace inheritance (rust-lang/cargo#10611)
2022-05-03Update cargoEric Huss-0/+0
2022-05-04Auto merge of #96447 - petrochenkov:docregr, r=GuillaumeGomezbors-1/+57
rustdoc: Resolve doc links on fields during early resolution Another subset of https://github.com/rust-lang/rust/pull/94857 which fixes https://github.com/rust-lang/rust/issues/96429. This case regressed in https://github.com/rust-lang/rust/pull/96135 when `may_have_doc_links`-based filtering was introduced. Before that filtering structs could collect traits in scope for their fields, but after the filtering structs won't collect anything if they don't have doc comments on them, so we have to visit fields too.
2022-05-04Auto merge of #96353 - estebank:issue-95413, r=compiler-errorsbors-0/+114
When suggesting to import an item, also suggest changing the path if appropriate When we don't find an item we search all of them for an appropriate import and suggest `use`ing it. This is sometimes done for expressions that have paths with more than one segment. We now also suggest changing that path to work with the `use`. Fix #95413
2022-05-03Auto merge of #95380 - compiler-errors:unit-destructure-assign, r=nikomatsakisbors-0/+34
Fix unit struct/enum variant in destructuring assignment See https://github.com/rust-lang/rfcs/blob/master/text/2909-destructuring-assignment.md#guide-level-explanation, "including **unit** and tuple structs" Fixes #94319
2022-05-03Auto merge of #96558 - bjorn3:librarify_parse_format, r=davidtwcobors-2/+3
Make rustc_parse_format compile on stable This allows it to be used by lightweight formatting systems and may allow it to be used by rust-analyzer.
2022-05-03Make rustc_parse_format compile on stablebjorn3-2/+3
This allows it to be used by lightweight formatting systems and may allow it to be used by rust-analyzer.
2022-05-03:arrow_up: rust-analyzerLaurențiu Nicola-22/+7
2022-05-03Rollup merge of #96646 - estebank:issue-96638, r=jackh726Yuki Okushi-0/+28
Mitigate impact of subtle invalid call suggestion logic There's some subtle interaction between inferred expressions being passed as an argument to fn calls with fewer than expected arguments. To avoid the ICE, I'm changing indexing operations with `.get(idx)`, but the underlying logic still needs to be audited as it was written with the assumption that `final_arg_types` and `provided_args` have the right length. Address #96638.
2022-05-03Rollup merge of #96629 - ↵Yuki Okushi-12/+34
ken-matsui:fix-invalid-keyword-order-for-function-declarations, r=davidtwco Fix invalid keyword order for function declarations Closes: https://github.com/rust-lang/rust/issues/94879
2022-05-03Rollup merge of #96614 - JohnTitor:test-92305, r=oli-obkYuki Okushi-0/+47
Add a regression test for #92305 Closes #92305 r? ``@oli-obk`` as per https://github.com/rust-lang/rust/issues/92305#issuecomment-1114043188
2022-05-03Rollup merge of #96589 - Badel2:source-callsite, r=michaelwoeristerYuki Okushi-0/+37
Use source callsite in check_argument_types suggestion This makes the "remove extra arguement" suggestion valid when the function argument is a macro. Additionally, this may fix #96225, but the only way I can reproduce that issue is using the playground, so we will need to wait until after this is merged to ensure it's fixed.
2022-05-03Rollup merge of #93097 - GuillaumeGomez:settings-js, r=jshaYuki Okushi-206/+439
Switch settings menu to full js Since the settings can only be set when the JS is enabled, it's not really a problem. It also fixes a debate we had around the themes not being accessible easily before. ![Screenshot from 2022-01-19 23-06-59](https://user-images.githubusercontent.com/3050060/150221936-fd1a1e76-06b6-4416-a653-dbae111979ed.png) You can test it [here](https://rustdoc.crud.net/imperio/settings-js/doc/foo/index.html). r? ``@jsha``
2022-05-03Tweak wordingEsteban Kuber-28/+28
2022-05-03When suggesting to import an item, also suggest changing the path if appropriateEsteban Küber-13/+127
When we don't find an item we search all of them for an appropriate import and suggest `use`ing it. This is sometimes done for expressions that have paths with more than one segment. We now also suggest changing that path to work with the `use`. Fix #95413
2022-05-02Mitigate impact of subtle invalid call suggestion logicEsteban Kuber-0/+28
There's some subtle interaction between inferred expressions being passed as an argument to fn calls with fewer than expected arguments. To avoid the ICE, I'm changing indexing operations with `.get(idx)`, but the underlying logic still needs to be audited as it was written with the assumption that `final_arg_types` and `provided_args` have the right length. Address 96638.
2022-05-02Auto merge of #96436 - petrochenkov:nowhole2, r=wesleywiserbors-2/+2
linker: Stop using whole-archive on dependencies of dylibs https://github.com/rust-lang/rust/pull/95604 implemented a better and more fine-grained way of keeping exported symbols alive. Addresses the second question from https://github.com/rust-lang/rust/pull/93901#issuecomment-1041325522. r? `@wesleywiser`
2022-05-02Auto merge of #96431 - petrochenkov:parent, r=cjgillotbors-33/+27
rustc: Panic by default in `DefIdTree::parent` Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-05-02Auto merge of #96310 - bertptrs:remove-debugger-bootstrap, r=Mark-Simulacrumbors-11/+1
Remove DebbugerScripts from bootstrap CLI This PR implements #95992 and removes the debugger scripts from the bootstrap CLI. I could not find a lot of documentation on the bootstrap binary so perhaps there's still some documentation to be updated.
2022-05-02Fix invalid keyword order for function declarationsKen Matsui-12/+34
2022-05-02Auto merge of #96596 - scottmcm:limited-calloc, r=Mark-Simulacrumbors-0/+32
Tweak the vec-calloc runtime check to only apply to shortish-arrays r? `@Mark-Simulacrum` `@nbdd0121` pointed out in https://github.com/rust-lang/rust/pull/95362#issuecomment-1114085395 that LLVM currently doesn't constant-fold the `IsZero` check for long arrays, so that seems like a reasonable justification for limiting it. It appears that it's based on length, not byte size, (https://godbolt.org/z/4s48Y81dP), so that's what I used in the PR. Maybe it's a ["the number of inlining shall be three"](https://youtu.be/s4wnuiCwTGU?t=320) sort of situation. Certainly there's more that could be done here -- that generated code that checks long arrays byte-by-byte is highly suboptimal, for example -- but this is an easy, low-risk tweak.
2022-05-02Remove DebbugerScripts from bootstrap CLIBert Peters-11/+1
2022-05-02Auto merge of #96600 - c410-f3r:z-errors, r=petrochenkovbors-0/+0
Move some tests to more reasonable places cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov` 16602 -> `codegen` because of https://github.com/rust-lang/rust/issues/16602#issuecomment-53806665
2022-05-01Tweak the calloc optimization to only apply to shortish-arraysScott McMurray-0/+32
2022-05-02Rollup merge of #96610 - GuillaumeGomez:update-browser-ui-test, r=notriddleYuki Okushi-2/+1
Update browser-ui-test version to 0.9.0 It adds the command `screenshot` and disables the screenshot comparison by default. r? `@notriddle`
2022-05-02Rollup merge of #96571 - thomcc:bathroom-stall, r=Mark-SimulacrumYuki Okushi-0/+7
Add a bathroom stall to weird expressions test
2022-05-02Rollup merge of #96499 - jyn514:bootstrap-doctests, r=Mark-SimulacrumYuki Okushi-0/+11
Make it possible to write doctests for bootstrap This probably isn't super useful in practice, but it was easy to fix and avoids confusing errors about mismatched versions between beta and the default toolchain.
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-33/+27
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-05-01Auto merge of #96517 - ferrocene:pa-files-related-to-test, r=Mark-Simulacrumbors-11/+35
[compiletest] Extract code to detect files related to a test into a different function In the code that checks whether a test needs to be re-executed, compiletest checks the modification date of all the files related to the test. I need the list of files related to the test for other purposes inside compiletest, and while I could copy/paste the code `is_up_to_date` runs, that would produce incomplete results if more related files are added in the future. This PR extracts the code to detect related files into a separate function, allowing the rest of compiletest to access the same data. r? `@Mark-Simulacrum`
2022-05-02Add a regression test for #92305Yuki Okushi-0/+47
2022-05-01Auto merge of #96521 - petrochenkov:docrules, r=notriddle,GuillaumeGomezbors-27/+147
rustdoc: Resolve doc links referring to `macro_rules` items cc https://github.com/rust-lang/rust/issues/81633 UPD: the fallback to considering *all* `macro_rules` in the crate for unresolved names is not removed in this PR, it will be removed separately and will be run through crater.
2022-05-01Update browser-ui-test version to 0.9.0Guillaume Gomez-2/+1
2022-05-01* Add documentation for settings page rendering functions.Guillaume Gomez-55/+65
* Improve code. * Fix some documentation argument types. * Make settings order the same as before this PR. * Change timeout to 0 so that browser will render it as fast as possible.
2022-05-01Auto merge of #96549 - ouz-a:mir-opt, r=oli-obkbors-140/+32
Move Derefer before Retag _Follow up work to #96116 #95857 #95649_ This moves `Derefer` before `Retag` and creates a new `LocalInfo` called `Temp` to avoid retagging created temp values. Zulip discussion [link](https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/deref.20as.20first.20and.20only.20projection) r? `@oli-obk`
2022-05-01Auto merge of #96376 - scottmcm:do-yeet, r=oli-obkbors-18/+164
Add `do yeet` expressions to allow experimentation in nightly Two main goals for this: - Ensure that trait restructuring in https://github.com/rust-lang/rust/issues/84277#issuecomment-1066120333 doesn't accidentally close us off from the possibility of doing this in future, as sketched in https://rust-lang.github.io/rfcs/3058-try-trait-v2.html#possibilities-for-yeet - Experiment with the *existence* of syntax for this, to be able to weight the syntax-vs-library tradeoffs better than we can right now. Notably the syntax (with `do`) and name in this PR are not intended as candidates for stabilization, but they make a good v0 PR for adding this with minimal impact to compiler maintenance or priming one possible name choice over another. r? `@oli-obk` The lang `second` for doing this: https://github.com/rust-lang/lang-team/issues/160#issuecomment-1107896716 Tracking issues - Lang, https://github.com/rust-lang/rust/issues/96373 - Libs-api, https://github.com/rust-lang/rust/issues/96374
2022-05-01Move some tests to more reasonable placesCaio-0/+0
2022-05-01Auto merge of #96576 - oli-obk:post_monomorphization_error_backtrace, r=lqdbors-0/+94
Also report the call site of PME errors locally. Note this does not produce a full stack all the way to the first call that specifies all monomorphic parameters, it's just shallowly mentioning the last call site. previous work: https://github.com/rust-lang/rust/pull/85633 tracking issue: https://github.com/rust-lang/rust/issues/85155 r? `@lqd` I figured we could get some improvement for traces in local crates without going into the backtrace hell you landed in last time
2022-05-01Auto merge of #96490 - dtolnay:writetmpbackport, r=Mark-Simulacrumbors-7/+7
Make [e]println macros eagerly drop temporaries (for backport) This PR extracts the subset of #96455 which is only the parts necessary for fixing the 1.61-beta regressions in #96434. My larger PR #96455 contains a few other changes relative to the pre-#94868 behavior; those are not necessary to backport into 1.61. argument position | before #94868 | after #94868 | after this PR --- |:---:|:---:|:---: `write!($tmp, "…", …)` | :rage: | :rage: | :rage: `write!(…, "…", $tmp)` | :rage: | :rage: | :rage: `writeln!($tmp, "…", …)` | :rage: | :rage: | :rage: `writeln!(…, "…", $tmp)` | :rage: | :rage: | :rage: `print!("…", $tmp)` | :rage: | :rage: | :rage: `println!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `eprint!("…", $tmp)` | :rage: | :rage: | :rage: `eprintln!("…", $tmp)` | :smiley_cat: | :rage: | :smiley_cat: `panic!("…", $tmp)` | :smiley_cat: | :smiley_cat: | :smiley_cat:
2022-04-30Revert "Bless coverage-reports after core macro blocks change"David Tolnay-4/+4
This reverts commit ac5c657a0801db84b29ea9b3ae322107756575b0.
2022-04-30Feature-gate `do yeet` inside `cfg`s tooScott McMurray-0/+40
2022-04-30Bless the UI testsScott McMurray-18/+28
2022-04-30Fix the rustfmt buildScott McMurray-0/+5
2022-04-30Fix the clippy buildScott McMurray-0/+1
2022-04-30Add `do yeet` expressions to allow experimentation in nightlyScott McMurray-0/+90
Using an obviously-placeholder syntax. An RFC would still be needed before this could have any chance at stabilization, and it might be removed at any point. But I'd really like to have it in nightly at least to ensure it works well with try_trait_v2, especially as we refactor the traits.
2022-05-01rustdoc: Track `macro_rules` scopes during early doc link resolutionVadim Petrochenkov-1/+86
This way links referring to `macro_rules` items are resolved correctly
2022-04-30Use source callsite in check_argument_types suggestionBadel2-0/+37
This makes the "remove extra arguement" suggestion valid when the function argument is a macro
2022-04-30rustdoc: Keep full `ParentScope` during early doc link resolutionVadim Petrochenkov-19/+30