Commit Graph

5658 Commits

Author SHA1 Message Date
bors
ff2c947c00 Auto merge of #85481 - lcnr:const-equate, r=matthewjasper
deal with `const_evaluatable_checked` in `ConstEquate`

Failing to evaluate two constants which do not contain inference variables should not result in ambiguity.
2021-05-25 13:53:48 +00:00
Guillaume Gomez
aa8c37d2c9
Rollup merge of #85650 - scottmcm:adjust-adjustment-docs, r=jyn514
Add some backticks to the `rustc_middle::ty::adjustment::Adjustment` docs

A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.

See https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/adjustment/struct.Adjustment.html
2021-05-25 13:05:16 +02:00
Guillaume Gomez
ad72247833
Rollup merge of #85605 - ptrojahn:closure_struct, r=matthewjasper
Replace Local::new(1) with CAPTURE_STRUCT_LOCAL
2021-05-25 13:05:14 +02:00
Guillaume Gomez
6b0b81b098
Rollup merge of #85361 - bjorn3:rustdoc_target_json_path_canonicalize, r=jyn514
Use TargetTriple::from_path in rustdoc

This fixes the problem reported in https://github.com/Rust-for-Linux/linux/pull/272 where rustdoc requires the absolute path of a target spec json instead of accepting a relative path like rustc.
2021-05-25 13:05:09 +02:00
bors
a7890c7952 Auto merge of #84985 - pietroalbini:bootstrap-1.54, r=Mark-Simulacrum
Bump bootstrap compiler to beta 1.53.0

