Commit graph

1477 commits

Author SHA1 Message Date
bors
806b3995b8 Auto merge of #88056 - erikdesjardins:revertzst, r=oli-obk
Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk"

This reverts commit 8007b506ac, reversing changes made to e55c13e109.

Fixes #88043

r? `@oli-obk`
2021-08-17 14:02:55 +00:00
Tomasz Miąsko
9a0ee05c3d Split critical edge targeting the start block 2021-08-17 00:00:00 +00:00
Deadbeef
ee85704c04
Skip assert ICE with default_method_body_is_const
functions marked with #[default_method_body_is_const] would
ICE when being const checked due to it not being a const function:
`tcx.is_const_fn_raw(did)` returns false. We should skip this assert
when it is marked with that attribute.
2021-08-16 12:04:01 +00:00
Rémy Rakic
311578d7f4
fix typo in bound_region_errors.rs
Co-authored-by: matthewjasper <20113453+matthewjasper@users.noreply.github.com>
2021-08-16 09:07:42 +02:00
Erik Desjardins
8e11199a15 Revert "Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk"
This reverts commit 8007b506ac, reversing
changes made to e55c13e109.
2021-08-15 23:44:34 -04:00
Rémy Rakic
2cf4b87393 De-dupe NLL HRTB diagnostics' use of type_op_prove_predicate 2021-08-15 14:49:36 +02:00
Rémy Rakic
a69c7cc0d5 don't derive Copy for RegionElement 2021-08-15 09:11:03 +02:00
Rémy Rakic
19dfea552a Slight cleanup 2021-08-15 09:11:03 +02:00
Rémy Rakic
5cf6edb4c5 Fix dyn trait warning 2021-08-15 09:11:02 +02:00
Matthew Jasper
d563a63788 Report nicer errors for HRTB NLL errors from queries 2021-08-15 09:11:01 +02:00
Matthew Jasper
0c388b0261 Report mismatched type errors for bound region errors in NLL 2021-08-15 09:11:00 +02:00
Matthew Jasper
5e6027c6bf Track causes for universes created during borrowck 2021-08-15 09:10:46 +02:00
Matthew Jasper
e271383c6b Simplify BoundUniversalRegionError 2021-08-15 08:44:37 +02:00
Matthew Jasper
4421dd17fa Return the canonicalized query from type ops 2021-08-15 08:44:36 +02:00
Matthew Jasper
5d52c0e0c6 Remove unused Option from NllTypeRelatingDelegate 2021-08-15 08:44:35 +02:00
bors
8007b506ac Auto merge of #83417 - erikdesjardins:enableremovezsts, r=oli-obk
Run RemoveZsts pass at mir-opt-level=1

per https://github.com/rust-lang/rust/pull/83177#issuecomment-803942217

This pass removes assignments to ZST places.

