Vadim Petrochenkov
a45a302be5
effective visibility: Fix private visibility calculation for modules
...
Optimizations removed in the previous commit required this function to behave incorrectly, but now those optimizations are gone so we can fix the bug.
Fixes https://github.com/rust-lang/rust/issues/104249
2022-11-24 00:03:51 +03:00
Vadim Petrochenkov
f0843b89d1
effective visibility: Remove questionable optimizations
...
First, they require eagerly calculating private visibility (current normal module), which is somewhat expensive.
Private visibilities are also lost once calculated, instead of being cached in the table.
Second, I cannot prove that the optimizations are correct.
Maybe they can be partially reinstated in the future in cases when it's cheap and provably correct to do them.
They will also probably be merged into `fn update` in that case.
Partially fixes https://github.com/rust-lang/rust/issues/104249
Fixes https://github.com/rust-lang/rust/issues/104539
2022-11-24 00:03:51 +03:00
Vadim Petrochenkov
3f20f4ac42
effective visibility: Satisfy borrow checker to use resolver lazily from a closure
2022-11-24 00:03:51 +03:00
Maybe Waffle
550319059d
Simplify mutability assert!s
2022-11-23 20:39:16 +00:00
Maybe Waffle
f9a332a48c
Simplify creation of AutoBorrowMutability
2022-11-23 20:39:16 +00:00
Maybe Waffle
6486ba94a3
random::<Improve<Mutability>>()
2022-11-23 20:39:16 +00:00
Maybe Waffle
4439f1f6a6
Add Mutability::mutably_str
2022-11-23 20:39:16 +00:00
Maybe Waffle
bcee07e78d
Add Mutability::{is_mut,is_not}
2022-11-23 20:26:31 +00:00
Maybe Waffle
e51cd6e822
Don't accept Mutability by ref
2022-11-23 20:26:31 +00:00
Maybe Waffle
da40965300
Add Mutability::{is_mut,is_not}
2022-11-23 20:26:31 +00:00
Maybe Waffle
9b9c7d0ecc
Depend on Mutability ordering
2022-11-23 20:26:31 +00:00
b-naber
9061ffba8c
use no type in ProjectionElem::Field for PlaceBuilder::UpVar
2022-11-23 21:25:27 +01: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
53a711fdeb
Fix rebase
2022-11-23 12:17:48 -08:00
Esteban Küber
2a530dce53
Fix clippy code
2022-11-23 12:17:47 -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
24f80ea7d7
Fix rustfmt
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
4f2f59ba6f
Fix clippy code
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
b-naber
c39de61d2a
include closures and generators in try_compute_field_ty
2022-11-23 20:55:17 +01:00
b-naber
4d00026edd
add invariance test
2022-11-23 20:55:17 +01:00
b-naber
4040734e44
get field ty during projecting
2022-11-23 20:55:15 +01:00
bors
70f8737b2f
Auto merge of #104410 - WaffleLapkin:unregress, r=estebank
...
Fix perf regression by correctly matching keywords
This should (hopefully) fix regression from #99918
r? `@estebank`
2022-11-23 19:52:43 +00:00
Maybe Waffle
8195e12dd9
Add Mutability::ref_prefix_str, order Mutability, simplify code
2022-11-23 19:36:27 +00:00
Camille GILLOT
93cfcedfd5
Separate lifetime ident from resolution in HIR.
2022-11-23 19:33:06 +00:00
Camille GILLOT
fb7d25e978
Separate lifetime ident from resolution in HIR.
2022-11-23 19:33:06 +00:00
b-naber
fd6fed3027
address review
2022-11-23 20:01:53 +01:00
b-naber
2ef8308687
add more tests
2022-11-23 20:01:15 +01:00
b-naber
f015842ed2
properly handle enum field projections
2022-11-23 20:01:11 +01:00
b-naber
906c52743a
add tests
2022-11-23 19:59:00 +01:00
b-naber
4d3a91b12b
use non-ascribed type as field type in mir
2022-11-23 19:59:00 +01:00
b-naber
ac31d52324
implement PlaceBuilder::try_ty
2022-11-23 19:58:56 +01:00
Oli Scherer
6c2719a6d6
Bump the const eval step limit
2022-11-23 16:55:57 +00:00
est31
9abd785543
Add regression test for issue 99938
...
That issue was a dupe of 99852, but it's always better to
have multiple regression tests rather than one.
2022-11-23 17:48:00 +01:00
bors
d121aa3b55
Auto merge of #104776 - Dylan-DPC:rollup-rf4c2u0, r=Dylan-DPC
...
Rollup of 6 pull requests
Successful merges:
- #104269 (Fix hang in where-clause suggestion with `predicate_can_apply`)
- #104286 (copy doc output files by format)
- #104509 (Use obligation ctxt instead of dyn TraitEngine)
- #104721 (Remove more `ref` patterns from the compiler)
- #104744 (rustdoc: give struct fields CSS `display: block`)
- #104751 (Fix an ICE parsing a malformed attribute.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-23 16:29:17 +00:00
Maybe Waffle
20f3de5ab1
Use nicer spans for deref_into_dyn_supertrait
2022-11-23 16:12:51 +00:00
Thom Chiovoloni
54a6d4edbc
Add #![deny(unsafe_op_in_unsafe_fn)] in liballoc tests
2022-11-23 08:10:17 -08:00
Maybe Waffle
284ce9ed0d
Move get_associated_type from clippy to rustc_lint
2022-11-23 15:40:27 +00:00
Maybe Waffle
0d4a5c725a
Make deref_into_dyn_supertrait lint the impl and not the usage
2022-11-23 15:40:27 +00:00
Maybe Waffle
11a5386256
Move get_associated_type from clippy to rustc_lint
2022-11-23 15:40:27 +00:00
Laurențiu Nicola
37c3521597
⬆️ rust-analyzer
2022-11-23 17:24:03 +02:00
Dylan DPC
5d7b68c82b
Rollup merge of #104751 - nnethercote:fix-104620, r=petrochenkov
...
Fix an ICE parsing a malformed attribute.
Fixes #104620 .
r? `@petrochenkov`
2022-11-23 20:32:38 +05:30