about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-08-12let-else: add a test for warnings on let-else with diverging tailCormac Relf-0/+33
2022-08-11Add missing visit_pat_field in early lint visitor.Eric Huss-6/+27
This ensures that lint attributes on pattern fields can control early lints.
2022-08-11Make Node::ExprField a child of Node::Expr.Eric Huss-76/+76
This was incorrectly inserting the ExprField as a sibling of the struct expression. This required adjusting various parts which were looking at parent node of a field expression to find the struct.
2022-08-11Add visitors for PatField and ExprField.Eric Huss-1/+1
This helps simplify the code. It also fixes it to use the correct parent when lowering. One consequence is the `non_snake_case` lint needed to change the way it looked for parent nodes in a struct pattern. This also includes a small fix to use the correct `Target` for expression field attribute validation.
2022-08-11Honor lint level attributes in more places.Eric Huss-0/+1266
This extends the LintLevelBuilder to handle lint level attributes on struct expression fields and pattern fields. This also updates the early lints to honor lint levels on generic parameters.
2022-08-11Check attributes on struct expression fields.Eric Huss-2/+8
Attributes on struct expression fields were not being checked for validity. This adds the fields as HIR nodes so that `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-08-11Check attributes on pattern fields.Eric Huss-1/+13
Attributes on pattern struct fields were not being checked for validity. This adds the fields as HIR nodes so that the `CheckAttrVisitor` can visit those nodes to check their attributes.
2022-08-12Erase regions better in promote_candidateMichael Goulet-0/+25
2022-08-12Fix HIR pretty printing of let elseMichael Goulet-0/+28
2022-08-11Suggest path separator when a dot is used on a traitLeón Orell Valerian Liehr-37/+357
2022-08-11Rollup merge of #100350 - jhpratt:stringify-vis, r=cjgillotMatthias Krüger-2/+3
Stringify non-shorthand visibility correctly This makes `stringify!(pub(in crate))` evaluate to `pub(in crate)` rather than `pub(crate)`, matching the behavior before the `crate` shorthand was removed. Further, this changes `stringify!(pub(in super))` to evaluate to `pub(in super)` rather than the current `pub(super)`. If the latter is not desired (it is _technically_ breaking), it can be undone. Fixes #99981 `@rustbot` label +C-bug +regression-from-stable-to-beta +T-compiler
2022-08-11Rollup merge of #100307 - nnethercote:fix-96847, r=cjgillotMatthias Krüger-2/+16
Fix #96847 r? `@petrochenkov`
2022-08-11Rollup merge of #100398 - nnethercote:improve-Zhir-stats, r=michaelwoeristerDylan DPC-0/+192
Improve `-Zhir-stats` Add testing, improve coverage, avoid some double counting, and add more detail. r? `@michaelwoerister`
2022-08-11Rollup merge of #100232 - cjgillot:no-desugar-methodcall, r=nagisaDylan DPC-0/+46
Do not consider method call receiver as an argument in AST. Fixes https://github.com/rust-lang/rust/issues/73663
2022-08-11Rollup merge of #92744 - lambinoo:I-91161-non-exhaustive-foreign-variants, ↵Dylan DPC-7/+12
r=scottmcm Check if enum from foreign crate has any non exhaustive variants when attempting a cast Fixes #91161 As stated in the issue, this will require a crater run as it might break other people's stuff.
2022-08-11suggest const or static for global variablechenyukang-0/+14
2022-08-11Avoid lowering a `MacArgs::Eq` twice.Nicholas Nethercote-0/+14
Fixes #96847.
2022-08-11Auto merge of #100315 - compiler-errors:norm-ct-in-proj, r=lcnrbors-0/+279
Keep going if normalized projection has unevaluated consts in `QueryNormalizer` #100312 was the wrong approach, I think this is the right one. When normalizing a type, if we see that it's a projection, we currently defer to `tcx.normalize_projection_ty`, which normalizes the projections away but doesn't touch the unevaluated constants. So now we just continue to fold the type if it has unevaluated constants so we make sure to evaluate those too, if we can. Fixes #100217 Fixes #83972 Fixes #84669 Fixes #86710 Fixes #82268 Fixes #73298
2022-08-11Add a second level to the AST size reporting.Nicholas Nethercote-2/+62
This tells you which variants of the enums are most common, which is very useful. I've only done it for the AST for now, HIR can be done later.
2022-08-11Add percentages to `-Zhir-stats` output.Nicholas Nethercote-70/+70
2022-08-11Change how `AssocItem` is reported.Nicholas Nethercote-4/+2
Currently it's reported as either `TraitItem` or `ImplItem`. This commit changes it to `AssocItem`, because having the report match the type name is (a) consistent with other types, and (b) the trait/impl split isn't that important here.
2022-08-11Improve AST stat collector.Nicholas Nethercote-5/+15
This commit: - Adds a comment explaining which `visit_*` methods should be implemented. - Adds and removes some `visit_*` methods accordingly, improving coverage, and avoiding some double counting.
2022-08-11Add a test for `-Zhir-stats` output.Nicholas Nethercote-0/+124
This will be very useful in subsequent commits where I will improve the output.
2022-08-10Update error message to clarify that it's not the enum itself that's ↵Scott McMurray-1/+1
non_exhaustive
2022-08-10Check if extern crate enum has non exhaustive variant when castLamb-7/+12
2022-08-10Do not consider method call receiver as an argument in AST.Camille GILLOT-0/+46
2022-08-10Ban indirect references to `Self` too.Camille GILLOT-0/+19
2022-08-10Generalize trait object generic param check to aliases.Camille GILLOT-53/+82
2022-08-10Rollup merge of #100359 - b-naber:valtrees-pretty-print-ice, r=lcnrMichael Goulet-0/+36
Special-case references to leafs in valtree pretty-printing Fixes https://github.com/rust-lang/rust/issues/100313
2022-08-10Rollup merge of #100349 - TaKO8Ki:remove-type-string-comparison, r=lcnrMichael Goulet-1/+68
Refactor: remove a type string comparison
2022-08-10add testb-naber-0/+36
2022-08-10Auto merge of #100356 - matthiaskrgr:rollup-he0vkjc, r=matthiaskrgrbors-4/+106
Rollup of 8 pull requests Successful merges: - #99573 (Stabilize backtrace) - #100069 (Add error if link_ordinal used with unsupported link kind) - #100086 (Add more `// unit-test`s to MIR opt tests) - #100332 (Rename integer log* methods to ilog*) - #100334 (Suggest a missing semicolon before an array) - #100340 (Iterate generics_def_id_map in reverse order to fix P-critical issue) - #100345 (docs: remove repetition in `is_numeric` function docs) - #100352 (Update cargo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-10Rollup merge of #100340 - spastorino:fix-100187, r=compiler-errorsMatthias Krüger-0/+12
Iterate generics_def_id_map in reverse order to fix P-critical issue Closes #100187 Fixes a `P-critical` beta regression.
2022-08-10Rollup merge of #100334 - TaKO8Ki:suggest-missing-semicolon-before-array, ↵Matthias Krüger-0/+53
r=fee1-dead Suggest a missing semicolon before an array fixes #99658
2022-08-10Rollup merge of #100069 - dpaoliello:linkordinal, r=michaelwoeristerMatthias Krüger-0/+41
Add error if link_ordinal used with unsupported link kind The `link_ordinal` attribute only has an affect if the `raw-dylib` link kind is used, so add an error if it is used with any other link kind.
2022-08-10Rollup merge of #99573 - tbodt:stabilize-backtrace, r=yaahcMatthias Krüger-4/+0
Stabilize backtrace This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized. Previous discussion can be found in #72981, #3156. Stabilized API summary: ```rust pub mod std { pub mod backtrace { pub struct Backtrace { } pub enum BacktraceStatus { Unsupported, Disabled, Captured, } impl fmt::Debug for Backtrace {} impl Backtrace { pub fn capture() -> Backtrace; pub fn force_capture() -> Backtrace; pub const fn disabled() -> Backtrace; pub fn status(&self) -> BacktraceStatus; } impl fmt::Display for Backtrace {} } } ``` `@yaahc`
2022-08-09Stringify non-shorthand visibility correctlyJacob Pratt-2/+3
2022-08-10Fall back when relating two opaques by substs in MIR typeckMichael Goulet-0/+65
2022-08-10remove a type string comparisonTakayuki Maeda-1/+68
2022-08-09Make the GATS self outlives error take into GATs in the inputsJack Huey-1/+25
2022-08-10Rollup merge of #100261 - luqmana:suggestions-overflow, r=lcnrMatthias Krüger-0/+43
Set tainted errors bit before emitting coerce suggestions. Fixes #100246. #89576 basically got 99% of the way there but the match typechecking code (which calls `coerce_inner`) also needed a similar fix.
2022-08-10Rollup merge of #100240 - cjgillot:noice-structural-match, r=davidtwcoMatthias Krüger-0/+41
Fail gracefully when const pattern is not structural match. Fixes https://github.com/rust-lang/rust/issues/82909
2022-08-10Rollup merge of #100226 - cjgillot:noice-multibyte, r=davidtwcoMatthias Krüger-0/+54
Do not manually craft a span pointing inside a multibyte character. Fixes https://github.com/rust-lang/rust/issues/92462
2022-08-10Rollup merge of #100098 - compiler-errors:field-suggestion-fixups, r=davidtwcoMatthias Krüger-8/+65
Some "this expression has a field"-related fixes Each commit does something different and is worth reviewing, but the final diff from `master..HEAD` contains the sum of the changes to the UI tests, since some commits added UI tests "regressions" which were later removed in other commits. The only change I could see adding on top of this is suppressing `Clone::clone` from the "this expression has a field that has this method" suggestion, since it's so commonly implemented by types that it's not worthwhile suggesting in general.
2022-08-09Add regression test for issue 100187Santiago Pastorino-0/+12
2022-08-09Add error if link_ordinal used without raw-dylibDaniel Paoliello-0/+41
2022-08-10suggest a missing semicolon before an arrayTakayuki Maeda-0/+53
2022-08-09Auto merge of #99217 - lcnr:implied-bounds-pre-norm, r=lcnrbors-76/+178
consider unnormalized types for implied bounds extracted, and slightly modified, from #98900 The idea here is that generally, rustc is split into things which can assume its inputs are well formed[^1], and things which have verify that themselves. Generally most predicates should only deal with well formed inputs, e.g. a `&'a &'b (): Trait` predicate should be able to assume that `'b: 'a` holds. Normalization can loosen wf requirements (see #91068) and must therefore not be used in places which still have to check well formedness. The only such place should hopefully be `WellFormed` predicates fixes #87748 and #98543 r? `@jackh726` cc `@rust-lang/types` [^1]: These places may still encounter non-wf inputs and have to deal with them without causing an ICE as we may check for well formedness out of order.
2022-08-09compare with-flag to without-flagRalf Jung-19/+21
2022-08-09test implied bounds + nested proj obliglcnr-0/+42