Commit Graph

197170 Commits

Author SHA1 Message Date
Matthias Krüger
eabf1a2e8e
Rollup merge of #100132 - compiler-errors:issue-100103, r=tmiasko
Use (actually) dummy place for let-else divergence

Fixes #100103
2022-08-06 16:15:56 +02:00
Matthias Krüger
b0b798e1e2
Rollup merge of #100094 - lyming2007:issue-98982, r=estebank
Detect type mismatch due to loop that might never iterate

When loop as tail expression causes a miss match type E0308 error, recursively get the return statement and add diagnostic information on it.
2022-08-06 16:15:56 +02:00
bors
51705698bd Auto merge of #12931 - oxalica:feat/la-arena-apis, r=lnicola
Add more constructors and entry-APIs for la-arena

`la-arena` on crates.io is quite helpful when just a thin wrapper for Vec with u32 indices is needed.
But the current API is not ergonomic enough.

This PR
- Adds `ArenaMap::new`. Not sure why only `Arena` has it now.
- Adds `Arena{,Map}::with_capacity` for known-size storage.
- Adds entry-API for `ArenaMap` for easier `.entry(idx).or_default().push(value)` or `.entry(idx).or_insert(...)` operations.
2022-08-06 13:39:31 +00:00
bors
76b0484740 Auto merge of #99893 - compiler-errors:issue-99387, r=davidtwco
Delay formatting trimmed path until lint/error is emitted

Fixes #99387

r? `@davidtwco`
2022-08-06 12:29:11 +00:00
Guillaume Gomez
71edb3168f remove Clean trait implementation for hir::PolyTraitRef 2022-08-06 11:54:54 +02:00
Guillaume Gomez
ca70ed8c81 remove Clean trait implementation for hir::GenericBound 2022-08-06 11:52:27 +02:00
bors
bb71929892 Auto merge of #100172 - Mark-Simulacrum:bump-165, r=Mark-Simulacrum
Bump to 1.65.0

r? `@Mark-Simulacrum`
2022-08-06 09:37:32 +00:00
Tomasz Miąsko
7d2131a204 ./x.py test --bless 2022-08-06 11:16:23 +02:00
Tomasz Miąsko
18a21e13b4 Remove duplicated temporaries creating during box derefs elaboration
Temporaries created with `MirPatch::new_temp` will be declared after
patch application. Remove manually created duplicate declarations.

Removing duplicates exposes another issue. Visitor elaborates
terminator twice and attempts to access new, but not yet available,
local declarations. Remove duplicated call to `visit_terminator`.
2022-08-06 11:14:57 +02:00
bors
f719599c0f Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726
Some `FulfillmentContext`-related cleanups

Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others...

r? types
2022-08-06 06:48:15 +00:00
bors
bd04658eb6 Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726
Some `FulfillmentContext`-related cleanups

Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others...

r? types
2022-08-06 06:48:15 +00:00
Michael Howell
fc31fce670 rustdoc: use serde, which can escape strings more quickly
This means we don't gain as much as we did from using single-quotes, since
serde_json can only produce double-quoted strings, but it's still a win.
2022-08-05 16:36:47 -07:00
bors
55f46419af Auto merge of #100035 - workingjubilee:merge-functions, r=nikic
Enable function merging when opt is for size

It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.

Closes #98215.
2022-08-05 23:11:49 +00:00
Ralf Jung
54b122e913 propagate --bless to Miri 2022-08-05 17:59:47 -04:00
Ralf Jung
d5e9e94741 add method to get the mutability of an AllocId 2022-08-05 17:59:35 -04:00
Jubilee Young
80c9012e42 Enable function merging when opt is for size
It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.
2022-08-05 14:59:32 -07:00
bors
5721ca9a13 Auto merge of #9294 - alex-semenyuk:enable_def_id_nocore_on_windows, r=xFrednet
Enable test for def_id_nocore for windows

Verified that it actully works on windows
changelog: none
2022-08-05 21:08:19 +00:00
alex-semenyuk
1e1193f4fa Enable test for def_id_nocore for windows 2022-08-05 23:24:50 +03:00
Yiming Lei
9815667b8b implement #98982
when loop as tail expression for miss match type E0308 error, recursively get
the return statement and add diagnostic information on it
use rustc_hir::intravisit to collect the return expression
	modified:   compiler/rustc_typeck/src/check/coercion.rs
	new file:   src/test/ui/typeck/issue-98982.rs
	new file:   src/test/ui/typeck/issue-98982.stderr
2022-08-05 10:28:00 -07:00
Josh Stone
99793d97e1
Update RELEASES.md
Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
2022-08-05 10:02:46 -07:00
Josh Stone
5247a33f83
Update RELEASES.md
Co-authored-by: Trevor Spiteri <tspiteri@ieee.org>
2022-08-05 10:02:38 -07:00
Xavier Noria
64d1c91a31
ascii -> ASCII in code comment 2022-08-05 18:45:42 +02:00
Michael Goulet
694a010a5c move DiagnosticArgFromDisplay into rustc_errors 2022-08-05 16:44:01 +00:00
Michael Goulet
0ad57d8502 Delay formatting trimmed path until lint/error is emitted 2022-08-05 16:44:01 +00:00
bors
affe0d3a00 Auto merge of #100174 - Dylan-DPC:rollup-wnskbk6, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #99835 (Suggest adding/removing `ref` for binding patterns)
 - #100155 (Use `node_type_opt` to skip over generics that were not expected)
 - #100157 (rustdoc: use `collect()` instead of repeatedly pushing)
 - #100158 (kmc-solid: Add a stub implementation of #98246 (`File::set_times`))
 - #100166 (Remove more Clean trait implementations)
 - #100168 (Improve diagnostics for `const a: = expr;`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-05 16:35:15 +00:00
