about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-03-27resolve: Simplify some diagnostic code to avoid an ICEVadim Petrochenkov-2/+24
2022-03-26Auto merge of #92472 - petrochenkov:nowrapident, r=Aaron1011bors-414/+21
proc-macro: Stop wrapping `ident` matchers into groups `ident` is always a single token and can be treated in the same way as `tt`. r? `@Aaron1011`
2022-03-26Stablize `const_extern_fn` for "Rust" and "C"Aaron Hill-52/+19
All other ABIs are left unstable for now. cc #64926
2022-03-26Auto merge of #95274 - jendrikw:slice-must-use, r=Dylan-DPCbors-12/+14
add #[must_use] to functions of slice and its iterators. Continuation of #92853. Tracking issue: #89692.
2022-03-26Use str and char's Debug impl to format literalsDavid Tolnay-8/+8
2022-03-26Add test for proc_macro Literal string and character constructorsDavid Tolnay-0/+11
2022-03-26proc-macro: Stop wrapping `ident` matchers into groupsVadim Petrochenkov-414/+21
2022-03-25fix wrong header commandDrMeepster-1/+1
2022-03-25widen special case on deref to all non-zst allocatorsDrMeepster-0/+10
2022-03-26Auto merge of #95149 - cjgillot:once-diag, r=estebankbors-67/+51
Remove `Session::one_time_diagnostic` This is untracked mutable state, which modified the behaviour of queries. It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes). It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter. A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics. As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.
2022-03-25Minor `let_chains` modificationCaio-11/+11
2022-03-25diagnostics: correct generic bounds with doubled colonMichael Howell-0/+64
Fixes #95208
2022-03-25when checking pointee metadata, canonicalize the Sized queryMichael Goulet-0/+19
2022-03-25Auto merge of #95255 - petrochenkov:suggresolve, r=michaelwoeristerbors-190/+19
resolve: Do not build expensive suggestions if they are not actually used And remove a bunch of (conditionally) unused parameters from path resolution functions. This helps with performance issues in https://github.com/rust-lang/rust/pull/94857, and should be helpful in general even without that.
2022-03-25Auto merge of #95082 - spastorino:overlap-inherent-impls, r=nikomatsakisbors-0/+47
Overlap inherent impls r? `@nikomatsakis` Closes #94526
2022-03-24suggest wrapping single-expr blocks in square bracketsMichael Goulet-15/+63
2022-03-25Rollup merge of #95179 - b-naber:eval-in-try-unify, r=lcnrDylan DPC-189/+114
Try to evaluate in try unify and postpone resolution of constants that contain inference variables We want code like that in [`ui/const-generics/generic_const_exprs/eval-try-unify.rs`](https://github.com/rust-lang/rust/compare/master...b-naber:eval-in-try-unify?expand=1#diff-8027038201cf07a6c96abf3cbf0b0f4fdd8a64ce6292435f01c8ed995b87fe9b) to compile. To do that we need to try to evaluate constants in `try_unify_abstract_consts`, this requires us to be more careful about what constants we try to resolve, specifically we cannot try to resolve constants that still contain inference variables. r? `@lcnr`
2022-03-25Rollup merge of #94391 - light4:issue-90319, r=estebankDylan DPC-0/+26
Fix ice when error reporting recursion errors Fixes: #90319, #92148, #93955
2022-03-25resolve: Do not build expensive suggestions if they are not actually usedVadim Petrochenkov-190/+19
Also remove a redundant parameter from `fn resolve_path(_with_ribs)`, `crate_lint: CrateLint` is a more detailed version of `record_used: bool` with `CrateLint::No` meaning `false` and anything else meaning `true`.
2022-03-24Check if call return type is visibly uninhabited when building MIRTomasz Miąsko-66/+128
2022-03-24Where bounds are checked on inherent implsSantiago Pastorino-0/+25
2022-03-24Auto merge of #94934 - Lireer:const-prop-lint, r=oli-obkbors-61/+237
Separate const prop lints from optimizations r? `@oli-obk` Separates lints and optimizations during const prop by moving the lints into their own file and checking them during post borrowck cleanup. Thanks to `@oli-obk` for mentoring me.
2022-03-25Fix ice when error reporting recursion errorslightning1141-0/+26
Fixes: #90319, #92148, #93955
2022-03-24add #[must_use] to functions of slice and its iterators.Jendrik-12/+14
2022-03-24Auto merge of #94876 - b-naber:thir-abstract-const-changes, r=lcnrbors-0/+42
Change Thir to lazily create constants To allow `AbstractConst`s to work with the previous thir changes we made and those we want to make, i.e. to avoid problems due to `ValTree` and `ConstValue` conversions, we instead switch to a thir representation for constants that allows us to lazily create constants. r? `@oli-obk`
2022-03-24Auto merge of #91030 - estebank:trait-bounds-are-tricky-2, r=oli-obkbors-47/+84
Properly track `ImplObligations` Instead of probing for all possible `impl`s that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow to #89580. Addresses #89418.
2022-03-23Fix rustfix panic on testNoah Lev-113/+134
`run-rustfix` applies all suggestions regardless of their Applicability. There's a flag, `rustfix-only-machine-applicable`, that does what it says, but then the produced `.fixed` file would have invalid code from the suggestions that weren't applied. So, I moved the cases of postfix increment, in which case multiple suggestions are given, to the `-notfixed` test, which does not run rustfix. I also changed the Applicability to Unspecified since MaybeIncorrect requires that the code be valid, even if it's incorrect.
2022-03-23Use `multipart_suggestions`Noah Lev-12/+0
This records that the suggestions are mutually-exclusive (i.e., only one should be applied).
2022-03-23Change temporary variable name if it would conflictNoah Lev-6/+6
2022-03-23Add heuristic to avoid treating `x + +2` as incrementNoah Lev-18/+10
2022-03-23Bless testsNoah Lev-10/+18
2022-03-23Improve handling of `tmp` variable name conflictsNoah Lev-5/+80
2022-03-23Emit both subexp and standalone sugg for postfixNoah Lev-0/+15
This solves the TODO.
2022-03-23Emit structured suggestions for field accesses tooNoah Lev-2/+9
2022-03-23Refactor, handle fields better, add field testsNoah Lev-4/+48
2022-03-23Move increment checks to improve errorsNoah Lev-36/+76
2022-03-23Suggest `i += 1` when we see `i++` or `++i`Camelid-0/+79
2022-03-23Add known-bug for #94034Michael Goulet-0/+97
2022-03-23Better suggestions for Fn trait selection errorsMichael Goulet-0/+114
2022-03-24Properly track `ImplObligation`sEsteban Kuber-47/+84
Instead of probing for all possible impls that could have caused an `ImplObligation`, keep track of its `DefId` and obligation spans for accurate error reporting. Follow up to #89580. Addresses #89418. Remove some unnecessary clones. Tweak output for auto trait impl obligations.
2022-03-23Rollup merge of #95238 - ↵Matthias Krüger-0/+36
TaKO8Ki:stop-emitting-E0026-for-struct-enum-with-underscore, r=estebank Stop emitting E0026 for struct enums with underscores This patch resolves a part of #83263; r? `@estebank`
2022-03-23Rollup merge of #95225 - compiler-errors:impl-future-generator-ty, r=oli-obkMatthias Krüger-18/+18
remove `[async output]` from `impl Future` pretty-printing self-explanatory, guess it's not as helpful as I thought when I added it 4 months ago re https://github.com/rust-lang/rust/issues/95089#issuecomment-1075482851
2022-03-23Rollup merge of #95221 - RalfJung:check_and_deref_ptr, r=oli-obkMatthias Krüger-9/+9
interpret/memory: simplify check_and_deref_ptr *Finally* I saw a way to make this code simpler. The odd preprocessing in `let ptr_or_addr =` has bothered me since forever, but it actually became unnecessary in the last provenance refactoring. :) This also leads to slightly more explicit error messages as a nice side-effect. :tada: r? `@oli-obk`
2022-03-23Rollup merge of #94249 - compiler-errors:better-copy-errors, r=davidtwcoMatthias Krüger-0/+64
Better errors when a Copy impl on a Struct is not self-consistent As discovered in a Zulip thread with `@nnethercote` and `@Mark-Simulacrum,` it's not immediately obvious why a field on an ADT doesn't implement `Copy`. This PR attempts to give slightly more detailed information by spinning up a fulfillment context to try to dig down and discover transitive fulfillment errors that cause `is_copy_modulo_regions` to fail on a ADT field. The error message still kinda sucks, but should only show up in the case that an existing error message was totally missing... so I think it's a good compromise for now?
2022-03-23Auto merge of #95220 - rust-lang:notriddle/ast-validation-semicolon, r=Dylan-DPCbors-3/+1
diagnostics: do not suggest `fn foo({ <body> }` Instead of suggesting that the body always replace the last character on the line, presuming it must be a semicolon, the parser should instead check what the last character is, and append the body if it is anything else. Fixes #83104
2022-03-23Remove line instead of just commenting outCarl Scherer-1/+0
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
2022-03-23separate const prop lint from optimizationsCarl Scherer-61/+238
2022-03-23Auto merge of #94901 - fee1-dead:destructable, r=oli-obkbors-68/+69
Rename `~const Drop` to `~const Destruct` r? `@oli-obk` Completely switching to `~const Destructible` would be rather complicated, so it seems best to add it for now and wait for it to be backported to beta in the next release. The rationale is to prevent complications such as #92149 and #94803 by introducing an entirely new trait. And `~const Destructible` reads a bit better than `~const Drop`. Name Bikesheddable.
2022-03-23stop emitting E0026 for struct enums with underscoresTakayuki Maeda-0/+36
2022-03-23add test for treating ExprKind::ConstParam as tempb-naber-0/+42