Perf (from https://github.com/rust-lang/rust/pull/83177#issuecomment-803442557): https://perf.rust-lang.org/compare.html?start=41b315a470d583f6446599984ff9ad3bd61012b2&end=bd5d1b96f0c64c9938feea831789e1b5bb2cd4a2

r? `@oli-obk`
2021-08-14 19:59:08 +00:00
bors
136eaa1b25 Auto merge of #87375 - fee1-dead:move-constness-to-traitpred, r=oli-obk
Try filtering out non-const impls when we expect const impls

**TL;DR**: Associated types on const impls are now bounded; we now disallow calling a const function with bounds when the specified type param only has a non-const impl.

r? `@oli-obk`
2021-08-14 12:06:34 +00:00
Guillaume Gomez
717f9e3769
Rollup merge of #87795 - estebank:erase-lifetimes-in-suggestion, r=oli-obk
Avoid ICE caused by suggestion

When suggesting dereferencing something that can be iterable in a `for`
loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region
constraints already solved' panic.

Fix #87657, fix #87709, fix #87651.
2021-08-13 15:29:10 +02:00
Deadbeef
a00f2bcf5c
Try to fix problem 2021-08-13 09:28:50 +00:00
Deadbeef
32390a0df6
move Constness into TraitPredicate 2021-08-13 09:26:33 +00:00
bors
0fa3190394 Auto merge of #87916 - nbdd0121:black_box, r=nagisa
Implement `black_box` using intrinsic

Introduce `black_box` intrinsic, as suggested in https://github.com/rust-lang/rust/pull/87590#discussion_r680468700.

This is still codegenned as empty inline assembly for LLVM. For MIR interpretation and cranelift it's treated as identity.

cc `@Amanieu` as this is related to inline assembly
cc `@bjorn3` for rustc_codegen_cranelift changes
cc `@RalfJung` as this affects MIRI

r? `@nagisa` I suppose
2021-08-12 21:04:07 +00:00
Gary Guo
1fb1643129 Implement black_box using intrinsic
The new implementation allows some `memcpy`s to be optimized away,
so the uninit value in ui/sanitize/memory.rs is constructed directly
onto the return place. Therefore the sanitizer now says that the
value is allocated by `main` rather than `random`.
2021-08-12 16:16:57 +01:00
Esteban Küber
a0bf7d2cd3 Avoid ICE caused by suggestion
When suggesting dereferencing something that can be iterable in a `for`
loop, erase lifetimes and use a fresh `ty::ParamEnv` to avoid 'region
constraints already solved' panic.

Fix  #87657.
2021-08-12 10:24:01 +00:00
bors
d488de82f3 Auto merge of #87587 - oli-obk:lazy_tait, r=spastorino
Various refactorings of the TAIT infrastructure

Before this PR we used to store the opaque type knowledge outside the `InferCtxt`, so it got recomputed on every opaque type instantiation.

I also removed a feature gate check that makes no sense in the planned lazy TAIT resolution scheme

Each commit passes all tests, so this PR is best reviewed commit by commit.

r? `@spastorino`
2021-08-11 05:14:45 +00:00
Erik Desjardins
585e4ae6e1 Run RemoveZsts at mir-opt-level=1
Effectively reverts commit 6960bc9696.
2021-08-07 11:20:46 -04:00
bors
996ff2e0a0 Auto merge of #87408 - kornelski:try_reserve_error, r=yaahc
Hide allocator details from TryReserveError

I think there's [no need for TryReserveError to carry detailed information](https://github.com/rust-lang/rust/issues/48043#issuecomment-825139280), but I wouldn't want that issue to delay stabilization of the `try_reserve` feature.

So I'm proposing to stabilize `try_reserve` with a `TryReserveError` as an opaque structure, and if needed, expose error details later.

This PR moves the `enum` to an unstable inner `TryReserveErrorKind` that lives under a separate feature flag. `TryReserveErrorKind` could possibly be left as an implementation detail forever, and the `TryReserveError` get methods such as `allocation_size() -> Option<usize>` or `layout() -> Option<Layout>` instead, or the details could be dropped completely to make try-reserve errors just a unit struct, and thus smaller and cheaper.
2021-08-07 01:26:15 +00:00
Oli Scherer
b2c1919a3d Store the DefId of the currently typechecked item in InferCtxt
This allows opaque type inference to check for defining uses without having to pass down that def id via function arguments to every method that could possibly cause an opaque type to be compared with a concrete type
2021-08-06 10:39:23 +00:00
Oli Scherer
20371b94f6 Immediately register new opaque types in the global list.
Previously each opaque type instantiation would create new inference vars, even for the same opaque type/substs combination. Now there is a global map in InferCtxt that gets filled whenever we encounter an opaque type.
2021-08-06 10:39:08 +00:00
Oli Scherer
816b9fc2d1 Remove Option only used as its Some variant 2021-08-06 10:27:37 +00:00
bors
25b7648496 Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
rustc: Fill out remaining parts of C-unwind ABI

This commit intends to fill out some of the remaining pieces of the
C-unwind ABI. This has a number of other changes with it though to move
this design space forward a bit. Notably contained within here is:

* On `panic=unwind`, the `extern "C"` ABI is now considered as "may
  unwind". This fixes a longstanding soundness issue where if you
  `panic!()` in an `extern "C"` function defined in Rust that's actually
  UB because the LLVM representation for the function has the `nounwind`
  attribute, but then you unwind.

* Whether or not a function unwinds now mainly considers the ABI of the
  function instead of first checking the panic strategy. This fixes a
  miscompile of `extern "C-unwind"` with `panic=abort` because that ABI
  can still unwind.

* The aborting stub for non-unwinding ABIs with `panic=unwind` has been
  reimplemented. Previously this was done as a small tweak during MIR
  generation, but this has been moved to a separate and dedicated MIR
  pass. This new pass will, for appropriate functions and function
  calls, insert a `cleanup` landing pad for any function call that may
  unwind within a function that is itself not allowed to unwind. Note
  that this subtly changes some behavior from before where previously on
  an unwind which was caught-to-abort it would run active destructors in
  the function, and now it simply immediately aborts the process.

* The `#[unwind]` attribute has been removed and all users in tests and
  such are now using `C-unwind` and `#![feature(c_unwind)]`.

I think this is largely the last piece of the RFC to implement.
Unfortunately I believe this is still not stabilizable as-is because
activating the feature gate changes the behavior of the existing `extern
"C"` ABI in a way that has no replacement. My thinking for how to enable
this is that we add support for the `C-unwind` ABI on stable Rust first,
and then after it hits stable we change the behavior of the `C` ABI.
That way anyone straddling stable/beta/nightly can switch to `C-unwind`
safely.
2021-08-04 21:09:53 +00:00
Yuki Okushi
917c047c33
Rollup merge of #87720 - matthiaskrgr:clippy_into, r=jyn514
don't use .into() to convert types to identical types (clippy::useless_conversion)

Example:
let _x: String = String::from("hello world").into();
2021-08-04 08:05:54 +09:00
Rémy Rakic
06437642a1 make the hybrid variant the default polonius algorithm 2021-08-03 20:29:24 +02:00
Rémy Rakic
99cc35daef update polonius-engine to 0.13
and update fact generation to the new relation names
2021-08-03 20:29:24 +02:00
bors
c6bc102fea Auto merge of #87515 - crlf0710:trait_upcasting_part2, r=bjorn3
Trait upcasting coercion (part2)

This is the second part of trait upcasting coercion implementation.

Currently this is blocked on #86264 .

The third part might be implemented using unsafety checking

r? `@bjorn3`
2021-08-03 16:58:56 +00:00
Alex Crichton
0168dfec6d Use predefined helper instead of a new one 2021-08-03 07:06:19 -07:00
Alex Crichton
30bc5a936b Move abort_unwinding_calls earlier 2021-08-03 07:06:19 -07:00
Alex Crichton
1c07096a45 rustc: Fill out remaining parts of C-unwind ABI
This commit intends to fill out some of the remaining pieces of the
C-unwind ABI. This has a number of other changes with it though to move
this design space forward a bit. Notably contained within here is:

* On `panic=unwind`, the `extern "C"` ABI is now considered as "may
  unwind". This fixes a longstanding soundness issue where if you
  `panic!()` in an `extern "C"` function defined in Rust that's actually
  UB because the LLVM representation for the function has the `nounwind`
  attribute, but then you unwind.

* Whether or not a function unwinds now mainly considers the ABI of the
  function instead of first checking the panic strategy. This fixes a
  miscompile of `extern "C-unwind"` with `panic=abort` because that ABI
  can still unwind.

* The aborting stub for non-unwinding ABIs with `panic=unwind` has been
  reimplemented. Previously this was done as a small tweak during MIR
  generation, but this has been moved to a separate and dedicated MIR
  pass. This new pass will, for appropriate functions and function
  calls, insert a `cleanup` landing pad for any function call that may
  unwind within a function that is itself not allowed to unwind. Note
  that this subtly changes some behavior from before where previously on
  an unwind which was caught-to-abort it would run active destructors in
  the function, and now it simply immediately aborts the process.

* The `#[unwind]` attribute has been removed and all users in tests and
  such are now using `C-unwind` and `#![feature(c_unwind)]`.

I think this is largely the last piece of the RFC to implement.
Unfortunately I believe this is still not stabilizable as-is because
activating the feature gate changes the behavior of the existing `extern
"C"` ABI in a way that has no replacement. My thinking for how to enable
this is that we add support for the `C-unwind` ABI on stable Rust first,
and then after it hits stable we change the behavior of the `C` ABI.
That way anyone straddling stable/beta/nightly can switch to `C-unwind`
safely.
2021-08-03 07:06:19 -07:00
Matthias Krüger
02b7754f9e don't use .into() to convert types to identical types (clippy::useless_conversion)
Example:
let _x: String = String::from("hello world").into();
2021-08-03 10:17:57 +02:00
bors
f63ab6cfa2 Auto merge of #87628 - estebank:unmet-explicit-lifetime-bound, r=oli-obk
Point at unmet explicit lifetime obligation bound

r? `@oli-obk`

Split off of #85799.
2021-08-02 23:16:40 +00:00
Charles Lew
a1cff1cd49 Small refactorings for miri. 2021-08-03 01:09:37 +08:00
Charles Lew
63ed625313 Implement pointer casting. 2021-08-03 01:09:37 +08:00
bors
3227e35765 Auto merge of #87248 - RalfJung:ctfe-partial-overwrite, r=oli-obk
CTFE: throw unsupported error when partially overwriting a pointer

Currently, during CTFE, when a write to memory would overwrite parts of a pointer, we make the remaining parts of that pointer "uninitialized". This is probably not what users expect, so if this ever happens they will be quite confused about why some of the data just vanishes for seemingly no good reason.
So I propose we change this to abort CTFE when that happens, to at last avoid silently doing the wrong thing.
Cc https://github.com/rust-lang/rust/issues/87184

Our CTFE test suite still seems to pass. However, we should probably crater this, and I want to do some tests with Miri as well.
2021-08-02 13:31:02 +00:00
bors
b53a93db2d Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
rfc3052 followup: Remove authors field from Cargo manifests

Since RFC 3052 soft deprecated the authors field, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information for contributors, we may as well
remove it from crates in this repo.
2021-08-02 05:49:17 +00:00
Matthias Krüger
a953574ddb clippy::perf fixes 2021-08-01 23:44:54 +02:00
bors
aadd6189ad Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisa
more clippy::complexity fixes

(also a couple of clippy::perf fixes)
2021-08-01 09:15:15 +00:00
Esteban Küber
e5d42af6ba Point at unmet explicit lifetime obligation bound 2021-07-31 07:56:01 -07:00
Ralf Jung
14de6ec8d8 CTFE: throw unsupported error when partially overwriting a pointer 2021-07-31 11:30:33 +02:00
bors
199d1aebe4 Auto merge of #86754 - estebank:use-multispans-more, r=varkor
Use `multipart_suggestions` more

Built on top of #86532
2021-07-30 23:18:12 +00:00
Yuki Okushi
5e2655d27f
Rollup merge of #87559 - estebank:consider-borrowing, r=oli-obk
Tweak borrowing suggestion in `for` loop
2021-07-31 04:09:30 +09:00
Esteban Küber
0b8f192cfe Use multispan suggestions more often
* Use more accurate span for `async move` suggestion
* Use more accurate span for deref suggestion
* Use `multipart_suggestion` more often
2021-07-30 09:26:31 -07:00
Esteban Küber
17b2f92e44 Tweak borrowing suggestion in for loop 2021-07-30 08:59:42 -07:00
Niko Matsakis
e5e6acdd00
Update compiler/rustc_mir/src/borrow_check/consumers.rs 2021-07-30 15:13:28 +03:00
bors
f739552870 Auto merge of #87483 - oli-obk:tait_ice, r=lqd
Mir borrowck does not generate lifetime variables for 'static lifetimes during opaque type resolution

Fixes #87455

This situation was unreachable before #87287 as we used to just grab the resolved opaque type from typeck and replaced all regions with new inference vars. After #87287 we let the `InferCx` in mir borrowck figure out the opaque type all by itself (which it already did before, but it only used the result to sanity check with the typeck result).
2021-07-30 07:02:34 +00:00
Jade
3cf820e17d rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
bors
6e0a8bf790 Auto merge of #86998 - m-ou-se:const-panic-fmt-as-str, r=oli-obk
Make const panic!("..") work in Rust 2021.

During const eval, this replaces calls to core::panicking::panic_fmt and std::panicking::being_panic_fmt with a call to a new const fn: core::panicking::const_panic_fmt. That function uses fmt::Arguments::as_str() to get the str and calls panic_str with that instead.

panic!() invocations with formatting arguments are still not accepted, as the creation of such a fmt::Arguments cannot be done in constant functions right now.

r? `@RalfJung`
2021-07-29 07:12:07 +00:00
Yuki Okushi
9e94d7bbe6
Rollup merge of #87527 - LeSeulArtichaut:no-mir-unsafeck, r=oli-obk
Don't run MIR unsafeck at all when using `-Zthir-unsafeck`

I don't know how I missed this :D
r? ``@oli-obk``
2021-07-29 06:11:48 +09:00
Mara Bos
0b8033ad8d Improve comments about const panic handling
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-07-28 16:18:38 +02:00
Mara Bos
4e6356188f Check that const_panic_fmt is const too. 2021-07-28 16:18:38 +02:00
Mara Bos
f827d3e285 Make const panic!("..") work in Rust 2021.
During const eval, this replaces calls to core::panicking::panic_fmt and
std::panicking::being_panic_fmt with a call to a new const fn:
core::panicking::const_panic_fmt. That function uses
fmt::Arguments::as_str() to get the str and calls panic_str with that
instead.

panic!() invocations with formatting arguments are still not accepted,
as the creation of such a fmt::Arguments cannot be done in constant
functions right now.
2021-07-28 16:10:41 +02:00
Yuki Okushi
954137ea0e
Rollup merge of #87453 - ibraheemdev:i-68697, r=wesleywiser
Suggest removing unnecessary &mut as help message

Closes #68697
2021-07-28 18:28:17 +09:00
LeSeulArtichaut
40b57be547 Don't run MIR unsafeck at all when using -Zthir-unsafeck 2021-07-27 23:26:55 +02:00
Jacob Pratt
7bf791d162
Stabilize const_fn_union 2021-07-27 16:03:33 -04:00
Jacob Pratt
36f02f3523
Stabilize const_fn_transmute 2021-07-27 16:03:09 -04:00
Yuki Okushi
d25439481c
Rollup merge of #87427 - RalfJung:no-mir-for, r=oli-obk
get rid of NoMirFor error variant

The only place where we throw that error, it is very quickly caught again and turned into a different error. So raise that other error immediately.
2021-07-27 19:52:46 +09:00
bors
998cfe5aad Auto merge of #85305 - MarcusDunn:master, r=pnkfelix
Stabilize bindings_after_at

attempting to stabilze bindings_after_at [#65490](https://github.com/rust-lang/rust/issues/65490), im pretty new to the whole thing so any pointers are greatly appreciated.
2021-07-27 05:53:31 +00:00
Oli Scherer
2953a2fb18 Mir borrowck does not generate lifetime variables for 'static lifetimes during opaque type resolution 2021-07-26 16:35:32 +00:00
Guillaume Gomez
f9d00b4a78
Rollup merge of #87458 - ibraheemdev:help-msg-block-borrow, r=oli-obk
Fix help message for modification to &T created by &{t}

Previous:
```rust
error[E0594]: cannot assign to `*x` which is behind a `&` reference
 --> src/main.rs:3:5
  |
2 |     let x: &usize = &mut{0};
  |                     ------- help: consider changing this to be a mutable reference: `&mut mut{0}`
3 |     *x = 1;
  |     ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written
```
2021-07-26 16:04:36 +02:00
Guillaume Gomez
fc0b4848cb
Rollup merge of #87447 - RalfJung:not-null, r=oli-obk
Miri: santiy check that null pointer can never have an AllocId
2021-07-26 16:04:34 +02:00
bors
3bcce82d14 Auto merge of #87424 - RalfJung:const-check, r=oli-obk
rename const checking visitor module to check_consts::check

This avoids naming ambiguities with "const validation" which is in `interpret/validity.rs` and checks *values*.

r? `@oli-obk`
2021-07-26 03:10:42 +00:00
ibraheemdev
b4a873f548 fmt 2021-07-25 13:35:06 -04:00
ibraheemdev
70f282d469 fix help message for modification to &T created by &{t} 2021-07-25 13:17:47 -04:00
ibraheemdev
e8238a78df suggest removing unnecessary \&mut as help message 2021-07-25 10:24:37 -04:00
bors
70f74719a9 Auto merge of #85646 - Moxinilian:separate-const-switch, r=cjgillot
MIR opt: separate constant predecessors of a switch

For each block S ending with a switch, this pass copies S for each of S's predecessors that seem to assign the value being switched over as a const. This is done using a somewhat simple heuristic to determine what seems to be a const transitively.

More precisely, this is what the pass does:
- find a block that ends in a switch
- track if there is an unique place set before the current basic block that determines the result of the switch (this is the part that resolves switching over discriminants)
- if there is, iterate over the parents that have a reasonable terminator and find if the found determining place is likely to be (transitively) set from a const within that parent block
- if so, add the corresponding edge to a vector of edges to duplicate
- once this is done, iterate over the found edges: copy the target block and replace the reference to the target block in the origin block with the new block

This pass is not optimal and could probably duplicate in more cases, but the intention was mostly to address cases like in #85133 or #85365, to avoid creating new enums that get destroyed immediately afterwards (notably making the new try v2 `?` desugar zero-cost).

A benefit of this pass working the way it does is that it is easy to ensure its correctness: the worst that can happen is for it to needlessly copy a basic block, which is likely to be destroyed by cleanup passes afterwards. The complex parts where aliasing matters are only heuristics and the hard work is left to further passes like ConstProp.

# LLVM blocker

Unfortunately, I believe it would be unwise to enable this optimization by default for now. Indeed, currently switch lowering passes like SimplifyCFG in LLVM lose the information on the set of possible variant values, which means it tends to actually generate worse code with this optimization enabled. A fix would have to be done in LLVM itself. This is something I also want to look into. I have opened [a bug report at the LLVM bug tracker](https://bugs.llvm.org/show_bug.cgi?id=50455).

When this is done, I hope we can enable this pass by default. It should be fairly fast and I think it is beneficial in many cases. Notably, it should be a sound alternative to simplify-arm-identity. By the way, ConstProp only seems to pick up the optimization in functions that are not generic. This is however most likely an issue in ConstProp that I will look into afterwards.

This is my first contribution to rustc, and I would like to thank everyone on the Zulip mir-opt chat for the help and support, and especially `@scottmcm` for the guidance.
2021-07-25 13:51:48 +00:00
Matthias Krüger
3fd8cbb404 clippy::useless_format 2021-07-25 12:26:03 +02:00
Matthias Krüger
aa74c75d84 clippy:: append_instead_of_extend 2021-07-25 12:26:02 +02:00
Matthias Krüger
1c129f7b97 use vec![] macro to create Vector with first item inside instead of pushing to an empty vec![]
slightly reduces code bloat
2021-07-25 12:19:33 +02:00
Ralf Jung
f4861f3251 Miri: santiy check that null pointer can never have an AllocId 2021-07-25 11:31:57 +02:00
Kornel
a294aa8d3d Hide allocator details from TryReserveError 2021-07-24 22:25:08 +01:00
Ralf Jung
3b9f8116a2 get rid of NoMirFor error variant 2021-07-24 14:08:04 +02:00
Ralf Jung
83bc657e25 rename Validator → Checker 2021-07-24 13:27:17 +02:00
Ralf Jung
35d4d4ca14 rename const checking visitor module to check_consts::check 2021-07-24 13:25:30 +02:00
bors
f9b95f92c8 Auto merge of #86461 - crlf0710:rich_vtable, r=nikomatsakis
Refactor vtable format for upcoming trait_upcasting feature.

This modifies vtable format:
1. reordering occurrence order of methods coming from different traits
2. include `VPtr`s for supertraits where this vtable cannot be directly reused during trait upcasting.
Also, during codegen, the vtables corresponding to these newly included `VPtr` will be requested and generated.

For the cases where this vtable can directly used, now the super trait vtable has exactly the same content to some prefix of this one.

r? `@bjorn3`
cc `@RalfJung`
cc `@rust-lang/wg-traits`
2021-07-24 10:21:23 +00:00
Vytautas Astrauskas
b913a4591a Add a test for get_body_with_borrowck_facts. 2021-07-22 21:57:42 +02:00
Vytautas Astrauskas
ad2b4f4441 Enable compiler consumers to obtain Body with Polonius facts. 2021-07-22 21:57:42 +02:00
Oli Scherer
9f09a5eb8b Resolve nested inference variables.
I attempted that with the previous code, but I misunderstdood how
`shallow_resolve` works.
2021-07-22 11:20:29 +00:00
Oli Scherer
a8551abd47 Remove an unnecessary variable 2021-07-22 11:20:29 +00:00
Oli Scherer
6d76002baf Make mir borrowck's use of opaque types independent of the typeck query's result 2021-07-22 11:20:29 +00:00
Guillaume Gomez
fc1032647b
Rollup merge of #87311 - oli-obk:nll_suggestion_span, r=estebank
Get back the more precise suggestion spans of old regionck

I noticed that when you turn on nll, the structured suggestion replaces a snippet instead of appending a snippet. It seems clearer to the user to only highlight the newly added characters instead of the entire `impl Trait` (and old regionck already does it this way).

r? ``@estebank``
2021-07-21 15:52:51 +02:00
Guillaume Gomez
1008ace95c
Rollup merge of #87273 - fee1-dead:impl-const-impl-bounds, r=oli-obk
Recognize bounds on impls as const bounds

r? ```@oli-obk```
2021-07-21 15:52:47 +02:00
Oli Scherer
b3594f0d1d Get back the more precise suggestion spans of old regionck 2021-07-20 15:05:51 +00:00
Charles Lew
634638782b Switch to store Instance directly within VtblEntry, fix TraitVPtr representation. 2021-07-20 22:53:02 +08:00
Charles Lew
d2dc4276fd Refactor vtable format. 2021-07-20 22:14:42 +08:00
bors
718d53b0cb Auto merge of #87224 - RalfJung:miri-ptr-oob, r=oli-obk
miri: better ptr-out-of-bounds errors

For offsets larger than `isize::MAX`, display them as negative offsets.

r? `@oli-obk`
2021-07-20 08:15:15 +00:00
bors
a72c360a30 Auto merge of #87141 - spastorino:remove_impl_trait_in_bindings, r=oli-obk
Remove impl trait in bindings

Closes #86729

r? `@oli-obk`
2021-07-20 05:34:22 +00:00
Deadbeef
d05a286449
Iterate through impls only when permitted 2021-07-19 18:50:06 +08:00
Santiago Pastorino
75585b408f
Move mir_def_id inside eq_opaque_type_and_type 2021-07-18 09:30:11 -03:00
Santiago Pastorino
a002f4513b
Remove sub_types_or_anon 2021-07-18 09:30:11 -03:00
Santiago Pastorino
a0e1291c2d
Add sub_types docs 2021-07-18 09:30:11 -03:00
Santiago Pastorino
d98384595f
Removing unhandled region constraint error that is only for impl_trait_in_bindings 2021-07-18 09:30:09 -03:00
Ralf Jung
bed3b965ae miri: better ptr-out-of-bounds errors 2021-07-18 10:38:00 +02:00