Dylan DPC
e7ed8443ea
Rollup merge of #100168 - WaffleLapkin:improve_diagnostics_for_missing_type_in_a_const_item, r=compiler-errors
Improve diagnostics for `const a: = expr;`

Adds a suggestion to write a type when there is a colon, but the type is not present.
I've also shrunk spans a little, so the suggestions are a little nicer.

Resolves #100146

r? `@compiler-errors`
2022-08-05 21:54:37 +05:30
Dylan DPC
404782dffe
Rollup merge of #100166 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? `@notriddle`
2022-08-05 21:54:36 +05:30
Dylan DPC
823ef905ed
Rollup merge of #100158 - solid-rs:patch/kmc-solid/follow-up-98246, r=joshtriplett
kmc-solid: Add a stub implementation of #98246 (`File::set_times`)

 Fixes the build failure of the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets after #98246.

This target does not support setting a modification time and access time separately, hence stubbing out the implementation.
2022-08-05 21:54:35 +05:30
Dylan DPC
97440b5899
Rollup merge of #100157 - rust-lang:notriddle/use-map-instead-of-repeated-push, r=Dylan-DPC
rustdoc: use `collect()` instead of repeatedly pushing
2022-08-05 21:54:34 +05:30
Dylan DPC
721af40dcb
Rollup merge of #100155 - compiler-errors:issue-100154, r=jackh726
Use `node_type_opt` to skip over generics that were not expected

Fixes #100154
2022-08-05 21:54:33 +05:30
Dylan DPC
9e4feff46a
Rollup merge of #99835 - TaKO8Ki:suggest-adding-or-removing-ref-for-binding-pattern, r=estebank
Suggest adding/removing `ref` for binding patterns

This fixes what a fixme comment says.

r? `@estebank`
2022-08-05 21:54:32 +05:30
Michael Howell
dddc2fd6de rustdoc: reduce the number of intermediate Strings allocated 2022-08-05 08:56:09 -07:00
Mark Rousskov
b560dd64d7 Bump to 1.65.0 2022-08-05 11:32:46 -04:00
Maybe Waffle
95bf0fb917 Move stability lookup after cross-crate check 2022-08-05 18:13:22 +04:00
Maybe Waffle
c195f7c0a4 Optimize pointer::as_aligned_to 2022-08-05 17:14:32 +04:00
bors
3792720086 Auto merge of #12947 - Veykril:switch-workspace, r=Veykril
Don't switch workspace on vfs file changes from libraries

When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.
2022-08-05 13:13:44 +00:00
bors
97038e55cf Auto merge of #12949 - Veykril:token-pick, r=Veykril
fix: Fix incorrect token pick rankings
2022-08-05 13:06:10 +00:00
bors
d77da9da84 Auto merge of #100073 - dpaoliello:externvar, r=michaelwoerister
Add test for raw-dylib with an external variable

All existing tests of link kind `raw-dylib` only validate the ability to link against functions, but it is also possible to link against variables.

This adds tests for linking against a variable using `raw-dylib` both by-name and by-ordinal.
2022-08-05 13:05:34 +00:00
Lukas Wirth
6bf674c8e4 fix: Fix incorrect token pick rankings 2022-08-05 14:59:26 +02:00
bors
2364788c3b Auto merge of #12948 - Veykril:classify-ops, r=Veykril
feat: Handle operators like their trait functions in the IDE

Allows hover and goto implementation to work on `?`, indexing brackets, binary operators, prefix operators and `await`. Regarding `await`, hover will continue to show the keyword docs while goto implementation will bring the user to the `poll` function of the `Future` implementation.
![Code_CJmZ3FGFVn](https://user-images.githubusercontent.com/3757771/183076683-c9899bd6-60d3-461b-965f-0c0f9745e2e8.gif)

Fixes https://github.com/rust-lang/rust-analyzer/issues/12810
2022-08-05 12:55:36 +00:00
Lukas Wirth
8aa50e08af Simplify 2022-08-05 14:54:14 +02:00
Maybe Waffle
a7c45ec867 improve documentation of pointer::align_offset 2022-08-05 16:47:49 +04:00
Maybe Waffle
127b6c4c18 cleanup code w/ pointers in std a little 2022-08-05 16:47:49 +04:00
Lukas Wirth
352d3c6e50 Fix visibilities 2022-08-05 14:28:36 +02:00
Maybe Waffle
743ad07c4b Improve diagnostics for const a: = expr; 2022-08-05 16:19:28 +04:00
Lukas Wirth
d6e78b04d0 feat: Handle operators like their trait functions in the IDE 2022-08-05 14:16:36 +02:00
yukang
2b15fc6d9a recover require,include instead of use in item 2022-08-05 19:20:03 +08:00
Guillaume Gomez
46d17d6aaa remove Clean trait implementation for hir::TraitItem 2022-08-05 12:08:32 +02:00
Lukas Wirth
6a1737242b Don't switch workspace on vfs file changes from libraries
When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.
2022-08-05 12:06:42 +02:00
Guillaume Gomez
38083acde2 remove Clean trait implementation for hir::PolyTraitRef 2022-08-05 12:01:30 +02:00