about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-12-04Don't ICE in ExprUseVisitor on FRU for non-existent structMichael Goulet-0/+21
2022-12-04Auto merge of #105261 - matthiaskrgr:rollup-9ghhc9c, r=matthiaskrgrbors-109/+270
Rollup of 6 pull requests Successful merges: - #101975 (Suggest to use . instead of :: when accessing a method of an object) - #105141 (Fix ICE on invalid variable declarations in macro calls) - #105224 (Properly substitute inherent associated types.) - #105236 (Add regression test for #47814) - #105247 (Use parent function WfCheckingContext to check RPITIT.) - #105253 (Update a couple of rustbuild deps) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-04Rollup merge of #105247 - cjgillot:issue-102682, r=compiler-errorsMatthias Krüger-58/+47
Use parent function WfCheckingContext to check RPITIT. WF-check for RPITIT was done in the opaque type's param-env, so it could not benefit from assumed wf types from the function's parameters. cc `@compiler-errors` since you chose that param-env in fd2766e7fde4 Fixes https://github.com/rust-lang/rust/issues/102682 Fixes https://github.com/rust-lang/rust/issues/104908 Fixes https://github.com/rust-lang/rust/issues/102552 Fixes https://github.com/rust-lang/rust/issues/104529
2022-12-04Rollup merge of #105236 - JohnTitor:issue-47814, r=compiler-errorsMatthias Krüger-0/+28
Add regression test for #47814 Closes #47814 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Rollup merge of #105224 - cjgillot:issue-104240, r=compiler-errorsMatthias Krüger-0/+15
Properly substitute inherent associated types. Fixes https://github.com/rust-lang/rust/issues/104240
2022-12-04Rollup merge of #105141 - ohno418:fix-ice-on-invalid-var-decl-in-macro-call, ↵Matthias Krüger-0/+52
r=compiler-errors Fix ICE on invalid variable declarations in macro calls This fixes ICE that happens with invalid variable declarations in macro calls like: ```rust macro_rules! m { ($s:stmt) => {} } m! { var x } m! { auto x } m! { mut x } ``` Found this is because of not collecting tokens on recovery, so I changed to force collect them. Fixes https://github.com/rust-lang/rust/issues/103529.
2022-12-04Rollup merge of #101975 - chenyukang:fix-101749, r=compiler-errorsMatthias Krüger-51/+128
Suggest to use . instead of :: when accessing a method of an object Fixes #101749 Fixes #101542
2022-12-04Make nested RPITIT inherit the parent opaque's generics.Camille GILLOT-0/+17
2022-12-04Auto merge of #103293 - est31:untwist_and_drop_order, r=nagisabors-7/+127
Remove drop order twist of && and || and make them associative Previously a short circuiting binop chain (chain of && or ||s) would drop the temporaries created by the first element after all the other elements, and otherwise follow evaluation order. So `f(1).g() && f(2).g() && f(3).g() && f(4).g()` would drop the temporaries in the order `2,3,4,1`. This made `&&` and `||` non-associative regarding drop order. In other words, adding ()'s to the expression would change drop order: `f(1).g() && (f(2).g() && f(3).g()) && f(4).g()` for example would drop in the order `3,2,4,1`. As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's. This commit addresses this "twist". We now also put the lhs into a terminating scope. The drop order of the above expressions becomes `1,2,3,4`. There might be code relying on the current order, and therefore I'd recommend doing a crater run to gauge the impact. I'd argue that such code is already quite wonky as it is one `foo() &&` addition away from breaking. ~~For the impact, I don't expect any *build* failures, as the compiler gets strictly more tolerant: shortening the lifetime of temporaries only expands the list of programs the compiler accepts as valid. There might be *runtime* failures caused by this change however.~~ Edit: both build and runtime failures are possible, e.g. see the example provided by dtolnay [below](https://github.com/rust-lang/rust/pull/103293#issuecomment-1285341113). Edit2: the crater run has finished and [results](https://github.com/rust-lang/rust/pull/103293#issuecomment-1292275203) are that there is only one build failure which is easy to fix with a +/- 1 line diff. I've included a testcase that now compiles thanks to this patch. The breakage is also limited to drop order relative to conditionals in the && chain: that is, in code like this: ```Rust let hello = foo().hi() && bar().world(); println!("hi"); ``` we already drop the temporaries of `foo().hi()` before we reach "hi". I'd ideally have this PR merged before let chains are stabilized. If this PR is taking too long, I'd love to have a more restricted version of this change limited to `&&`'s in let chains: the `&&`'s of such chains are quite special anyways as they accept `let` bindings, in there the `&&` is therefore more a part of the "if let chain" construct than a construct of its own. Fixes #103107 Status: waiting on [this accepted FCP](https://github.com/rust-lang/rust/pull/103293#issuecomment-1293411354) finishing.
2022-12-04Recurse into nested impl-trait when computing variance.Camille GILLOT-0/+28
2022-12-04Rollup merge of #105237 - JohnTitor:issue-79450, r=oli-obkMatthias Krüger-0/+32
Add regression test for #79450 Closes #79450 r? `@oli-obk` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Rollup merge of #105142 - nbdd0121:inline_const, r=petrochenkovMatthias Krüger-0/+25
Make inline const block `ExprWithBlock` Fix https://github.com/rust-lang/rust/pull/104087#issuecomment-1324190817 `@rustbot` label: +T-lang +F-inline_const
2022-12-04Rollup merge of #104856 - luqmana:associated-const-bad-suggestion, ↵Matthias Krüger-7/+1
r=compiler-errors Don't suggest associated function call for associated const. Fixes #104801. r? `@compiler-errors`
2022-12-04Use parent function WfCheckingContext to check RPITIT.Camille GILLOT-58/+47
2022-12-04Also avoid creating a terminating scope in mixed chainsest31-0/+19
This avoids creation of a terminating scope in chains that contain both && and ||, because also there we know that a terminating scope is not neccessary: all the chain members are already in such terminating scopes. Also add a mixed && / || test.
2022-12-04Add regression test for #79450Yuki Okushi-0/+32
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Add regression test for #47814Yuki Okushi-0/+28
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-03Skip recording resolution for duplicated generic params.Camille GILLOT-2/+17
2022-12-03Remove drop order twist of && and || and make them associativeest31-7/+108
Previously a short circuiting && chain would drop the first element after all the other elements, and otherwise follow evaluation order, so code like: f(1).g() && f(2).g() && f(3).g() && f(4).g() would drop the temporaries in the order 2,3,4,1. This made && and || non-associative regarding drop order, so adding ()'s to the expression would change drop order: f(1).g() && (f(2).g() && f(3).g()) && f(4).g() for example would drop in the order 3,2,4,1. As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's. This commit addresses this "twist". In the expression, we now also put the lhs into a terminating scope. The drop order for the above expressions is 1,2,3,4 now.
2022-12-03Properly substitute inherent associated types.Camille GILLOT-0/+15
2022-12-03suggest parenthesis around ExprWithBlock BinOp ExprWithBlockLukas Markeffsky-1/+66
2022-12-03Rollup merge of #105208 - chenyukang:yukang/fix-105069, r=cjgillotMatthias Krüger-0/+32
Add AmbiguityError for inconsistent resolution for an import Fixes #105069 Fixes #83950
2022-12-03Rollup merge of #105201 - cjgillot:issue-105040, r=compiler-errorsMatthias Krüger-0/+32
Do not call fn_sig on non-functions. Fixes https://github.com/rust-lang/rust/issues/105040 Fixes https://github.com/rust-lang/rust/issues/89271
2022-12-03Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errorsMatthias Krüger-0/+22
Remove useless filter in unused extern crate check. Fixes https://github.com/rust-lang/rust/issues/104562
2022-12-03Rollup merge of #105164 - compiler-errors:revert-import-filter, r=estebankMatthias Krüger-6/+15
Restore `use` suggestion for `dyn` method call requiring `Sized` Add the suggestion back that I accidentally removed in 88f2140d8736329610a4c0bd8000e164c9170537 because I didn't understand that suggestion was actually useful... Fixes #105159
2022-12-03fix #101749, use . instead of :: when accessing a method of an objectyukang-51/+128
2022-12-03fix #105069, Add AmbiguityError for inconsistent resolution for an importyukang-0/+32
2022-12-03parser: fix ICE with invalid variable declaration in macro callYutaro Ohno-0/+52
Fix ICE on parsing an invalid variable declaration as a statement like: ``` macro_rules! m { ($s:stmt) => {} } m! { var x } ```
2022-12-03Do not call fn_sig on non-functions.Camille GILLOT-0/+32
2022-12-03Remove useless filter in unused extern crate check.Camille GILLOT-0/+22
2022-12-03Rollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8KiYuki Okushi-0/+34
Don't elide type information when printing E0308 with `-Zverbose` When we pass `-Zverbose`, we kinda expect for all `_` to be replaced with more descriptive information, for example -- ``` = note: expected fn pointer `fn(_, u32)` found fn item `fn(_, i32) {foo}` ``` Where `_` is the "identical" part of the fn signatures, now gets rendered as: ``` = note: expected fn pointer `fn(i32, u32)` found fn item `fn(i32, i32) {foo}` ```
2022-12-03Rollup merge of #105181 - bhbs:skip-note, r=estebankYuki Okushi-0/+44
Don't add a note for implementing a trait if its inner type is erroneous Fix #105138
2022-12-03Don't add a note for implementing a trait if its inner type is erroneousbhbs-0/+44
2022-12-02Don't elide information when printing E0308 with ZverboseMichael Goulet-0/+34
2022-12-02Rollup merge of #105163 - compiler-errors:afit-lt-arity, r=jackh726Matthias Krüger-0/+41
Check lifetime param count in `collect_trait_impl_trait_tys` We checked the type and const generics count, but not the lifetimes, which were handled in a different function. Fixes #105154
2022-12-02Rollup merge of #105162 - compiler-errors:fn-sig-arity, r=cjgillotMatthias Krüger-0/+17
Properly synthesize `FnSig` value during cycle Get the arity correct when creating a `FnSig` type during `tcx.fn_sig` cycle recovery Fixes #105152
2022-12-02Fix async track caller for assoc fn and trait impl fnGary Guo-0/+14
2022-12-02Use proper HirId for async track_caller attribute checkGary Guo-0/+11
2022-12-02Auto merge of #104863 - nnethercote:reduce-lint-macros, r=cjgillotbors-70/+8
Reduce macro usage for lints r? `@cjgillot`
2022-12-02return when expr has errorTakayuki Maeda-0/+49
fmt add a comment
2022-12-02Rollup merge of #104614 - Nilstrieb:type-ascribe!, r=TaKO8KiMatthias Krüger-224/+198
Add `type_ascribe!` macro as placeholder syntax for type ascription This makes it still possible to test the internal semantics of type ascription even once the `:`-syntax is removed from the parser. The macro now gets used in a bunch of UI tests that test the semantics and not syntax of type ascription. I might have forgotten a few tests but this should hopefully be most of them. The remaining ones will certainly be found once type ascription is removed from the parser altogether. Part of #101728
2022-12-01While parsing enum variant, the error message always disappearYiming Lei-0/+31
Because the error message that emit out is from main error of parser The information of enum variant disappears while parsing enum variant with error We only check the syntax of expecting token, i.e, in case #103869 It will error it without telling the message that this error is from pasring enum variant. Propagate the sub-error from parsing enum variant to the main error of parser by chaining it with map_err Check the sub-error before emitting the main error of parser and attach it. Fix #103869
2022-12-02Revert 88f2140Michael Goulet-6/+15
2022-12-01Properly synthesize fn sig value during cycleMichael Goulet-0/+17
2022-12-02Auto merge of #104963 - petrochenkov:noaddids2, r=cjgillotbors-47/+40
rustc_ast_lowering: Stop lowering imports into multiple items Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.
2022-12-02Avoid InferCtxt::build in suggest_missing_break_or_return_exprMichael Goulet-4/+34
2022-12-02Check lifetime param count in collect_trait_impl_trait_tysMichael Goulet-0/+41
2022-12-02Remove `-Zno-interleave-lints`.Nicholas Nethercote-70/+8
Because it complicates lint implementation greatly.
2022-12-01Make inline const block `ExprWithBlock`Gary Guo-0/+25
2022-12-01rustc_ast_lowering: Stop lowering imports into multiple itemsVadim Petrochenkov-47/+40
Lower them into a single item with multiple resolutions instead. This also allows to remove additional `NodId`s and `DefId`s related to those additional items.