Commit Graph

209016 Commits

Author SHA1 Message Date
Cameron Steffen
f808430497 Factor out ITEM_REFS 2022-10-29 16:04:10 -05:00
Cameron Steffen
ebfa1f0185 Encode LangItem directly 2022-10-29 16:04:10 -05:00
Cameron Steffen
99de57ae13 Improve LanguageItems api 2022-10-29 16:04:04 -05:00
Vadim Petrochenkov
f1850d4c9b rustc_middle: Remove unnecessary type parameter from AccessLevels 2022-10-29 23:36:56 +04:00
Vadim Petrochenkov
90f27f93bd rustdoc: Split effective visibilities from rustc from similar data built by rustdoc for external def-ids 2022-10-29 23:36:52 +04:00
Vadim Petrochenkov
3f21bdd994 rustdoc: Simplify modifications of effective visibility table 2022-10-29 23:17:17 +04:00
Mark Rousskov
3f56a823f2 1.65.0 release notes
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
Co-authored-by: Christopher Serr <christopher.serr@gmail.com>
Co-authored-by: memoryruins <michael@memoryruins.com>
Co-authored-by: Alexander Ronald Altman <alexanderaltman@me.com>
2022-10-29 15:07:00 -04:00
Mark Rousskov
b0db70e203 Drop miri cross-compile check for Windows 2022-10-29 14:24:44 -04:00
bors
5e97720429 Auto merge of #103450 - cjgillot:elision-nodedup, r=Mark-Simulacrum
Do not consider repeated lifetime params for elision.

Fixes https://github.com/rust-lang/rust/issues/103330
2022-10-29 17:32:45 +00:00
Michael Howell
a3c56e0428 rustdoc: remove unnecessary .search-results { padding-bottom }
There's nothing underneath it anyway. The conversation on
b615c0c854 never really spelled out why it
was added.
2022-10-29 09:59:53 -07:00
Michael Howell
d490ff461c rustdoc: use CSS margin/padding shorthand when all are being set 2022-10-29 09:04:31 -07:00
Kitsu
137271ad73 Run rustfix test for 103317 case 2022-10-29 18:44:24 +03:00
Mark Rousskov
5984b1d86f Revert "Make the c feature for compiler-builtins opt-in instead of inferred"
This reverts commit 3acb505ee5
(PR #101833).

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 #103727 - GuillaumeGomez:rollup-hfyxccr, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #102634 (compiletest: Refactor test rustcflags)
 - #102721 (Prevent foreign Rust exceptions from being caught)
 - #103415 (filter candidates in pick probe for diagnostics)
 - #103618 (Rename some `OwnerId` fields.)
 - #103625 (Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions)
 - #103653 (Add missing impl blocks for item reexported from private mod in JSON output)
 - #103699 (Emit proper error when casting to `dyn*`)
 - #103719 (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
Guillaume Gomez
6425764045
Rollup merge of #103719 - 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 #103699 - compiler-errors:dyn-star-cast-bad, r=TaKO8Ki
Emit proper error when casting to `dyn*`

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

Fixes #102583.

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 #103625 - 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 #103618 - 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 #103415 - compiler-errors:tiny-perf-increase-on-diagnostic, r=TaKO8Ki
filter candidates in pick probe for diagnostics

Fixes #103411, 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 #103427.
2022-10-29 14:18:02 +02:00
Guillaume Gomez
6dd64d38a3
Rollup merge of #102721 - nbdd0121:panic, r=Amanieu
Prevent foreign Rust exceptions from being caught

Fix #102715

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 #102634 - andrewpollack:refactor-test-rustcflags, r=Mark-Simulacrum
compiletest: Refactor test rustcflags

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

Ref: #102438

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 #103714 - matthiaskrgr:rollup-kajt3i8, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

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

Failed merges:

 - #103618 (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 #2631 - 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
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 #103704 - 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 #103664 - aDotInTheVoid:rdj-path-docs, r=Urgau,GuillaumeGomez
rustdoc-json-types: Improve ItemSummary::path docs

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

r? ``@GuillaumeGomez``
2022-10-29 08:57:37 +02:00
Matthias Krüger
f0eaa48569
Rollup merge of #103663 - 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 #103656 - 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 #103383 - compiler-errors:tait-scope, r=oli-obk
Note scope of TAIT more accurately

This maybe explains why the person was confused in #101897, 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 #103342 - Rageking8:add-test-for-issue-98634, r=compiler-errors
Add test for issue 98634

Fixes #98634
2022-10-29 08:57:35 +02:00
Matthias Krüger
b3ca68f9e9
Rollup merge of #102961 - 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 #102698 - 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 #102233 - 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
7174231ae6 Auto merge of #102737 - 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
Cameron Steffen
298253af98 Specialize ToString for Symbol 2022-10-28 16:42:47 -05: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 #2630 - 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
bors
9565dfeb4e Auto merge of #103683 - fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk
Retain ParamEnv constness when running deferred cast checks

Fixes #103677.
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 #103071 - 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 #103068
2022-10-28 16:27:56 +00:00
Ralf Jung
9b0cdf9a6e cleanup some test cfg 2022-10-28 16:24:56 +02:00