Commit Graph

208641 Commits

Author SHA1 Message Date
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
yukang
1225c3f6b8 fix #103112, add diagnostic for calling a function with the same name when a Macro is not found 2022-10-20 11:55:30 +08:00
bors
ebdde35dce Auto merge of #103205 - spastorino:fix-rpits-lifetime-remapping, r=cjgillot
Do anonymous lifetimes remapping correctly for nested rpits

Closes #103141

r? `@cjgillot` `@nikomatsakis`

This fixes a stable to stable regression that in my opinion is `P-critical` so, we probably want to backport it all the way up to stable.
2022-10-20 03:07:17 +00:00
Cliff L. Biffle
845662e1c0 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.
2022-10-19 19:33:02 -07:00
Ryan Lopopolo
531679684c
Update stability annotations on fnptr impls for C-unwind ABI 2022-10-19 19:17:32 -07:00
Ryan Lopopolo
d0a33f25d5
Bless ui tests 2022-10-19 19:17:32 -07:00
Ryan Lopopolo
16dd5737b0
Add default trait implementations for "c-unwind" ABI function pointers
Following up on #92964, only add default trait implementations for the
`c-unwind` family of function pointers. The previous attempt in #92964
added trait implementations for many more ABIs and ran into concerns
regarding the increase in size of the libcore rlib.

An attempt to abstract away function pointer types behind a unified
trait to reduce the duplication of trait impls is being discussed in #99531
but this change looks to be blocked on a lang MCP.

Following @RalfJung's suggestion in
https://github.com/rust-lang/rust/pull/99531#issuecomment-1233440142,
this commit is another cut at #92964 but it _only_ adds the impls for
`extern "C-unwind" fn` and `unsafe extern "C-unwind" fn`.

I am interested in landing this patch to unblock the stabilization of
the `c_unwind` feature.

RFC: https://github.com/rust-lang/rfcs/pull/2945
Tracking Issue: https://github.com/rust-lang/rust/issues/74990
2022-10-19 19:17:32 -07:00
Finn Bear
4f44d6253d Put fn in the right place. 2022-10-19 19:15:58 -07:00
Finn Bear
f81cd87eea Copy of #102941. 2022-10-19 19:07:45 -07:00
Andrew Pollack
205006660a Adjusting test to needs-unwind, with linking issue 2022-10-20 01:04:39 +00:00
Thom Chiovoloni
4b66432268
Update libstd's libc to 0.2.135 2022-10-19 17:54:55 -07:00
bors
cb9467515b Auto merge of #102417 - oli-obk:opaque_lifetimes2, r=jackh726
Require lifetime bounds for opaque types in order to allow hidden types to capture said lifetimes

fixes #96996

cc `@aliemjay`
2022-10-20 00:22:17 +00:00
Michael Goulet
c5c9f74829 Erase regions before checking for default in uninitialized binding error 2022-10-19 23:36:28 +00:00
clubby789
19bc8fb05a Remove extra spaces 2022-10-19 23:54:00 +01:00
bors
57781b24c5 Auto merge of #103264 - matthiaskrgr:rollup-3ja4spo, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #103211 (rustdoc: remove class name `location` from sidebar sibling nav)
 - #103223 (Use already checked RHS ty for LHS deref suggestions)
 - #103237 (Clean up codeblock-tooltip rustdoc-gui test)
 - #103239 (Allow #[unstable] impls for fn() with unstable abi.)
 - #103246 (Mark `rust-analyzer` as a host-only tool)
 - #103257 (rustdoc: move `setting-line` color CSS to settings.css)
 - #103258 (Make miri read_dir test a little more robust)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-10-19 21:17:09 +00:00
Michael Howell
0dd329f687 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-19 13:57:39 -07:00
Santiago Pastorino
49ce8a22b0
Do anonymous lifetimes remapping correctly for nested rpits 2022-10-19 16:49:39 -03:00
Santiago Pastorino
fb5475887f
Extract orig_opt_local_def_id as a function 2022-10-19 16:49:39 -03:00
Matthias Krüger
652417e332
Rollup merge of #103258 - SUPERCILEX:miri, r=RalfJung
Make miri read_dir test a little more robust

