Commit graph

151857 commits

Author SHA1 Message Date
Yuki Okushi
98130137d9
Rollup merge of #86478 - ehuss:future-incompat-test, r=oli-obk
Add -Zfuture-incompat-test to assist with testing future-incompat reports.

This adds a `-Zfuture-incompat-test` cli flag to assist with testing future-incompatible reports. This flag causes all lints to be treated as a future-incompatible lint, and will emit a report for them. This is being added so that Cargo's testsuite can reliably test the reporting infrastructure.  Right now, Cargo relies on using array_into_iter as a test subject. Since the breaking "future incompatible" lints are never intended to last forever, this means Cargo's testsuite would always need to keep changing to choose different lints (for example, #86330 proposed dropping that moniker for array_into_iter). With this flag, Cargo's tests can trigger any lint and check for the report.
2021-07-15 21:19:11 +09:00
Yuki Okushi
10f335fed1
Rollup merge of #85579 - alex:patch-1, r=yaahc
Added Arc::try_pin

This helper is in line with other other allocation helpers on Arc.

I didn't think this would require an RFC or broader discussion, let me know if that's incorrect.
2021-07-15 21:19:10 +09:00
Alex Gaynor
a214911b77 Added Arc::try_pin
This helper is in line with other other allocation helpers on Arc.
2021-07-15 07:32:05 -04:00
Guillaume Gomez
9bab94f045 Fix misuse of rev attribute on <a> tag 2021-07-15 13:23:20 +02:00
Michael Woerister
8fa22dd9b7 Add self-profiling to debuginfo name generation 2021-07-15 12:21:15 +02:00
Michael Woerister
bdd09c3921 [debuginfo] Make use of spaces and separators in debuginfo names more uniform. 2021-07-15 12:21:05 +02:00
flip1995
1d084b13a5 Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyup 2021-07-15 10:44:10 +02:00
flip1995
e7bc41176e
Merge commit '54a20a02ecd0e1352a871aa0990bcc8b8b03173e' into clippyup 2021-07-15 10:44:10 +02:00
Michael Woerister
e6e1e095ff [debuginfo] Emit associated type bindings in trait object type names. 2021-07-15 10:40:25 +02:00
bors
54a20a02ec Auto merge of #7468 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2021-07-15 08:37:36 +00:00
flip1995
43b0121fa7
Bump nightly version -> 2021-07-15 2021-07-15 10:32:21 +02:00
flip1995
69fbd64e2a
Merge remote-tracking branch 'upstream/master' into rustup 2021-07-15 10:32:06 +02:00
Niko Matsakis
75291ee924
Update compiler/rustc_typeck/src/expr_use_visitor.rs 2021-07-15 04:13:20 -04:00
Aman Arora
c4ac8369e2 PR feedback 2021-07-15 03:57:50 -04:00
bors
09f5f15d8b Auto merge of #7308 - lengyijun:redundant_allocation_arc, r=xFrednet,flip1995
add Arc to `redundant_allocation`

 fixes #7303
changelog:  add Arc to `redundant_allocation`
2021-07-15 07:20:37 +00:00
Eric Huss
0c4b2a84c6 Update cargo 2021-07-14 19:56:42 -07:00
bors
b9197978a9 Auto merge of #86876 - jyn514:56935-target-crate-num, r=petrochenkov
Reuse CrateNum for proc-macro crates even when cross-compiling

Proc-macros are always compiled for the host, so this should be the same
in every way as recompiling the crate.

I am not sure why the previous code special-cased the target, since the
compiler properly gives an error when trying to load a crate for a
different host:

```
error[E0461]: couldn't find crate `dependency` with expected target triple x86_64-unknown-linux-gnu
  --> /home/joshua/rustc4/src/test/ui/cfg-dependent.rs:8:2
   |
LL |     dependency::is_64();
   |     ^^^^^^^^^^
   |
   = note: the following crate versions were found:
           crate `dependency`, target triple i686-unknown-linux-gnu: /home/joshua/rustc4/build/x86_64-unknown-linux-gnu/test/ui/cfg-dependent/auxiliary/libdependency.so
```

I think another possible fix is to remove the check altogether. But I'm
not sure, and this fix works, so I'm not making the larger change here.

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

r? `@petrochenkov` cc `@alexcrichton`
2021-07-15 02:39:38 +00:00
Joshua Nelson
68b959827b Reuse CrateNum for proc-macro crates even when cross-compiling
Proc-macros are always compiled for the host, so this should be the same
in every way as recompiling the crate.

I am not sure why the previous code special-cased the target, since the
compiler properly gives an error when trying to load a crate for a
different host:

```
error[E0461]: couldn't find crate `dependency` with expected target triple x86_64-unknown-linux-gnu
  --> /home/joshua/rustc4/src/test/ui/cfg-dependent.rs:8:2
   |
LL |     dependency::is_64();
   |     ^^^^^^^^^^
   |
   = note: the following crate versions were found:
           crate `dependency`, target triple i686-unknown-linux-gnu: /home/joshua/rustc4/build/x86_64-unknown-linux-gnu/test/ui/cfg-dependent/auxiliary/libdependency.so
```

I think another possible fix is to remove the check altogether. But I'm
not sure, and this fix works, so I'm not making the larger change here.
2021-07-14 20:36:35 -04:00
Jeremy Fitzhardinge
51142a0f5f Make --cap-lints and related options leave crate hash alone
Closes: #87144
2021-07-14 17:04:55 -07:00
bors
9c107816f7 Auto merge of #87137 - richkadel:compiler-builtins-0.1.47, r=tmandry
Update compiler-builtins to 0.1.47

  Bumped to `0.1.47` to resolve missing symbols on `aarch` when linking
  `cargo`. This was due to a recent change in a `cargo` dependency on
  `curl` (upstream C library added code that uses the uncommon `long
  double` type).

r? `@tmandry`
2021-07-14 23:58:43 +00:00
lyj
e575610fb3 redundant_allocation: add Arc; some refractoring. 2021-07-15 07:10:55 +08:00
François Mockers
450c28a45e add assertions on existing tests with missing doc source 2021-07-15 00:30:11 +02:00
bors
2f391da2e6 Auto merge of #86765 - cuviper:fuse-less-specialized, r=joshtriplett
Make the specialized Fuse still deal with None

Fixes #85863 by removing the assumption that we'll never see a cleared iterator in the `I: FusedIterator` specialization. Now all `Fuse` methods check for the possibility that `self.iter` is `None`, and the specialization only avoids _setting_ that to `None` in `&mut self` methods.
2021-07-14 21:17:52 +00:00
Wesley Wiser
6e357bce5d Fix tests for i686 2021-07-14 16:50:11 -04:00
David Thompson
e753f30543 Correct invariant documentation for steps_between
Given that the previous example involves stepping forward from A to B,
the equivalent example on this line would make most sense as stepping
backward from B to A.
2021-07-14 13:48:18 -07:00
Rich Kadel
c4544acbef Update compiler-builtins to 0.1.47
Bumped to `0.1.47` to resolve missing symbols on `aarch` when linking
  `cargo`. This was due to a recent change in a `cargo` dependency on
  `curl` (upstream C library added code that uses the uncommon `long
  double` type).
2021-07-14 13:45:16 -07:00
bors
2b193e247f Auto merge of #7462 - xFrednet:7369-branches-sharing-code-else-expr-fp, r=camsteffen
FP fix and documentation for `branches_sharing_code` lint

Closes rust-lang/rust-clippy#7369

Related rust-lang/rust-clippy#7452 I'm still thinking about the best way to fix this. I could simply add another visitor to ensure that the moved expressions don't modify values being used in the condition, but I'm not totally happy with this due to the complexity. I therefore only documented it for now

changelog: [`branches_sharing_code`] fixed false positive where block expressions would sometimes be ignored.
2021-07-14 20:29:56 +00:00
xFrednet
61e280863f Fixed branches_sharing_code FP with block expressions in else
And added `branches_sharing_code` PF note to lint doc for `rust-clippy#7452`
2021-07-14 21:37:17 +02:00
Ellen
b3b6b66815 OOPS 2021-07-14 19:38:58 +01:00
bors
e87188c252 Auto merge of #87133 - GuillaumeGomez:rollup-pfz9jbk, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #87027 (expand: Support helper attributes for built-in derive macros)
 - #87056 (Fix codeblocks overflow)
 - #87117 (Shrink the CrateStore dynamic interface.)
 - #87120 (rustdoc: Remove unnecessary `extern crate` aliases)
 - #87125 (Fix Ayu theme `<code>` color)
 - #87130 (Update browser-ui-test package version)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-07-14 18:36:44 +00:00
Ellen
da189d9514 Change type param -> generic param 2021-07-14 19:22:39 +01:00
Guillaume Gomez
ac6672b746
Rollup merge of #87130 - GuillaumeGomez:update-browser-ui-test, r=Mark-Simulacrum
Update browser-ui-test package version

It adds a check to prevent to have empty CSS values in `assert-css` command.

r? `@Mark-Simulacrum`
2021-07-14 19:53:41 +02:00
Guillaume Gomez
e0d72d0f92
Rollup merge of #87125 - GuillaumeGomez:ayu-code-color, r=notriddle
Fix Ayu theme <code> color

Fixes #87072 (the second regression).

r? `@notriddle`
2021-07-14 19:53:40 +02:00
Guillaume Gomez
e932ba31e1
Rollup merge of #87120 - jyn514:rustdoc-cleanup, r=CraftSpider
rustdoc: Remove unnecessary `extern crate` aliases
2021-07-14 19:53:38 +02:00
Guillaume Gomez
40155f5ea7
Rollup merge of #87117 - cjgillot:cstore, r=petrochenkov
Shrink the CrateStore dynamic interface.

The information is either accessible through queries or by crates which already depend on rustc_metadata.
2021-07-14 19:53:37 +02:00
Guillaume Gomez
57e021c941
Rollup merge of #87056 - GuillaumeGomez:fix-codeblocks-overflow, r=notriddle
Fix codeblocks overflow

Fixes #87043.

Instead of completely relying on `pulldown-cmark` (and its potential changes), I decided to move the generation of codeblocks HTML directly in rustdoc so we can unify the DOM and the CSS classes.

r? `@Nemo157`
2021-07-14 19:53:36 +02:00
Guillaume Gomez
4d141f5e4c
Rollup merge of #87027 - petrochenkov:builderhelp, r=oli-obk
expand: Support helper attributes for built-in derive macros

This is needed for https://github.com/rust-lang/rust/pull/86735 (derive macro `Default` should have a helper attribute `default`).

With this PR we can specify helper attributes for built-in derives using syntax `#[rustc_builtin_macro(MacroName, attributes(attr1, attr2, ...))]` which mirrors equivalent syntax for proc macros `#[proc_macro_derive(MacroName, attributes(attr1, attr2, ...))]`.
Otherwise expansion infra was already ready for this.
The attribute parsing code is shared between proc macro derives and built-in macros (`fn parse_macro_name_and_helper_attrs`).
2021-07-14 19:53:35 +02:00
Ralf Jung
8932aebfdf remove unused error variant 2021-07-14 18:17:50 +02:00
Ralf Jung
1f21ab114e bless mir-opt, codegen, and remaining ui tests 2021-07-14 18:17:49 +02:00
Ralf Jung
ae950a2dc7 more precise message for the ptr access check on deref 2021-07-14 18:17:49 +02:00
Ralf Jung
4ff353cd6e test dynamic check for ptr-int-casts (unleashed) 2021-07-14 18:17:49 +02:00
Ralf Jung
4759090d15 adjust tests 2021-07-14 18:17:49 +02:00
Ralf Jung
172abb29b1 fix cranelift 2021-07-14 18:17:49 +02:00
Ralf Jung
71c166a0dc use NonZeroU64 for AllocId to restore old type sizes 2021-07-14 18:17:49 +02:00
Ralf Jung
626605cea0 consistently treat None-tagged pointers as ints; get rid of some deprecated Scalar methods 2021-07-14 18:17:49 +02:00
Ralf Jung
d4f7dd6702 CTFE/Miri engine Pointer type overhaul: make Scalar-to-Pointer conversion infallible
This resolves all the problems we had around "normalizing" the representation of a Scalar in case it carries a Pointer value: we can just use Pointer if we want to have a value taht we are sure is already normalized.
2021-07-14 18:17:46 +02:00
Eric Huss
636fcacb44 Add -Zfuture-incompat-test to assist with testing future-incompat reports. 2021-07-14 08:37:58 -07:00
bors
4f0c568785 Auto merge of #87082 - michaelwoerister:const-in-debuginfo-type-names-fix, r=oli-obk,wesleywiser
Handle non-integer const generic parameters in debuginfo type names.

This PR fixes an ICE introduced by https://github.com/rust-lang/rust/pull/85269 which started emitting const generic arguments for debuginfo names but did not cover the case where such an argument could not be evaluated to a flat string of bits.

The fix implemented in this PR is very basic: If `try_eval_bits()` fails for the constant in question, we fall back to generating a stable hash of the constant and emit that instead. This way we get a (virtually) unique name and side step the problem of generating a string representation of a potentially complex value.

The downside is that the generated name will be rather opaque. E.g. the regression test adds a function `const_generic_fn_non_int<()>` which is then rendered as `const_generic_fn_non_int<{CONST#fe3cfa0214ac55c7}>`. I think it's an open question how to deal with this more gracefully.

I'd be interested in ideas on how to do this better.

r? `@wesleywiser`

cc `@dpaoliello` (do you see any problems with this approach?)
cc `@Mark-Simulacrum` & `@nagisa` (who I've seen comment on debuginfo issues recently -- anyone else?)

Fixes https://github.com/rust-lang/rust/issues/86893
2021-07-14 15:18:27 +00:00
bors
4acbff9eb0 Auto merge of #7437 - ebobrow:redundant-closure-move, r=flip1995
suggest `&mut` for redundant FnMut closures

fixes #6903

changelog: suggest `&mut` for redundant FnMut closures
2021-07-14 15:15:28 +00:00
Elliot Bobrow
4c398e07e0 suggest &mut for redundant FnMut closures 2021-07-14 07:56:27 -07:00