about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-05-04Add regression testOli Scherer-0/+26
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-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-9/+85
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-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-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 #96571 - thomcc:bathroom-stall, r=Mark-SimulacrumYuki Okushi-0/+7
Add a bathroom stall to weird expressions test
2022-05-02Add a regression test for #92305Yuki Okushi-0/+47
2022-05-01Auto merge of #96521 - petrochenkov:docrules, r=notriddle,GuillaumeGomezbors-0/+64
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-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/+132
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-30Add `do yeet` expressions to allow experimentation in nightlyScott McMurray-0/+64
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-0/+64
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-30Auto merge of #96347 - estebank:issue-96292, r=compiler-errorsbors-5/+65
Erase type params when suggesting fully qualified path When suggesting the use of a fully qualified path for a method call that is ambiguous because it has multiple candidates, erase type params in the resulting code, as they would result in an error when applied. We replace them with `_` in the output to rely on inference. There might be cases where this still produces slighlty incomplete suggestions, but it otherwise produces many more errors in relatively common cases. Fix #96292
2022-04-30Bless nll tests.Camille GILLOT-28/+45
2022-04-30Save colon span to suggest bounds.Camille GILLOT-5/+5
2022-04-30Bless tests.Camille GILLOT-284/+525
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-0/+36
2022-04-30Extend settings test to ensure settings text is as expectedGuillaume Gomez-0/+29
2022-04-30Add GUI test for settings menuGuillaume Gomez-9/+56
2022-04-30Also report the call site of PME errors locally.Oli Scherer-0/+94
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.
2022-04-30Auto merge of #95776 - cjgillot:ast-lifetimes-static, r=petrochenkovbors-76/+244
Enforce static lifetimes in consts during late resolution This PR moves the handling of implicitly and explicitly static lifetimes in constants from HIR to the AST.
2022-04-29Add a bathroom stall to weird expressions testThom Chiovoloni-0/+7
2022-04-30When encountering a binding that could be a const or unit variant, suggest ↵Esteban Kuber-43/+40
the right path
2022-04-30Bless tests.Camille GILLOT-67/+225
2022-04-29Auto merge of #96566 - Dylan-DPC:rollup-fo7rd98, r=Dylan-DPCbors-1/+42
Rollup of 6 pull requests Successful merges: - #96390 (Switch JS code to ES6 - part 2) - #96527 (RustWrapper: explicitly don't handle DXILPointerTyID) - #96536 (rustdoc: fix missing method list for primitive deref target) - #96559 (Use the correct lifetime binder for elided lifetimes in path.) - #96560 (Remove unnecessary environment variable in cf-protection documentation) - #96562 (Fix duplicate directory separator in --remap-path-prefix.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-29Rollup merge of #96562 - michaelwoerister:path-remapping-fixes, r=oli-obkDylan DPC-1/+1
Fix duplicate directory separator in --remap-path-prefix. The compiler will currently emit duplicate directory separators when `--remap-path-prefix` has an exact match of the working directory and it is invoked with a relative path to the main source file. For example ```bash rustc src/main.rs -Cdebuginfo=2 --remap-path-prefix="$(pwd)=abc" ``` will produce the path `abc//src/main.rs` in debuginfo. This is because `some_path.join("")` will append a directory separator to `some_path` and then LLVM does not check if the working directory already ends a directory separator before concatenating it with the relative path.
2022-04-29Rollup merge of #96559 - cjgillot:elided-path-fn, r=petrochenkovDylan DPC-0/+19
Use the correct lifetime binder for elided lifetimes in path. Fixes https://github.com/rust-lang/rust/issues/96540
2022-04-29Rollup merge of #96536 - rust-lang:notriddle/deref-slice-core, r=GuillaumeGomezDylan DPC-0/+22
rustdoc: fix missing method list for primitive deref target This change makes it so that local impls count when listing primitives that need retained. Fixes #95325
2022-04-29Auto merge of #95819 - oli-obk:mir_can't_hold_all_these_lifetimes, r=estebankbors-54/+130
Enforce Copy bounds for repeat elements while considering lifetimes fixes https://github.com/rust-lang/rust/issues/95477 this is a breaking change in order to fix a soundness bug. Before this PR we only checked whether the repeat element type had an `impl Copy`, but not whether that impl also had the appropriate lifetimes. E.g. if the impl was for `YourType<'static>` and not a general `'a`, then copying any type other than a `'static` one should have been rejected, but wasn't. r? `@lcnr`
2022-04-29Fix duplicate directory separator in --remap-path-prefix.Michael Woerister-1/+1
2022-04-29Use the correct lifetime binder for elided lifetimes in path.Camille GILLOT-0/+19
2022-04-29Bless tests.Camille GILLOT-9/+19
2022-04-29remove and blessouz-a-4/+0