Commit Graph

208623 Commits

Author SHA1 Message Date
Matthias Krüger
c6a680ebc5
Rollup merge of #103288 - johnmatthiggins:master, r=thomcc
Fixed docs typo in `library/std/src/time.rs`

* Changed comment from `Previous rust versions panicked when self was earlier than the current time.` to `Previous rust versions panicked when the current time was earlier than self.`
* Resolves #103282.
2022-10-20 22:42:39 +02:00
Matthias Krüger
cfb424a044
Rollup merge of #103281 - thomcc:long-overdue, r=jyn514
Adjust `transmute{,_copy}` to be clearer about which of `T` and `U` is input vs output

This is essentially a documentation-only change (although it does touch code in an irrelevant way).
2022-10-20 22:42:39 +02:00
Matthias Krüger
be4816fbf0
Rollup merge of #103230 - nnethercote:clarify-startup, r=jyn514
Clarify startup

A small follow-up to #102769.

r? `@jyn514`
2022-10-20 22:42:38 +02:00
Matthias Krüger
7ee4b218a8
Rollup merge of #103221 - TaKO8Ki:fix-103202, r=oli-obk
Fix `SelfVisitor::is_self_ty` ICE

Fixes #103202
2022-10-20 22:42:38 +02:00
Michael Howell
f6dd4708cf rustdoc: improve appearance of source page navigation bar
This commit changes things so that the search bar is exactly centered between
the top of the page and the top of the source code content area.
2022-10-20 13:31:06 -07:00
DrMeepster
7e56e773de change rust version to fix CI 2022-10-20 22:19:06 +02:00
DrMeepster
b649b96bc8 remove redundant Ok(...?) 2022-10-20 22:19:06 +02:00
DrMeepster
7cf32a7d47 code reuse for sync ids 2022-10-20 22:19:06 +02:00
DrMeepster
7ca6b175b4 use Default derive for InitOnceStatus 2022-10-20 22:19:06 +02:00
DrMeepster
22d06f9754 update rust version 2022-10-20 22:19:06 +02:00
DrMeepster
342251cb64 add test for init once 2022-10-20 22:19:06 +02:00
DrMeepster
3244c117f8 add windows one time initialization 2022-10-20 22:19:06 +02:00
Deadbeef
ebf5028574 Improve "~const is not allowed here" message 2022-10-20 19:32:16 +00:00
Michael Goulet
8509819aef Elaborate supertrait bounds when triggering unused_must_use on impl Trait 2022-10-20 17:31:01 +00:00
Ralf Jung
bf14e3196b interpret: remove an incorrect assertion 2022-10-20 19:06:34 +02:00
Michael Goulet
47f816cd4c no test in testsuite label 2022-10-20 16:46:05 +00:00
bors
5ffa67d730 Auto merge of #103092 - petrochenkov:weaklto, r=wesleywiser
linker: Fix weak lang item linking with combination windows-gnu + LLD + LTO

In https://github.com/rust-lang/rust/pull/100404 this logic was originally disabled for MSVC due to issues with LTO, but the same issues appear on windows-gnu with LLD because that LLD uses the same underlying logic as MSVC LLD, just with re-syntaxed command line options.

So this PR just disables it for LTO builds in general.
2022-10-20 16:20:50 +00:00
lcnr
8eb2b75a11 add increased recursion limit 2022-10-20 18:03:28 +02:00
lcnr
b076f03496 rustc_hir_typeck: fix clippy 2022-10-20 17:53:14 +02:00
lcnr
fb3ab13a1c rustc_hir_typeck: fix paths and partially mv files 2022-10-20 17:53:14 +02:00
lcnr
f468a90bad rustc_hir_typeck: move whole files 2022-10-20 17:53:14 +02:00
bors
967f172e25 Auto merge of #9635 - smoelius:fix-9386-bug, r=Jarcho
Fix bug introduced by #9386

#9386 introduced a potential out-of-bounds array access. Specifically, a location returned by `local_assignments` could have  [`location.statement_index` equal to `mir.basic_blocks[location.block].statements.len()`](b8a9a507bf/clippy_utils/src/mir/mod.rs (L129)), in which case the location would refer to the block terminator:
b8a9a507bf/clippy_lints/src/dereference.rs (L1204-L1206)
I suspect the bug is not triggerable now, because of checks leading up to where it occurs. But a future code change could make it triggerable. Hence, it should be fixed.

r? `@Jarcho`

changelog: none
2022-10-20 15:18:31 +00:00
bors
4612fdfa7b Auto merge of #9670 - Alexendoo:missing-trait-methods, r=Jarcho
Add `missing_trait_methods` lint

Closes #9661

changelog: new lint: [`missing_trait_methods`]
2022-10-20 15:05:06 +00:00
Dan Gohman
e56b84e844 Mark std::os::wasi::io::AsFd etc. as stable.
io_safety was stabilized in Rust 1.63, so mark the io_safety exports in
`std::os::wasi::io` as stable.

Fixes #103306.
2022-10-20 08:04:19 -07:00
yukang
eb68e27e4c fix rust-lang#101880: suggest let for assignment, and some code refactor 2022-10-20 22:54:02 +08:00
bors
a4e872602b Auto merge of #9680 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

I ran out of time and will have to do the Clippy->Rust sync tomorrow.

changelog: none
2022-10-20 14:43:03 +00:00
Philipp Krones
4ff2364ff7
Bump nightly version -> 2022-10-20 2022-10-20 16:39:44 +02:00
Philipp Krones
fb8ecb9832
Merge remote-tracking branch 'upstream/master' into rustup 2022-10-20 16:39:27 +02:00
Ryan Lopopolo
efe61dab21
Skip C-unwind fn pointer impls with the bootstrap compiler
These need to wait until #103239 makes it into the bootstrap compiler.
2022-10-20 07:37:17 -07:00
Caio
c74165d443 Move some tests for more reasonable places 2022-10-20 11:08:44 -03: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
yukang
2414357374 fix assertion failed for break_last_token and trailing token 2022-10-20 20:16:27 +08:00
bors
4dcf51b08f Auto merge of #2606 - cbiffle:nostdio, r=RalfJung
Magic functions for writing to stdout/stderr.

