Commit graph

150492 commits

Author SHA1 Message Date
Mara Bos
3c95a28f4c Make disjoint_capture_migration an edition lint. 2021-06-27 16:54:48 +00:00
bors
9cdb2d3d59 Auto merge of #86655 - jonas-schievink:const-arguments-as-str, r=kennytm
Make `fmt::Arguments::as_str` unstably const

Motivation: mostly to move "panic!() in const contexts" forward, making use of `as_str` was mentioned in https://github.com/rust-lang/rust/issues/85194#issuecomment-852345377 and seems like the simplest way forward.
2021-06-27 15:45:29 +00:00
Mara Bos
4645679d35 Add explain_reason: false in future_incompatible.
This allows supressing the default warning message for future
incompatible ints, for lints that already provide a more detailed
warning.
2021-06-27 15:04:49 +00:00
Mara Bos
934e6058eb Turn non_fmt_panic into a future_incompatible edition lint. 2021-06-27 14:47:26 +00:00
Mara Bos
7f4e343893 Add explain_reason: false in future_incompatible.
This allows supressing the default warning message for future
incompatible ints, for lints that already provide a more detailed
warning.
2021-06-27 14:47:21 +00:00
Aaron Hill
4be38d2658
Derive Copy for VarianceDiagInfo 2021-06-27 09:30:13 -05:00
Smitty
63cc169d1e Don't run a publically reachable server in tests
This causes Windows Defender's firewall to pop up during tests to ask if
I want to allow the test program to access the public Internet, since it
was listening on `0.0.0.0`. The test server doesn't actually need to be
publically reachable, so this makes it so it is only reachable locally,
which makes Windows Defender happy.
2021-06-27 09:53:27 -04:00
bors
49ba9361d8 Auto merge of #86295 - usbalbin:revert_revert_of_constness, r=RalfJung
Revert revert of constness in #86003

Re-constify `mem::swap`, `mem::replace`, `ptr::write` which were marked as not `const` in #86003

Once the checks pass, this should solve #86236
2021-06-27 13:19:48 +00:00
Albin Hedman
4aa1267cbb
Update and bless tests for const read out of bounds 2021-06-27 14:24:49 +02:00
Albin Hedman
c0125532ea
Update and bless tests for copy intrinsic 2021-06-27 13:48:01 +02:00
Albin Hedman
56c78b2f59
Fix the test copy-intrinsic 2021-06-27 12:05:22 +02:00
Albin Hedman
3a894e38fb
Bring back tests removed in 'Revert PRs 81238 and 82967 (which made copy and copy_nonoverlapping' 5f6016f125 2021-06-27 12:05:21 +02:00
Albin Hedman
4b64baff67
Bless out_of_bounds_read test 2021-06-27 12:05:20 +02:00
Albin Hedman
22fe76d97d
Add reference to tracking issue #86302 for const_ptr_write 2021-06-27 12:05:19 +02:00
Albin Hedman
1aa032f506
Add reference to issue for const_intrinsic_copy in ptr::write 2021-06-27 12:05:19 +02:00
Albin Hedman
7de63be56d
Revert "With the revert of PR 83091, swap is not a const fn anymore."
This reverts commit 34deda3cc2.
2021-06-27 12:05:18 +02:00
Albin Hedman
38e9538122
Revert "Remove tests that were also added in PR 79684."
This reverts commit e118a2cbf1.
2021-06-27 12:05:18 +02:00
Albin Hedman
6c890bb969
Revert "Revert tests added by PR 81167."
This reverts commit cebfcd3256.
2021-06-27 12:05:17 +02:00
Albin Hedman
5fbb1354ce
Revert "Revert effects of PRs 81167 and 83091."
This reverts commit 9d96b0ed8c.
2021-06-27 12:05:16 +02:00
Yuki Okushi
14413ad539
Add FIXME comment 2021-06-27 16:18:52 +09:00
bors
543ab99640 Auto merge of #85448 - nanguye2496:nanguye2496/debuginfo_tests, r=Mark-Simulacrum
Add debug info tests for range, fix-sized array, and cell types

This PR add several debug info tests to guarantee that the displays of fixed sized arrays, range types, cell types, threads, locks, and mutexes in CDB are correct.

It also updates CDB tests for slices in pretty-std.rs after string visualization in WinDbg is fixed by this PR: #81898.
2021-06-27 06:58:07 +00:00
jam1garner
bf0da4418f Fix future_prelude_collision false positive 2021-06-27 00:28:07 -04:00
Jonas Schievink
b3fbfe474b Make fmt::Arguments::as_str unstably const 2021-06-27 03:54:06 +02:00
bors
a5b7511a6c Auto merge of #86645 - FabianWolff:issue-82328, r=LeSeulArtichaut
Fix ICE with `-Zunpretty=hir,typed`

