Commit Graph

168925 Commits

Author SHA1 Message Date
Michael Goulet
d1a9a95517 Make Lazy not care about lifetimes until decode 2022-05-24 15:54:44 -07:00
Jane Losare-Lusby
9a9dafcca4 explained unwrap vs expect 2022-05-24 22:52:30 +00:00
bors
f80e454450 Auto merge of #97372 - JohnTitor:rollup-6owv1v0, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #93966 (document expectations for Waker::wake)
 - #97266 (Make weird name lints trigger behind cfg_attr)
 - #97355 (Remove unused brush image)
 - #97358 (Update minifier-rs version to 0.1.0)
 - #97363 (Fix a small mistake in `SliceIndex`'s documentation)
 - #97364 (Fix weird indentation in continue_keyword docs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-24 22:32:57 +00:00
Michael Goulet
d61d30d9a2 Minor improvement on else-no-if diagnostic 2022-05-24 15:22:13 -07:00
Yuki Okushi
c3fea09208
Rollup merge of #97364 - notriddle:continue-keyword, r=JohnTitor
Fix weird indentation in continue_keyword docs

This format was causing every line in the code examples to have a space at the start.
2022-05-25 07:08:45 +09:00
Yuki Okushi
7ed7f65bac
Rollup merge of #97363 - wackbyte:sliceindex-doc-typo, r=JohnTitor
Fix a small mistake in `SliceIndex`'s documentation

Originally, it said "`get_(mut_)unchecked`," but the method's actual name is `get_unchecked_mut`.
2022-05-25 07:08:44 +09:00
Yuki Okushi
29437d92e1
Rollup merge of #97358 - GuillaumeGomez:update-minifier, r=Dylan-DPC
Update minifier-rs version to 0.1.0

It fixes a bug with regex parsing.

r? `@notriddle`
2022-05-25 07:08:44 +09:00
Yuki Okushi
b66cf9f280
Rollup merge of #97355 - GuillaumeGomez:remove-brush, r=Dylan-DPC
Remove unused brush image

r? `@notriddle`
2022-05-25 07:08:43 +09:00
Yuki Okushi
896a59d8db
Rollup merge of #97266 - est31:unknown_lints_cfg_attr, r=lcnr
Make weird name lints trigger behind cfg_attr

The weird name lints (`unknown_lints`, `renamed_and_removed_lints`), the lints that lint the linting, were previously not firing for lint level declarations behind `cfg_attr`, as they were only running before expansion.

Now, this will give a `unknown_lints` warning:

```Rust
#[cfg_attr(all(), allow(this_lint_does_not_exist))]
fn foo() {}
```

Lint level declarations behind a `cfg_attr` whose condition is not applying are still ignored. So this still won't give a warning:

```Rust
#[cfg_attr(any(), allow(this_lint_does_not_exist))]
fn foo() {}
```

Furthermore, this PR also makes the weird name lints respect level delcarations for *them* that were hidden by `cfg_attr`, making them consistent to other lints. So this will now not issue a warning:

```Rust
#[cfg_attr(all(), allow(unknown_lints))]
mod foo {
    #[allow(does_not_exist)]
    fn foo() {
    }
}
```

Fixes #97094
2022-05-25 07:08:42 +09:00
Yuki Okushi
33f45b167e
Rollup merge of #93966 - rkuhn:patch-1, r=tmandry
document expectations for Waker::wake

fixes #93961

Opened PR for a discussion on the precise wording.
2022-05-25 07:08:41 +09:00
Jakob Degen
0f65bcd920 Modify MIR building to drop foo in [foo; 0] 2022-05-24 15:53:37 -04:00
bors
76761db591 Auto merge of #97360 - RalfJung:rustup, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/97348
r? `@ghost` Cc `@rust-lang/miri`
2022-05-24 19:05:20 +00:00
Michael Howell
1d19462a45 Fix weird indentation in continue_keyword docs
This format was causing every line in the code examples to have a space
at the start.
2022-05-24 11:10:56 -07:00
klensy
2a326bcc74 fix clippy perf lints 2022-05-24 13:35:54 -04:00
wackbyte
ce947735c0
Fix a mistake in SliceIndex's documentation 2022-05-24 13:22:41 -04:00
Oli Scherer
46a23420b6 Update messages 2022-05-24 16:33:06 +00:00
Oli Scherer
d5ffe11cd9 Make a test independent of 64/32 bit 2022-05-24 16:28:57 +00:00
Oli Scherer
ac6b7083c8 Remove outdated comment 2022-05-24 16:28:57 +00:00
Oli Scherer
0d88631059 Add the transmute and asm checks to typeck as deferred checks 2022-05-24 16:28:57 +00:00
klensy
678059f7d0 fix simple clippy lints 2022-05-24 12:24:41 -04:00
bors
fa70b89d19 Auto merge of #97356 - Dylan-DPC:rollup-bhceawj, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #97288 (Lifetime variance fixes for rustdoc)
 - #97298 (Parse expression after `else` as a condition if followed by `{`)
 - #97308 (Stabilize `cell_filter_map`)
 - #97321 (explain how to turn integers into fn ptrs)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-24 16:23:32 +00:00