This enables I/O in no_std contexts (or, really, any Miri-specific OS-independent context). Combined with the `abort` intrinsic it should allow a reasonable test framework in no_std.

**Question for maintainers:** So, the `no_std` panic test needs work, for two reasons:

- First, its stdout includes Miri's whole message about the abort intrinsic having been used. I guess whatever panic handler you use in `std` contexts exits cleanly without triggering this message. Comparing the entire output with backtrace as golden seems fragile.
- Second, likely for the same reason, the test framework appears to expect the test to exit successfully, when in fact it exits with status 1 due to the abort. This means the test doesn't actually pass right now.

What shall I do there?
2022-10-20 11:09:41 +00:00
Alex Macleod
b6a860e0ed Add missing_trait_methods lint 2022-10-20 11:02:48 +00:00
bors
53728ff751 Auto merge of #103185 - chenyukang:yukang/fix-span-next-point, r=davidtwco
Fix the bug of next_point in source_map

There is a bug in `next_point`, the new span won't move to next position when be called in the first time.

For this reason, our current code is working like this:
1. When we really want to move to the next position, we called two times of `next_point`
2. Some code which use `next_point` actually done the same thing with `shrink_to_hi`

This fix make sure when `next_point` is called, span will move with the width at least 1, and also work correctly in the scenario of multiple bytes.

Ref: https://github.com/rust-lang/rust/pull/103140#discussion_r997710998

r? `@davidtwco`
2022-10-20 10:40:09 +00:00
cui fliter
ed1f02bcb5 fix typo 2022-10-20 18:00:36 +08:00
Guillaume Gomez
8e3b89140e Add GUI tests for collapse/expand actions 2022-10-20 11:35:12 +02:00
Guillaume Gomez
d3c37b1dfa +/- shortcut now only expand/collapse, not both 2022-10-20 11:35:08 +02:00
Kevin Per
28d0312b7d Implement assertions and fixes to not emit empty spans without suggestions 2022-10-20 08:25:31 +00:00
Matthias Krüger
e29ecb70af
Rollup merge of #103276 - compiler-errors:default-on-uninit-ice, r=TaKO8Ki
Erase regions before checking for `Default` in uninitialized binding error

Fixes #103250
2022-10-20 07:58:58 +02:00
Matthias Krüger
1f210238a0
Rollup merge of #103272 - clubby789:extra-spaces, r=thomcc
Remove extra spaces in docs

Removing some random extra spaces in the examples for `core::sync::atomic`.

r? `@thomcc`
2022-10-20 07:58:57 +02:00
Matthias Krüger
f8dfddb98c
Rollup merge of #103268 - notriddle:notriddle/nav-sub-font-size, r=GuillaumeGomez
rustdoc: remove no-op CSS `nav.sub { font-size: 1rem }`

This rule originated as a `font-size: 16px`, when body had `font-size: 13px` set in 4fd061c426.

It remained even when body's font size was bumped up to 16px, 4d5f4ff5e9, making the rule a no-op, and was carried forward when it was converted to 1rem in cc18120425.
2022-10-20 07:58:57 +02:00
Matthias Krüger
56ff29484e
Rollup merge of #103262 - andrewpollack:switch-needs-unwind, r=tmandry
Adjusting test to needs-unwind, with linking issue

Test requires `needs-unwind` (see linked issue #103261)
2022-10-20 07:58:56 +02:00
Matthias Krüger
e5514b9377
Rollup merge of #103251 - GuillaumeGomez:item-decl-highlighting, r=notriddle
Fix item declaration highlighting

Fixes https://github.com/rust-lang/rust/issues/103050.

As mentioned in the issue, https://github.com/rust-lang/rust/pull/102924 introduced this regression. This PR partially reverts it and adds a regression test.

r? `@notriddle`
2022-10-20 07:58:56 +02:00
Matthias Krüger
62bb0c6fdd
Rollup merge of #103197 - est31:stabilize_proc_macro_source_text, r=petrochenkov
Stabilize proc_macro::Span::source_text

Splits `proc_macro::Span::source_text` into a new feature gate and stabilizes it. The [FCP is complete](https://github.com/rust-lang/rust/issues/101991#issuecomment-1279393265).

```Rust
impl Span {
    pub fn source_text(&self) -> Option<String>;
}
```

Closes #101991
2022-10-20 07:58:55 +02:00
bors
4b3b731b55 Auto merge of #103220 - compiler-errors:deny-infers, r=lcnr
Deny hashing ty/re/ct inference variables

cc `@cjgillot` and https://github.com/rust-lang/rust/pull/102695#issuecomment-1275706528
r? `@lcnr`

best reviewed one commit at a time, mostly because the second commit that fixes `ClosureOutlivesRequirement` is mostly noise because of losing its `<'tcx>` lifetime parameter.
2022-10-20 05:56:56 +00:00
Thom Chiovoloni
afd08175de
Adjust transmute{,_copy} to be clearer about which of T and U is input vs output 2022-10-19 22:36:14 -07:00
Takayuki Maeda
9a9e2fe15f check if impl_self is Some 2022-10-20 14:10:52 +09:00
John Higgins
a3ccb193be
Fixed docs typo in library/std/src/time.rs 2022-10-19 21:49:29 -07:00
yukang
f90bf50d47 fix span for suggestion 2022-10-20 11:55:30 +08:00