Commit Graph

209164 Commits

Author SHA1 Message Date
Mark Rousskov
5984b1d86f Revert "Make the c feature for compiler-builtins opt-in instead of inferred"
This reverts commit 3acb505ee5
(PR ).

The changes in this commit caused several bugs or at least
incompatibilies. For now we're reverting this commit and will re-land it
alongside fixes for those bugs.
2022-10-29 10:49:05 -04:00
Mark Rousskov
4cc03c16ad Bump to 1.67.0 2022-10-29 10:28:52 -04:00
bors
68c836a904 Auto merge of - GuillaumeGomez:rollup-hfyxccr, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 -  (compiletest: Refactor test rustcflags)
 -  (Prevent foreign Rust exceptions from being caught)
 -  (filter candidates in pick probe for diagnostics)
 -  (Rename some `OwnerId` fields.)
 -  (Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions)
 -  (Add missing impl blocks for item reexported from private mod in JSON output)
 -  (Emit proper error when casting to `dyn*`)
 -  (fix typo in `try_reserve` method from `HashMap` and `HashSet`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-29 14:14:08 +00:00
Ralf Jung
d366471e58 interpret: fix align_of_val on packed types 2022-10-29 15:58:32 +02:00
Guillaume Gomez
6425764045
Rollup merge of - joseluis:fix-typos-try-reserve, r=the8472
fix typo in `try_reserve` method from `HashMap` and `HashSet`

Currently refers to the `reserve` method, instead of `try_reserve`. Other collections like [Vec](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.try_reserve) & [VecDeque](https://doc.rust-lang.org/std/collections/vec_deque/struct.VecDeque.html#method.try_reserve) shows it well.
2022-10-29 14:18:05 +02:00
Guillaume Gomez
679771f147
Rollup merge of - compiler-errors:dyn-star-cast-bad, r=TaKO8Ki
Emit proper error when casting to `dyn*`

Fixes 
2022-10-29 14:18:05 +02:00
Guillaume Gomez
05ab16b54e
Rollup merge of - GuillaumeGomez:missing-impl-private-json, r=notriddle
Add missing impl blocks for item reexported from private mod in JSON output

Fixes .

Since we don't inline for the JSON output, the impl blocks from private modules are not present when we generate the output. To go around this limitation, in case the impl block doesn't have `#[doc(hidden)]` and is implementing a public item, we don't strip it.

cc `@fmease` `@aDotInTheVoid`
r? `@notriddle`
2022-10-29 14:18:04 +02:00
Guillaume Gomez
2414a4c31a
Rollup merge of - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errors
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions

Functions in answer:

- `Ty::is_freeze`
- `Ty::is_sized`
- `Ty::is_unpin`
- `Ty::is_copy_modulo_regions`

This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3

r? `@compiler-errors`
2022-10-29 14:18:03 +02:00
Guillaume Gomez
692a22e735
Rollup merge of - nnethercote:rename-OwnerId-fields, r=compiler-errors
Rename some `OwnerId` fields.

`@spastorino` noticed some silly expressions like `item_id.def_id.def_id`.

This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`.

`item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.

r? `@compiler-errors`
2022-10-29 14:18:03 +02:00
Guillaume Gomez
07b5c6bdaa
Rollup merge of - compiler-errors:tiny-perf-increase-on-diagnostic, r=TaKO8Ki
filter candidates in pick probe for diagnostics

Fixes , though also fine with closing this PR if my opinion (https://github.com/rust-lang/rust/issues/103411#issuecomment-1287900069) is shared that this doesn't need to  be fixed.

```
~/rust3$ time rustc +nightly ~/test.rs 2>/dev/null

real    0m4.853s
user    0m4.837s
sys     0m0.016s

~/rust3$ time rustc +rust3 ~/test.rs 2>/dev/null

real    0m0.193s
user    0m0.169s
sys     0m0.024s
```

Also fixes .
2022-10-29 14:18:02 +02:00
Guillaume Gomez
6dd64d38a3
Rollup merge of - nbdd0121:panic, r=Amanieu
Prevent foreign Rust exceptions from being caught

Fix 

Use the address of a static variable (which is guaranteed to be unique per copy of std) to tell apart if a Rust exception comes from local or foreign Rust code, and abort for the latter.
2022-10-29 14:18:02 +02:00
Guillaume Gomez
73e7c3a429
Rollup merge of - andrewpollack:refactor-test-rustcflags, r=Mark-Simulacrum
compiletest: Refactor test rustcflags

Refactoring `host-rustcflags` and `target-rustcflags` from `Option<String>` to `Vec<String>`

Ref: 

r? `@Mark-Simulacrum`
2022-10-29 14:18:01 +02:00
Guillaume Gomez
4fac361ea3 Fix z-indexes of code example feature and cleanup its CSS 2022-10-29 12:23:10 +02:00
Guillaume Gomez
0ef36b8945 Add regression test for missing item from private mod in JSON output 2022-10-29 11:56:08 +02:00
Guillaume Gomez
f0234f1976 Add missing impl blocks for item reexported from private mod in JSON output 2022-10-29 11:43:29 +02:00
Nicholas Nethercote
c8c25ce5a1 Rename some OwnerId fields.
spastorino noticed some silly expressions like `item_id.def_id.def_id`.

This commit renames several `def_id: OwnerId` fields as `owner_id`, so
those expressions become `item_id.owner_id.def_id`.

`item_id.owner_id.local_def_id` would be even clearer, but the use of
`def_id` for values of type `LocalDefId` is *very* widespread, so I left
that alone.
2022-10-29 20:28:38 +11:00
bors
33b530e040 Auto merge of - matthiaskrgr:rollup-kajt3i8, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 -  (Make `CStr::from_ptr` `const`.)
 -  (Add test for issue 98634)
 -  (Note scope of TAIT more accurately)
 -  (Specialize ToString for Symbol)
 -  (rustdoc: remove redundant CSS/DOM `div.search-container`)
 -  (rustdoc-json-types: Improve ItemSummary::path docs)
 -  (Add a test for TAIT used with impl/dyn Trait inside RPIT)

Failed merges:

 -  (Rename some `OwnerId` fields.)

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-29 09:21:35 +00:00
joseLuís
4b353132f5 fix typo in hashmap and hashset try_reserve method 2022-10-29 11:01:06 +02:00
bors
e729db172a Auto merge of - RalfJung:futex-wait-no-isolate, r=RalfJung
Support timeouts with monotonic clocks even when isolation is enabled

With the deterministic monotonic clock support we now have, we can allow some synchronization primitives with timeouts even under isolation:
- Linux futex waiting (when set to the monotonic clock)
- pthread_cond_timedwait (when set to the monotonic clock)
- Windows WaitOnAddress

Unfortunately none of these exist on macOS -- the standard library always uses the system clock for timeouts on macOS, so that will still require `-Zmiri-disable-isolation`.
2022-10-29 09:00:14 +00:00
Vadim Petrochenkov
d0805321d5 rustc_metadata: Encode even less doc comments 2022-10-29 12:56:33 +04:00
bors
ba28e19b78 Auto merge of - lowr:feat/gats, r=flodiebold
Clean up tests and add documentation for GATs related stuff

This is a follow-up PR for .

- addresses https://github.com/rust-lang/rust-analyzer/pull/13494#discussion_r1006774897
- documents the ordering constraint on `Binders` and `Substitution` (which is not really follow-up for the previous PR, but it was introduced to support GATs and I strongly feel it's worth it)
2022-10-29 08:54:14 +00:00
Takayuki Maeda
a3a3f4d840 avoid unnecessary &str to String conversions 2022-10-29 17:14:44 +09:00
Tshepang Mbambo
a36a37e5a8 use consistent terminology
I did not see other traits using the "interface" word
2022-10-29 09:23:12 +02:00
Matthias Krüger
cc8040e734
Rollup merge of - xxchan:xxchan/applicable-bug, r=compiler-errors
Add a test for TAIT used with impl/dyn Trait inside RPIT

close https://github.com/rust-lang/rust/issues/101750
2022-10-29 08:57:37 +02:00
Matthias Krüger
2ea6611199
Rollup merge of - aDotInTheVoid:rdj-path-docs, r=Urgau,GuillaumeGomez
rustdoc-json-types: Improve ItemSummary::path docs

Somewhat inspired by the doc changes from  (cc ``@Urgau)``

r? ``@GuillaumeGomez``
2022-10-29 08:57:37 +02:00
Matthias Krüger
f0eaa48569
Rollup merge of - notriddle:notriddle/search-container, r=GuillaumeGomez
rustdoc: remove redundant CSS/DOM `div.search-container`

Preview: https://notriddle.com/notriddle-rustdoc-demos/search-container/test_dingus/fn.test.html

This wrapper DIV was originally added in 89e1fb3223, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be        removed	using flexbox.
2022-10-29 08:57:36 +02:00
Matthias Krüger
f41b1bfd0f
Rollup merge of - camsteffen:symbol-to-string, r=compiler-errors
Specialize ToString for Symbol
2022-10-29 08:57:36 +02:00
Matthias Krüger
790a716420
Rollup merge of - compiler-errors:tait-scope, r=oli-obk
Note scope of TAIT more accurately

This maybe explains why the person was confused in , since we say "same module" but really should've said "same impl".

r? ``@oli-obk``
2022-10-29 08:57:35 +02:00
Matthias Krüger
67c469faf0
Rollup merge of - Rageking8:add-test-for-issue-98634, r=compiler-errors
Add test for issue 98634

Fixes 
2022-10-29 08:57:35 +02:00
Matthias Krüger
b3ca68f9e9
Rollup merge of - reitermarkus:const-cstr-from-ptr, r=oli-obk
Make `CStr::from_ptr` `const`.

Should be included in https://github.com/rust-lang/rust/issues/101719.

cc ``@WaffleLapkin``
2022-10-29 08:57:34 +02:00
bors
607878d069 Auto merge of - michaelwoerister:unord-collections, r=lncr
Introduce UnordMap, UnordSet, and UnordBag (MCP 533)

This is the start of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).

I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)`

r? `@eddyb`
2022-10-29 06:20:48 +00:00
bors
33b55ac39f Auto merge of - petrochenkov:effvis, r=jackh726
privacy: Rename "accessibility levels" to "effective visibilities"

And a couple of other naming and comment tweaks.

Related to https://github.com/rust-lang/rust/issues/48054

For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often.
So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
2022-10-29 03:08:59 +00:00
bors
ebce5e923c Auto merge of - Veykril:vscode-workspace-changes, r=Veykril
Properly handle vscode workspace changes
2022-10-28 23:41:22 +00:00
Lukas Wirth
fccf8eb1fd Properly handle vscode workspace changes 2022-10-29 01:41:02 +02:00
bors
7174231ae6 Auto merge of - RalfJung:poll_fn_pin, r=Mark-Simulacrum
poll_fn and Unpin: fix pinning

See [IRLO](https://internals.rust-lang.org/t/surprising-soundness-trouble-around-pollfn/17484) for details: currently `poll_fn` is very subtle to use, since it does not pin the closure, so creating a `Pin::get_unchcked(&mut capture)` inside the closure is unsound. This leads to actual miscompilations with `futures::join!`.

IMO the proper fix is to pin the closure when the future is pinned, which is achieved by changing the `Unpin` implementation. This is a breaking change though. 1.64.0 was *just* released, so maybe this is still okay?

The alternative would be to add some strong comments to the docs saying that closure captures are *not pinned* and doing `Pin::get_unchecked` on them is unsound.
2022-10-28 23:27:33 +00:00
bors
7610ee9139 Auto merge of - Veykril:startup-commands, r=Veykril
Always set up VSCode commands
2022-10-28 22:51:52 +00:00
Lukas Wirth
2071d00fd2 Always set up VSCode commands 2022-10-29 00:44:37 +02:00
Cameron Steffen
298253af98 Specialize ToString for Symbol 2022-10-28 16:42:47 -05:00
bors
e69014a81e Auto merge of - Veykril:status-click, r=Veykril
feat: Clicking the status bar item stops and starts the server
2022-10-28 21:12:27 +00:00
Lukas Wirth
274df54885 feat: Clicking the status bar item stops and starts the server 2022-10-28 23:10:10 +02:00
xxchan
6bc5fddc00 Add a test for TAIT used with impl/dyn Trait inside RPIT 2022-10-28 22:58:19 +02:00
Ralf Jung
c8a5d4b600 relative futex and condvar timeouts can work with isolation 2022-10-28 22:54:50 +02:00
bors
a0fbf0d077 Auto merge of - RalfJung:windows-parking, r=RalfJung
Implement thread parking for Windows

Cc https://github.com/rust-lang/miri/issues/2628

Based on code by `@DrMeepster.` However I adjusted `WakeByAddressSingle`: I don't think the futex value is compared *again* after the thread is woken up. I see nothing in the Windows docs indicating such a comparison, and the Linux futex does not behave like that either. So we only check the value before sleeping, same as on Linux.
2022-10-28 20:19:28 +00:00
Nilstrieb
29e50e8d35
Gate some recovery behind a flag
Mainly in `expr.rs`
2022-10-28 22:07:36 +02:00
bors
9565dfeb4e Auto merge of - fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk
Retain ParamEnv constness when running deferred cast checks

Fixes .
2022-10-28 19:28:41 +00:00
Michael Goulet
c4420135fe Emit proper error when casting to Ddyn-star 2022-10-28 17:33:06 +00:00
bors
77e7b74ad5 Auto merge of - wesleywiser:fix_inlined_line_numbers, r=davidtwco
Fix line numbers for MIR inlined code

`should_collapse_debuginfo` detects if the specified span is part of a
macro expansion however it does this by checking if the span is anything
other than a normal (non-expanded) kind, then the span sequence is
walked backwards to the root span.

This doesn't work when the MIR inliner inlines code as it creates spans
with expansion information set to `ExprKind::Inlined` and results in the
line number being attributed to the inline callsite rather than the
normal line number of the inlined code.

Fixes 
2022-10-28 16:27:56 +00:00
Samuel Moelius
86a4009586 Add walk_generic_arg 2022-10-28 10:36:42 -04:00
Ralf Jung
9b0cdf9a6e cleanup some test cfg 2022-10-28 16:24:56 +02:00
Ralf Jung
40e340e9fb test most sync primitives on Windows 2022-10-28 16:24:56 +02:00