about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
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 #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-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 #54779Yuki Okushi-0/+62
2022-05-02Add a regression test for #92305Yuki Okushi-0/+47
2022-05-01Enable full revision in const generics ui testsAlex Macleod-71/+291
2022-05-01Auto merge of #96376 - scottmcm:do-yeet, r=oli-obkbors-18/+120
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-2/+2
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-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/+52
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-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-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-0/+19
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 #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-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-29Use the correct lifetime binder for elided lifetimes in path.Camille GILLOT-0/+19
2022-04-29Bless tests.Camille GILLOT-9/+19
2022-04-29Rollup merge of #96516 - oli-obk:impl_trait_inference_accidental_permitted, ↵Dylan DPC-574/+113
r=jackh726 Revert diagnostic duplication and accidental stabilization fixes #96460 this is an accidental stabilization that we should put into the beta. I believe it is low-risk, because it was literally what we had before #94081 The effect on tests is massive, but mostly deduplication of diagnostics and some minor span changes.
2022-04-29Auto merge of #96444 - nbdd0121:used2, r=petrochenkovbors-0/+13
Use decorated names for linked_symbols on Windows Fix #96423 r? `@petrochenkov`
2022-04-28Update ui testsSerial-40/+0
2022-04-28Rollup merge of #96433 - petrochenkov:delim, r=nnethercoteDylan DPC-1/+1
rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter` Compiler cannot reuse `proc_macro::Delimiter` directly due to extra impls, but can at least use the same naming. After this PR the only difference between these two enums is that `proc_macro::Delimiter::None` is turned into `token::Delimiter::Invisible`. It's my mistake that the invisible delimiter is called `None` on stable, during the stabilization I audited the naming and wrote the docs, but missed the fact that the `None` naming gives a wrong and confusing impression about what this thing is. cc https://github.com/rust-lang/rust/pull/96421 r? ``@nnethercote``
2022-04-28Rollup merge of #96409 - ↵Dylan DPC-0/+220
marmeladema:fix-nll-introduce-named-lifetime-suggestion, r=jackh726 Recover suggestions to introduce named lifetime under NLL Fixes #96157 r? ```@jackh726``` Built on top of #96385 so only the second commit is relevant
2022-04-28Rollup merge of #95312 - marmeladema:tests-for-issue-95305, r=jackh726Dylan DPC-0/+42
Ensure that `'_` and GAT yields errors Fixes #95305 ```@bors``` r? ```@jackh726```
2022-04-28Revert diagnostic duplication and accidental stabilizationOli Scherer-574/+113
2022-04-28Update the diagnostic message to match the new spanOli Scherer-12/+12
2022-04-28Add new repeat expr test.Oli Scherer-0/+16
Also add repeat expr test folder and move all related tests to it
2022-04-28Check that repeat expression elements are Copy (ignoring lifetimes) in ↵Oli Scherer-42/+102
typeck and that they are Copy (with proper lifetime checks) in borrowck
2022-04-28rustc_ast: Harmonize delimiter naming with `proc_macro::Delimiter`Vadim Petrochenkov-1/+1
2022-04-28Auto merge of #96085 - jsgf:deny-unused-deps, r=compiler-errorsbors-0/+67
Make sure `-Dunused-crate-dependencies --json unused-externs` makes rustc exit with error status This PR: - fixes compiletest to understand unused extern notifications - adds tests for `--json unused-externs` - makes sure that deny-level unused externs notifications are treated as compile errors - refactors the `emit_unused_externs` callstack to plumb through the level as an enum as a string, and adds `Level::is_error` Update: adds `--json unused-externs-silent` with the original behaviour since Cargo needs it. Should address `@est31's` concerns. Fixes: https://github.com/rust-lang/rust/issues/96068
2022-04-28Auto merge of #96495 - Dylan-DPC:rollup-9lm4tpp, r=Dylan-DPCbors-2/+25
Rollup of 7 pull requests Successful merges: - #96377 (make `fn() -> _ { .. }` suggestion MachineApplicable) - #96397 (Make EncodeWide implement FusedIterator) - #96421 (Less `NoDelim`) - #96432 (not need `Option` for `dbg_scope`) - #96466 (Better error messages when collecting into `[T; n]`) - #96471 (replace let else with `?`) - #96483 (Add missing `target_feature` to the list of well known cfg names) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-28Rollup merge of #96466 - compiler-errors:error-collect-array, r=davidtwcoDylan DPC-2/+25
Better error messages when collecting into `[T; n]` Fixes #96461
2022-04-27Auto merge of #91557 - cjgillot:ast-lifetimes-named, r=petrochenkovbors-4/+17
Perform lifetime resolution on the AST for lowering Lifetime resolution is currently implemented several times. Once during lowering in order to introduce in-band lifetimes, and once in the resolve_lifetimes query. However, due to the global nature of lifetime resolution and how it interferes with hygiene, it is better suited on the AST. This PR implements a first draft of lifetime resolution on the AST. For now, we specifically target named lifetimes and everything we need to remove lifetime resolution from lowering. Some diagnostics have already been ported, and sometimes made more precise using available hygiene information. Follow-up PRs will address in particular the resolution of anonymous lifetimes on the AST. We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes. r? `@petrochenkov`
2022-04-28Ensure that `'_` and GAT yields errorsmarmeladema-0/+42
2022-04-27Recover suggestions to introduce named lifetime under NLLmarmeladema-0/+220
2022-04-27Make [e]println macros eagerly drop temporaries (for backport)David Tolnay-2/+2
2022-04-27Bless tests.Camille GILLOT-4/+17