Oli Scherer
0fdaaadb36 Remove the check_mod_intrinsics query 2022-05-24 15:46:23 +00:00
Ralf Jung
9808073674 update Miri 2022-05-24 17:44:11 +02:00
Oli Scherer
cb886cc164 move intrinsicck to typeck 2022-05-24 15:37:33 +00:00
Oli Scherer
31e0bf7891 trait selection errors should poison the typeck results, too, so that const eval can avoid running at all 2022-05-24 15:37:33 +00:00
est31
2a8b60f915 Emit weird lint name lints after expansion
Previously, we were emitting weird name lints (for renamed or unknown lints)
before expansion, most importantly before cfg expansion.
This meant that the weird name lints would not fire
for lint attributes hidden inside cfg_attr. The same applied
for lint level specifications of those lints.

By moving the lints for the lint names to the post-expansion
phase, these issues are resolved.
2022-05-24 17:27:34 +02:00
Guillaume Gomez
00a380c235 Update minifier-rs version to 0.1.0 2022-05-24 16:55:29 +02:00
Dylan DPC
4bd40186db
Rollup merge of #97321 - RalfJung:int-to-fnptr, r=Dylan-DPC
explain how to turn integers into fn ptrs

(with an intermediate raw ptr, not a direct transmute)
Direct int2ptr transmute, under the semantics I am imagining, will produce a ptr with "invalid" provenance that is invalid to deref or call. We cannot give it the same semantics as int2ptr casts since those do [something complicated](https://www.ralfj.de/blog/2022/04/11/provenance-exposed.html).

To my great surprise, that is already what the example in the `transmute` docs does. :)  I still added a comment to say that that part is important, and I added a section explicitly talking about this to the `fn()` type docs.

With https://github.com/rust-lang/miri/pull/2151, Miri will start complaining about direct int-to-fnptr transmutes (in the sense that it is UB to call the resulting pointer).
2022-05-24 15:58:26 +02:00
Dylan DPC
af15e45e28
Rollup merge of #97308 - JohnTitor:stabilize-cell-filter-map, r=Mark-Simulacrum
Stabilize `cell_filter_map`

FCP has been completed: https://github.com/rust-lang/rust/issues/81061#issuecomment-1081806326
Closes #81061
2022-05-24 15:58:25 +02:00
Dylan DPC
0531521dbb
Rollup merge of #97298 - compiler-errors:if-else-stmt-braces, r=davidtwco
Parse expression after `else` as a condition if followed by `{`

Fixes #49361.

Two things:
1. This wording needs help. I can never find a natural/intuitive phrasing when I write diagnostics 😅
2. Do we even want to show the "wrap in braces" case? I would assume most of the time the "add an `if`" case is the right one.
2022-05-24 15:58:24 +02:00
Dylan DPC
3569a426b5
Rollup merge of #97288 - compiler-errors:tcxify-rustdoc, r=Dylan-DPC
Lifetime variance fixes for rustdoc

#97287 migrates rustc to a `Ty` type that is invariant over its lifetime `'tcx`, so I need to fix a bunch of places that assume that `Ty<'a>` and `Ty<'b>` can be unified by shortening both to some common lifetime.

This is doable, since everything is already `'tcx`, so all this PR does is be a bit more explicit that elided lifetimes are actually `'tcx`.

Split out from #97287 so the rustdoc team can review independently.
2022-05-24 15:58:24 +02:00
Guillaume Gomez
6920361959 Remove unused brush image 2022-05-24 15:55:01 +02:00
Guillaume Gomez
d4d1e23c69 Allow to pass more arguments to tester.js 2022-05-24 15:42:37 +02:00
bors
ee9726cb10 Auto merge of #97291 - compiler-errors:lazy-is-actually-3-types-in-a-trenchcoat, r=cjgillot
Split out the various responsibilities of `rustc_metadata::Lazy`

