Do not display hidden types, fixes issue 23912
Fixes#23912.
r? @QuietMisdreavus
(It's the one I was talking about a few days ago, just close it if it's useless.)
Make fmt::DebugList and friends forward formatting parameters
For example, formatting slice of integers with `{:04?}` should zero-pad each integer.
This also affects every use of `#[derive(Debug)]`.
nll part 5
Next round of changes from the nll-master branch.
Extensions:
- we now propagate ty-region-outlives constraints out of closures and into their creator when necessary
- we fix a few ICEs that can occur by doing liveness analysis (and the resulting normalization) during type-checking
- we handle the implicit region bound that assumes that each type `T` outlives the fn body
- we handle normalization of inputs/outputs in fn signatures
Not included in this PR (will come next):
- handling `impl Trait`
- tracking causal information
- extended errors
r? @arielb1
Outputs in InlineAsm can be read-write, so splitting it out is useful for things like Store-Store folding, as it cannot be done for a Store-AsmOutput.
This PR is intended to make no changes, just be the mechanical split of the enum. Future changes can use the split, like a MIR pass I'm working on and perhaps two-phase borrows.
Avoids ICEs such as the following:
error: internal compiler error: src\librustc_metadata\cstore_impl.rs:131:
get_optimized_mir: missing MIR for `DefId(8/0:40 ~
compiler_builtins[9532]::int[0]::addsub[0]::rust_i128_addo[0])`
Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.
Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
Move PhantomData<T> from Shared<T> to users of both Shared and #[may_dangle]
After discussing https://github.com/rust-lang/rust/issues/27730#issuecomment-316432083 today with @pnkfelix and @Gankro, we concluded that it’s ok for drop checking not to be much smarter than the current `#[may_dangle]` design which requires an explicit unsafe opt-in.
arbitrary_self_types: add support for raw pointer `self` types
This adds support for raw pointer `self` types, under the `arbitrary_self_types` feature flag. Types like `self: *const Self`, `self: *const Rc<Self>`, `self: Rc<*const Self` are all supported. Object safety checks are updated to allow`self: *const Self` and `self: *mut Self`.
This PR does not add support for `*const self` and `*mut self` syntax. That can be added in a later PR once this code is reviewed and merged.
#44874
r? @arielb1
Move collector to librustc_mir::monomorphize
cc https://github.com/rust-lang/rust/issues/44334 and https://github.com/rust-lang/rust/issues/45276
* I moved the collector to rustc_mir
* I renamed `TransItem` to `MonoItem`. _(I still need to fix up comments and variable names)_
* I got rid of `common.rs` and `monomorphize.rs` from `librustc_trans_utils`. I moved most of the functionality into `TyCtxt`. I realized that the `librustc_trans_utils::common.rs` was just copy pasted from `librustc_trans::common.rs`.
Should I also get rid of the `librustc_trans::common.rs` in this PR? Most of the functionality seems a bit useless, I decided to put some of it into `TyCtxt` but maybe that is not the correct action here.
Should I also get rid of `librustc_trans_utils` completely here? Or should I do it in a separate PR?