This PR fixes #82328. The `-Zunpretty=hir,typed` pretty-printer maintains an `Option` with type-checking results and sets the `Option` to `Some` when entering a body. However, this leads to an ICE if an expression occurs in a function signature (i.e. outside of a body), such as `128` in
```rust
fn foo(-128..=127: i8) {}
```
This PR fixes the ICE by checking (if necessary) whether the expression's owner has a body, and retrieving type-checking results for that on the fly.
2021-06-27 00:15:49 +00:00
Mara Bos
f6dd1378f0 Update reserved prefixes test for new edition lint wording. 2021-06-26 20:49:29 +00:00
Fabian Wolff
e8ebf98742 Reorder some lines in unpretty-expr-fn-arg.rs 2021-06-26 22:43:27 +02:00
Fabian Wolff
a8b57723d4 Use Option::map() instead of if let 2021-06-26 22:26:26 +02:00
bors
a1411de9de Auto merge of #86267 - ZuseZ4:master, r=nagisa
Allow loading of llvm plugins on nightly

Based on a discussion in  #82734 / with `@wsmoses.`
Mainly moves [this](0149bc4e7e) behind a -Z flag, so it can only be used on nightly,
as requested by `@nagisa` in https://github.com/rust-lang/rust/issues/82734#issuecomment-835863940

This change allows loading of llvm plugins like Enzyme.
Right now it also requires a shared library LLVM build of rustc for symbol resolution.

```rust
// test.rs
extern { fn __enzyme_autodiff(_: usize, ...) -> f64; }

fn square(x : f64) -> f64 {
   return x * x;
}

fn main() {
   unsafe {
      println!("Hello, world {} {}!", square(3.0), __enzyme_autodiff(square as usize, 3.0));
   }
}
```
```
./rustc test.rs -Z llvm-plugins="./LLVMEnzyme-12.so" -C passes="enzyme"
./test
Hello, world 9 6!
```

I will try to figure out how to simplify the usage and get this into stable in a later iteration,
but having this on nightly will already help testing further steps.
2021-06-26 19:20:41 +00:00
Manuel Drehwald
abdd24a040 Remove dropping of loaded plugins and better debug info 2021-06-26 19:30:09 +02:00
bors
3ddb78a346 Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, r=GuillaumeGomez
rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds

My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR.

Fully resolves #85454
2021-06-26 16:13:52 +00:00
lrh2000
e9fc942b4d Use FutureIncompatibilityReason to denote edition 2021-06-26 23:40:07 +08:00
Mara Bos
2bcd663100 Add reserved_prefixe tests for macros from different editions. 2021-06-26 23:11:14 +08:00
Mara Bos
7490305e13 No reserved_prefix suggestion in proc macro call_site. 2021-06-26 23:11:14 +08:00
Mara Bos
c7f7c2efe0 Add quote!() example to reserved_prefix lint test. 2021-06-26 23:11:14 +08:00
Mara Bos
0eeeebc990 Rename 'bad prefix' to 'unknown prefix'. 2021-06-26 23:11:14 +08:00
Mara Bos
d40be0fc64 Check the span's edition for the reserved prefixes. 2021-06-26 23:11:13 +08:00
Mara Bos
6adce70a58 Improve comments for reserved prefixes.
Co-authored-by: Niko Matsakis <niko@alum.mit.edu>
2021-06-26 23:11:13 +08:00
Mara Bos
3b18e215a3 Add test for the reserved_prefix migration lint. 2021-06-26 23:11:13 +08:00
Mara Bos
d837c00d10 Add migration lint for reserved prefixes. 2021-06-26 23:11:04 +08:00
Mara Bos
40fb2e9705 Update reserved-prefixes test output. 2021-06-26 23:09:43 +08:00
Mara Bos
ce43fc9404 Fix note in reserved prefix error. 2021-06-26 23:09:43 +08:00
Mara Bos
c856e6fa53 Add machine applicable suggestion to unknown prefix error. 2021-06-26 23:09:43 +08:00
lrh2000
8dee9bc8fc Reserve prefixed identifiers and string literals (RFC 3101)
This commit denies any identifiers immediately followed by
one of three tokens `"`, `'` or `#`, which is stricter than
the requirements of RFC 3101 but may be necessary according
to the discussion at [Zulip].

[Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099
2021-06-26 23:09:43 +08:00
Fabian Wolff
7682e87c6d Fix ICE with -Zunpretty=hir,typed when an expression occurs in a function signature 2021-06-26 16:05:53 +02:00
bors
f2571a2dd6 Auto merge of #85682 - m-ou-se:array-into-iter-2, r=nikomatsakis
Update array_into_iter lint for 1.53 and edition changes.

This updates the array_into_iter lint for Rust 1.53 and the edition changes.

See https://github.com/rust-lang/rust/issues/84513

r? `@estebank`
2021-06-26 13:33:04 +00:00
Mara Bos
dbdf7c7963 Fix array-into-iter tests. 2021-06-26 12:19:18 +00:00
Mara Bos
c685292fba Remove issue-78660-cap-lints-future-compat test. 2021-06-26 12:14:23 +00:00
Mara Bos
bdeb61437f Add test for suggestion of array_into_iter in for loop. 2021-06-26 12:14:22 +00:00
Mara Bos
ef152d9b9f Better suggestion for array_into_iter in for loop. 2021-06-26 12:14:22 +00:00
Mara Bos
aec2c5b2b6 Update tests for updated array_into_iter lint. 2021-06-26 12:14:22 +00:00