r? `@RalfJung`
2022-10-19 21:38:42 +02:00
Matthias Krüger
952c15622a
Rollup merge of #103257 - notriddle:notriddle/setting-line, r=GuillaumeGomez
rustdoc: move `setting-line` color CSS to settings.css
2022-10-19 21:38:42 +02:00
Matthias Krüger
e85def73b5
Rollup merge of #103246 - ferrocene:pa-rust-analyzer-hosts, r=Mark-Simulacrum
Mark `rust-analyzer` as a host-only tool

All tools meant to be shipped with host toolchains only should be marked as `ONLY_HOSTS = true`, but rust-analyzer was marked as `ONLY_HOSTS = false` incorrectly. This meant that bootstrap attempted to build rust-analyzer for cross-compilation-only targets, causing errors because libstd is not present on some of them.

It will still be possible to cross-compile rust-analyzer by passing a different `--host` flag to `./x`, like you can cross-compile other tools.

The problem can be reproduced by running:

```
./x build src/tools/rust-analyzer --target x86_64-unknown-linux-gnu,aarch64-unknown-none
```
2022-10-19 21:38:41 +02:00
Matthias Krüger
12775ce16a
Rollup merge of #103239 - m-ou-se:unstable-abi-fn-impl-check, r=lcnr
Allow #[unstable] impls for fn() with unstable abi.

This allows `#[unstable]` trait impls for `extern "unwind-C" fn()`, based on the fact that that abi and therefore that type is unstable.

See https://github.com/rust-lang/rust/pull/101263#issuecomment-1283099947
2022-10-19 21:38:41 +02:00
Matthias Krüger
d17cef67a2
Rollup merge of #103237 - GuillaumeGomez:codeblock-tooltip-cleanup, r=notriddle
Clean up codeblock-tooltip rustdoc-gui test

r? ``@notriddle``
2022-10-19 21:38:40 +02:00
Matthias Krüger
e500dcb8cb
Rollup merge of #103223 - compiler-errors:deref-sugg-slow, r=wesleywiser
Use already checked RHS ty for LHS deref suggestions

There's no reason to do the `check_lhs_assignable` and RHS `check_expr_with_hint` in that order, so invert them and use the typeck results to avoid exponential blowup on error.

Fixes #103219
2022-10-19 21:38:40 +02:00
Matthias Krüger
433f736b86
Rollup merge of #103211 - notriddle:notriddle/dot-location, r=GuillaumeGomez
rustdoc: remove class name `location` from sidebar sibling nav

Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-location/std/vec/struct.Vec.html

This change tweaks the CSS to apply most of its styles to `.sidebar h2`, cleaning up a few redundant rules from `.mobile-topbar .location` and restoring useful navigation aids in mobile mode.

## Before

![location-before](https://user-images.githubusercontent.com/1593513/196521014-d8730830-c3a2-4ed7-9266-05454cd31e05.png)

## After

![location-after](https://user-images.githubusercontent.com/1593513/196521020-75ec1fa5-b3dc-4c5d-97b6-afccb5fbe00a.png)
2022-10-19 21:38:39 +02:00
Guillaume Gomez
b4e06a74ca Add regression test for item-decl highlighting 2022-10-19 21:03:11 +02:00
Alex Saveau
b0f693552d
Make miri read_dir test a little more robust
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-10-19 11:48:56 -07:00
Josh Stone
f8e157b33f Fixup a few tests needing asm support 2022-10-19 11:34:00 -07:00
Michael Goulet
6b0ef9c810 Deny const variables as well 2022-10-19 17:11:40 +00:00
Michael Goulet
1e2eb97c6e Don't call own_existential_vtable_entries on unresolved trait ref 2022-10-19 17:11:40 +00:00
Michael Goulet
a6b5f95fb0 Make ClosureOutlivesRequirement not rely on an unresolved type 2022-10-19 17:10:59 +00:00
Michael Goulet
91af4f5d0b Don't hash non-fresh Ty::Infer or RegionKind::Infer 2022-10-19 17:10:58 +00:00
Michael Howell
db570586a5 rustdoc: move setting-line color CSS to settings.css 2022-10-19 09:24:09 -07:00