This PR bumps the bootstrap compiler to version 1.53.0 beta, as part of our usual release process (this was supposed to be Wednesday's step, but creating the beta release took longer than expected).

The PR also includes the "Bootstrap: skip rustdoc fingerprint for building docs" commit, see the reasoning [on Zulip](https://zulip-archive.rust-lang.org/241545trelease/88450153betabootstrap.html).

r? `@Mark-Simulacrum`
2021-05-25 05:48:00 +00:00
bors
d568d63b1f Auto merge of #85273 - LeSeulArtichaut:thir-query, r=nikomatsakis
Make building THIR a stealable query

This PR creates a stealable `thir_body` query so that we can build the THIR only once for THIR unsafeck and MIR build.

Blocked on #83842.
r? `@nikomatsakis`
2021-05-25 03:07:03 +00:00
Scott McMurray
bc2c3dca55 Add some backticks to the rustc_middle::ty::adjustment::Adjustment docs
A few `[i32]`s are getting picked up as intra-doc links, rather than showing as slices, making the sentence quite confusing.
2021-05-24 15:47:28 -07:00
bors
126561cb31 Auto merge of #85639 - GuillaumeGomez:rollup-modinsi, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #85271 (Fix indentation in move keyword documentation)
 - #85551 (Fix search results display)
 - #85621 (Restore sans-serif font for module items.)
 - #85628 (Replace more "NULL" with "null")

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-24 18:05:35 +00:00
bjorn3
f22a80890a Use parse_target_triple in rustdoc 2021-05-24 19:53:44 +02:00
bors
ef0ec303fa Auto merge of #85596 - scottmcm:more-on-unimplemented, r=estebank
Extend `rustc_on_implemented` to improve more `?` error messages

`_Self` could match the generic definition; this adds that functionality for matching the generic definition of type parameters too.

Your advice welcome on the wording of all these messages, and which things belong in the message/label/note.

r? `@estebank`
2021-05-24 15:24:38 +00:00
Pietro Albini
9e22b844dd remove cfg(bootstrap) 2021-05-24 11:07:48 -04:00
LeSeulArtichaut
af3d9a3aa3 Make thir_check_unsafety itself responsible for checking gate 2021-05-24 15:09:33 +02:00
LeSeulArtichaut
13e7b237fd Add comments about stealing THIR in mir_build 2021-05-24 15:05:20 +02:00
LeSeulArtichaut
3559565e07 Replace more "NULL" with "null" 2021-05-24 12:59:33 +02:00
bors
68424e2f01 Auto merge of #85515 - jedel1043:fix-85480, r=petrochenkov
Fix ast pretty printing for anonymous types

Fixes #85480.
2021-05-24 05:39:07 +00:00
jedel1043
5b4bc05fa5 Fix ast expanded printing for anonymous types 2021-05-24 00:03:59 -05:00
bors
9f69e2f8b2 Auto merge of #85606 - 12101111:link_modifiers, r=petrochenkov
remove native_link_modifiers from the list of incomplete features.

These features are fully implemented and not incomplete.
The tracking issue of them is https://github.com/rust-lang/rust/issues/81490.
The implement PR is https://github.com/rust-lang/rust/pull/83507.
2021-05-23 22:06:53 +00:00
bors
f64503eb55 Auto merge of #85554 - 12101111:fix-dedup-native-libs, r=petrochenkov
native lib: defer the duplicate check after relevant_lib check.

https://github.com/rust-lang/rust/pull/84794 break code using conditional-compilation with `#[link]` attributes.

```rust
#[cfg(target_env = "musl")]
cfg_if::cfg_if! {
    if #[cfg(any(target_feature = "crt-static", feature = "llvm-libunwind"))] {
        #[link(name = "unwind", kind = "static", modifiers = "-bundle")]
        extern "C" {}
    } else {
        #[link(name = "unwind", cfg(feature = "system-llvm-libunwind"))]
        #[link(name = "gcc_s", cfg(not(feature = "system-llvm-libunwind")))]
        extern "C" {}
    }
}

```
2021-05-23 19:42:19 +00:00
12101111
a90ec5d492
remove native_link_modifiers from the list of incomplete features. 2021-05-24 00:36:55 +08:00
Paul Trojahn
0a80cc4d83 Replace Local::new(1) with CAPTURE_STRUCT_LOCAL 2021-05-23 18:36:23 +02:00
Scott McMurray
8be67998a1 Extend rustc_on_implemented to improve a ?-on-ControlFlow error message 2021-05-23 07:18:02 -07:00
Ralf Jung
f9b36b4f65
fix comment
Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2021-05-23 13:26:51 +02:00
Ralf Jung
461b2f83f3 (try to) fix cranelift 2021-05-23 12:44:05 +02:00
Ralf Jung
585141b219 support creating mutable allocations from byte slices 2021-05-23 12:37:16 +02:00
Ralf Jung
c3005e85da avoid redundant immutability check 2021-05-23 11:55:31 +02:00
Ralf Jung
3bcba11c35 reject deallocation of read-only allocations 2021-05-23 11:53:23 +02:00
bors
e4ca1662f2 Auto merge of #85578 - RalfJung:alloc-mem-extra, r=oli-obk
CTFE get_alloc_extra_mut: also provide ref to MemoryExtra

This would let me use mutable references in more places in Stacked Borrows, avoiding some `RefCell` overhead. :)

r? `@oli-obk`
2021-05-22 20:04:52 +00:00
bors
f98bd7eeca Auto merge of #85078 - RalfJung:const_fn_unsize, r=oli-obk
stabilize const_fn_unsize

I will post a stabilization report and ask for FCP in https://github.com/rust-lang/rust/issues/64992.
This PR is for the implementation side of stabilization.

r? `@oli-obk`
Fixes https://github.com/rust-lang/rust/issues/64992
2021-05-22 17:38:15 +00:00
LeSeulArtichaut
3f31044d90 Handle typeck errors properly 2021-05-22 16:21:36 +02:00
LeSeulArtichaut
6dfdea9800 Make the THIR unsafeck use the thir_body query 2021-05-22 16:21:33 +02:00
Ralf Jung
96ae300889 CTFE get_alloc_extra_mut: also provide ref to MemoryExtra 2021-05-22 15:20:20 +02:00
LeSeulArtichaut
6f64eb1fe6 Make THIR building a stealable query 2021-05-22 14:36:22 +02:00
LeSeulArtichaut
bd80018159 Move THIR structure definitions to rustc_middle 2021-05-22 14:36:22 +02:00
bors
104a3c3510 Auto merge of #85557 - hyd-dev:abi, r=RalfJung
Add `rustc_mir::interpret::Machine::enforce_abi()`

To specify whether to skip the [ABI](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_target/abi/enum.Abi.html) check for function calls, so that we could test unwinding out of a `extern "C"` function call in Miri by disabling the check: https://github.com/rust-lang/miri/pull/1776#discussion_r633698382

I have tested that it works in Miri with a `-Zmiri-disable-abi-check` command line flag.
2021-05-22 11:49:13 +00:00
hyd-dev
7e42c975b9
Add default implementation for enforce_abi() 2021-05-22 19:11:47 +08:00
Ralf Jung
65cd051b4a stabilize const_fn_unsize 2021-05-22 10:35:49 +02:00
bors
21e1cd9b95 Auto merge of #85531 - luqmana:flip-gc, r=petrochenkov
Swap TargetOptions::linker_is_gnu default from false to true and update targets as appropriate.

#85274 gated the `--gc-sections` flag on targets that specified `linker_is_gnu` to stop us from passing it to incompatible linkers. But that had the unintended effect of the flag no longer being passed on targets for which it is valid and hence caused a regression in binary size. Given that most `ld`-style linkers are GNU compatible, this change flips our default for `linker_is_gnu` from false to true. That also means updating the targets that relied on the previous default:
* Apple
* Illumos
* L4Re (not sure about this one)
* MSVC
* NvtPtx
* Solaris

Fixes #85519
2021-05-22 04:42:36 +00:00
bors
5dc8789e30 Auto merge of #85560 - GuillaumeGomez:rollup-8k90rc7, r=GuillaumeGomez
Rollup of 4 pull requests

Successful merges:

 - #85506 (Reset "focusedByTab" field when doing another search)
 - #85548 (Remove dead toggle JS code)
 - #85550 (facepalm: operator precedence fail on my part.)
 - #85555 (Check for more things in THIR unsafeck)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2021-05-21 19:17:22 +00:00
Guillaume Gomez
0f48e6365b
Rollup merge of #85555 - LeSeulArtichaut:thir-unsafeck, r=nikomatsakis
Check for more things in THIR unsafeck

Reunion of #85306, #85381 and #85419 with conflicts resolved.
r? `@nikomatsakis`
2021-05-21 20:06:09 +02:00
LeSeulArtichaut
0e1afc4501 Check for use of mutable/extern statics in THIR unsafeck 2021-05-21 19:51:53 +02:00
bors
9c0379c0f5 Auto merge of #85511 - Mark-Simulacrum:eq-not-sup, r=nikomatsakis
Adjust self-type check to require equality

When we encounter `SomeType::<X>::foo`, `self_ty` is `SomeType<X>` and the method is defined in an impl on `SomeType<A>`. Previously, we required simply that `self_ty <: impl_ty`, but this is too lax: we should require equality in order to use the method. This was found as part of unrelated work on never type stabilization, but also fixes one of the wf test cases.
2021-05-21 16:36:36 +00:00
LeSeulArtichaut
6b327aaa08 Check for ptr-to-int casts in const functions in THIR unsafeck 2021-05-21 18:31:44 +02:00
LeSeulArtichaut
592fecbafb Check for initialization of layout-restricted types 2021-05-21 18:29:51 +02:00
12101111
004614c4b3
native lib: defer the duplicate check after relevant_lib check. 2021-05-22 00:09:07 +08:00
hyd-dev
c69fba929b
Add rustc_mir::interpret::Machine::enforce_abi() 2021-05-21 22:24:57 +08:00
Mark Rousskov
4b4382d88b Adjust self-type to require equality 2021-05-21 10:16:53 -04:00
bors
fc81ad22c4 Auto merge of #85416 - durin42:llvm-catchup-may-2021, r=nagisa
PassWrapper: update for LLVM change D102093

In https://reviews.llvm.org/D102093 lots of things stopped taking the
DebugLogging boolean parameter. Mercifully we appear to always set
DebugPassManager to false, so I don't think we're losing anything by not
passing this parameter.
2021-05-21 11:21:06 +00:00
Luqman Aden
3221a5e65b Remove linker_is_gnu: true cases as that is now the default. 2021-05-20 23:36:04 -07:00
bors
6f5a198ffc Auto merge of #85382 - Aaron1011:project-eval, r=nikomatsakis
Always produce sub-obligations when using cached projection result

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

When we skip adding the sub-obligations to the `obligation` list, we can affect whether or not the final result is `EvaluatedToOk` or `EvaluatedToOkModuloObligations`. This creates problems for incremental compilation, since the projection cache is untracked shared state.

To solve this issue, we unconditionally process the sub-obligations. Surprisingly, this is a slight performance *win* in many cases.
2021-05-21 02:39:39 +00:00
Luqman Aden
0188664425 Swap TargetOptions::linker_is_gnu default from false to true and update targets as appropriate. 2021-05-20 16:47:08 -07:00