Esteban Küber
78b8d126db
Fix rebase
2022-11-23 13:06:27 -08:00
Esteban Küber
0da4c44190
Account for closures
2022-11-23 12:17:48 -08:00
Esteban Küber
3a471b5fd8
Account for x @ y
and suggest ref x @ ref y
2022-11-23 12:17:48 -08:00
Esteban Küber
3c905d4ccd
review comments: inline bindings and fix typo
2022-11-23 12:17:48 -08:00
Esteban Küber
5993f5d0f8
Tweak output to account for alternative bindings in the same pattern
2022-11-23 12:17:47 -08:00
Esteban Küber
e6e7a6db28
Fix wording
2022-11-23 12:17:47 -08:00
Esteban Küber
d687d46f68
Tweak output in for loops
...
Do not suggest `.clone()` as we already suggest borrowing the iterated
value.
2022-11-23 12:17:47 -08:00
Esteban Küber
c0e481731b
Remove logic duplication
2022-11-23 12:17:47 -08:00
Esteban Küber
42d7174bbc
Extract suggestion logic to its own method
2022-11-23 12:17:47 -08:00
Esteban Küber
14a3d572e6
Use type_implements_trait
2022-11-23 12:17:47 -08:00
Esteban Küber
4a51f37bcb
Do not suggest ref
multiple times for the same binding
2022-11-23 12:17:47 -08:00
Esteban Küber
9e72e35ceb
Suggest .clone()
or ref binding
on E0382
2022-11-23 12:17:47 -08:00
Maybe Waffle
b80356a5ab
Use tcx.require_lang_item
instead of unwrapping
2022-11-22 17:19:19 +00:00
Oli Scherer
7658e0fccf
Stop passing the self-type as a separate argument.
2022-11-21 20:39:46 +00:00
Manish Goregaokar
a13809ae51
Rollup merge of #103960 - AndyJado:var_path_only_diag, r=davidtwco
...
piece of diagnostic migrate
r? `@davidtwco`
2022-11-11 12:12:30 -05:00
Manish Goregaokar
46bc12c95a
Rollup merge of #103307 - b4den:master, r=estebank
...
Add context to compiler error message
Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`.
2022-11-09 15:39:02 -05:00
AndyJado
057d8e5c43
struct error E0505
2022-11-09 21:15:31 +08:00
AndyJado
abf259cc54
var_subdiag refinement
...
trim old
2022-11-09 21:15:29 +08:00
AndyJado
a0cee0ab90
remove old var_span_path_only
...
doc comment
2022-11-09 20:51:43 +08:00
AndyJado
e49d10db14
first move on a nested span_label
...
Apply suggestions from code review
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-11-05 19:43:48 +08:00
Michael Goulet
41e4218d2a
Use TraitEngine less
2022-11-02 04:11:05 +00:00
Michael Goulet
dce44faf5b
Revert "Make ClosureOutlivesRequirement not rely on an unresolved type"
...
This reverts commit a6b5f95fb0
.
2022-10-27 16:15:11 +00:00
b4den
c87567cbfa
Add context to compiler error message
...
Changed `creates a temporary which is freed while still in use` to
`creates a temporary value which is freed while still in use`
2022-10-20 15:44:25 +01:00
bors
542febd2d3
Auto merge of #103290 - matthiaskrgr:rollup-ngozai3, r=matthiaskrgr
...
Rollup of 6 pull requests
Successful merges:
- #103197 (Stabilize proc_macro::Span::source_text)
- #103251 (Fix item declaration highlighting)
- #103262 (Adjusting test to needs-unwind, with linking issue)
- #103268 (rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`)
- #103272 (Remove extra spaces in docs)
- #103276 (Erase regions before checking for `Default` in uninitialized binding error)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-20 13:33:50 +00:00
Michael Goulet
c5c9f74829
Erase regions before checking for default in uninitialized binding error
2022-10-19 23:36:28 +00:00
Michael Goulet
a6b5f95fb0
Make ClosureOutlivesRequirement not rely on an unresolved type
2022-10-19 17:10:59 +00:00
Cameron Steffen
283abbf0e7
Change InferCtxtBuilder from enter to build
2022-10-07 07:10:40 -05:00
bors
84946fe241
Auto merge of #102184 - chenyukang:fix-102087-add-binding-sugg, r=nagisa
...
Suggest Default::default() when binding isn't initialized
Fixes #102087
2022-09-26 11:41:58 +00:00
yukang
672e3f4d77
fix #102087 , Suggest Default::default() when binding isn't initialized
2022-09-26 07:56:26 +08:00
fee1-dead
084029f39d
Rollup merge of #101431 - compiler-errors:move-place-ty-for-move-place-sugg, r=cjgillot
...
Look at move place's type when suggesting mutable reborrow
Not sure why we are looking at the use site's ty instead of the move site's ty in order to suggest reborrowing the move site, but it was suppressing a perfectly valid reborrow suggestion.
r? `@estebank` who i think touched this last in 520461f1fb
, though that was quite a while ago so feel free to reassign.
2022-09-25 22:06:37 +08:00
bors
4136b59b7d
Auto merge of #99806 - oli-obk:unconstrained_opaque_type, r=estebank
...
Allow patterns to constrain the hidden type of opaque types
fixes #96572
reverts a revert as original PR was a perf regression that was fixed by reverting it: https://github.com/rust-lang/rust/pull/99368#issuecomment-1186587864 )
TODO:
* check if https://github.com/rust-lang/rust/issues/99685 is avoided
2022-09-20 12:09:52 +00:00
lcnr
647052fc04
remove the Subst
trait, always use EarlyBinder
2022-09-19 11:37:27 +02:00
Oli Scherer
40e2de8c41
Revert "Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank""
...
This reverts commit 4a742a691e
.
2022-09-16 11:36:39 +00:00
Michael Goulet
7e226e6d3f
Look at move place's type when suggesting mutable reborrow
2022-09-05 05:00:33 +00:00
Michael Goulet
41d4ea2314
Don't suggest reborrow if usage is inside a closure
2022-09-05 04:27:07 +00:00
Jack Huey
8033c3c27d
Various changes to logging of borrowck-related code
2022-08-29 10:59:21 -04:00
Michael Goulet
a2b6744af0
Use &mut Diagnostic instead of &mut DiagnosticBuilder unless needed
2022-08-10 03:45:42 +00:00
Matthias Krüger
01ccde5ec8
Rollup merge of #100095 - jackh726:early-binder, r=lcnr
...
More EarlyBinder cleanups
Each commit is independent
r? types
2022-08-04 22:25:04 +02:00
klensy
0548e8ed06
fix trailing whitespace in error message
2022-08-03 15:46:34 +03:00
Jack Huey
e21624dc80
Add bound_predicates_of and bound_explicit_predicates_of
2022-08-02 22:44:08 -04:00
Obei Sideg
86dd457e6a
Improve cannot move out of
error message
2022-07-31 21:06:43 +03:00
Dylan DPC
403c1b3802
Rollup merge of #99186 - camsteffen:closure-localdefid, r=cjgillot
...
Use LocalDefId for closures more
2022-07-31 17:36:40 +05:30
Cameron Steffen
cf2433a74f
Use LocalDefId for closures more
2022-07-30 15:59:17 -05:00
Miguel Guarniz
25bdc8965e
Change maybe_body_owned_by to take local def id
...
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-07-29 18:25:58 -04:00
Oli Scherer
4a742a691e
Revert "Rollup merge of #98582 - oli-obk:unconstrained_opaque_type, r=estebank"
...
This reverts commit 6f8fb911ad
, reversing
changes made to 7210e46dc6
.
2022-07-20 07:55:58 +00:00
Matthias Krüger
6277ac2fb8
Rollup merge of #99342 - TaKO8Ki:avoid-symbol-to-string-conversions, r=compiler-errors
...
Avoid some `Symbol` to `String` conversions
This patch removes some Symbol to String conversions.
2022-07-16 22:30:56 +02:00
Matthias Krüger
984ef421fd
Rollup merge of #99258 - estebank:suggest-let, r=wesleywiser
...
Provide structured suggestion for dropped temp value
2022-07-16 22:30:49 +02:00
Takayuki Maeda
c54d4ada26
avoid some Symbol
to String
conversions
2022-07-17 04:09:20 +09:00
Esteban Küber
3ee4e5f704
Fix rebase
2022-07-15 11:14:06 -07:00
Esteban Küber
635c38187b
Avoid incorrect suggestion
...
We check that there's a single level of block nesting to ensure always
correct suggestions. If we don't, then we only provide a free-form
message to avoid misleading users in cases like
`src/test/ui/nll/borrowed-temporary-error.rs`.
We could expand the analysis to suggest hoising all of the relevant
parts of the users' code to make the code compile, but that could be
too much.
2022-07-15 11:04:45 -07:00