`Lazy<T>` actually acts like three different types -- a pointer in the crate metadata to a single value, a pointer to a list/array of values, and an indexable pointer of a list of values (a table).

We currently overload `Lazy<T>` to work differently than `Lazy<[T]>` and the same for `Lazy<Table<I, T>>`. All is well with some helper adapter traits such as [`LazyQueryDecodable`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/decoder/trait.LazyQueryDecodable.html) and [`EncodeContentsForLazy`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_metadata/rmeta/encoder/trait.EncodeContentsForLazy.html).

Well, changes in #97287 that make `Lazy` work with the now invariant lifetime `'tcx` make these adapters fall apart because of coherence reasons. So we split out these three types and rework some of the helper traits so it's both 1. more clear to understand, and 2. compatible with the changes later in that PR.

Split out from #97287 so it can be reviewed separately, since this PR stands on its own.
2022-05-24 13:42:33 +00:00
Guillaume Gomez
b7838e9b1d Update browser-ui-test version to 0.9.5 2022-05-24 15:42:33 +02:00
Guillaume Gomez
f4f14f6671 Update browser-ui-test version to 0.9.5 2022-05-24 15:41:24 +02:00
Guillaume Gomez
cee58cb6b9 Allow to pass more arguments to tester.js 2022-05-24 15:40:50 +02:00
Guillaume Gomez
fca1007ed3 Add GUI test for click on setting text 2022-05-24 15:40:50 +02:00
Guillaume Gomez
1ebf0d9c72 Allow to click on toggle text to update it 2022-05-24 15:40:50 +02:00
5225225
dd9f31d000 Add flag for stricter checks on uninit/zeroed 2022-05-24 14:26:52 +01:00
Loïc BRANSTETT
b9ae3db4ac RFC3239: Add tests for compact cfg(target(..)) 2022-05-24 13:51:36 +02:00
Loïc BRANSTETT
8345571cd0 RFC3239: Implement compact cfg(target(..)) 2022-05-24 13:51:36 +02:00
Loïc BRANSTETT
ae38533ed7 Clean up condition evaluation system 2022-05-24 13:43:08 +02:00
b-naber
86e8bbe4fd add and update tests 2022-05-24 13:01:34 +02:00
b-naber
e2e425e8d2 give correct error message on structural match violation 2022-05-24 13:01:34 +02:00
bors
b2eba058e6 Auto merge of #97121 - pvdrz:do-subdiagnostics-later, r=davidtwco
Avoid double binding of subdiagnostics inside `#[derive(SessionDiagnostic)]`

r? `@davidtwco`
2022-05-24 10:25:13 +00:00
bors
43d9f3859e Auto merge of #96098 - JakobDegen:always-return-place, r=oli-obk
Refactor call terminator to always include destination place

In #71117 people seemed to agree that call terminators should always have a destination place, even if the call was guaranteed to diverge. This implements that. Unsurprisingly, the diff touches a lot of code, but thankfully I had to do almost nothing interesting. The only interesting thing came up in const prop, where the stack frame having no return place was also used to indicate that the layout could not be computed (or similar). I replaced this with a ZST allocation, which should continue to do the right things.

cc `@RalfJung` `@eddyb` who were involved in the original conversation

r? rust-lang/mir-opt
2022-05-24 07:13:26 +00:00
kadmin
ee8efc5c4a Coalesce branches
Move a bunch of branches together into one if block, for easier reading.

Resolve comments

Attempt to make some branches unreachable [tmp]

Revert unreachable branches
2022-05-24 05:33:34 +00:00
bors
acb5c16fa8 Auto merge of #97342 - JohnTitor:rollup-zqxctaw, r=JohnTitor
Rollup of 5 pull requests

Successful merges:

 - #97240 (Typo suggestion for a variable with a name similar to struct fields)
 - #97289 (Lifetime variance fixes for clippy)
 - #97290 (Turn on `fast_submodules` unconditionally)
 - #97336 (typo)
 - #97337 (Fix stabilization version of `Ipv6Addr::to_ipv4_mapped`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-24 04:32:42 +00:00
Michael Goulet
9be37b2d3f Parse expression after else as a condition if followed by { 2022-05-23 21:09:35 -07:00