about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-12-02Fix Mir visitor macro to ensure it calls the proper method to invalidate the ↵Paul Daniel Faria-12/+24
predecessors cache
2019-12-02Add pass to ensure predecessors cache is generated after optimizationPaul Daniel Faria-15/+3
2019-12-02Stop invalidating predecessors cache when accessing unique basic block, ↵Paul Daniel Faria-8/+41
invalidate cache when accessing unique terminator
2019-12-02Get rid of old commentPaul Daniel Faria-1/+0
2019-12-02Inline cache impl into Body, rename predecessor fns, change output of ↵Paul Daniel Faria-89/+36
predecessors_for to slice
2019-12-02Remove interior mutability in mir predecessors cachePaul Daniel Faria-16/+25
2019-12-02Auto merge of #66874 - RalfJung:miri-assert-panic, r=oli-obkbors-0/+7
Miri engine: proper support for `Assert` MIR terminators This puts down the basis for https://github.com/rust-lang/miri/issues/1070, and I also did some clean-up. The Miri side of this is at https://github.com/rust-lang/miri/pull/1084. r? @oli-obk
2019-12-02miri: add throw_machine_stop macroRalf Jung-0/+7
2019-12-02Rollup merge of #66245 - tmiasko:cfg-sanitize, r=oli-obkRalf Jung-0/+15
Conditional compilation for sanitizers Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
2019-12-02Add From instances for Pointer -> ScalarMaybeUndef and Pointer -> ImmediateRalf Jung-0/+7
2019-12-02Rollup merge of #66926 - RalfJung:miri-stop, r=oli-obkMazdak Farrokhzad-16/+12
add reusable MachineStop variant to Miri engine error enum Replace the Miri-tool-specific `Exit` error variant with something dynamically typed that all clients of the Miri engine can use. r? @oli-obk Cc https://github.com/rust-lang/rust/issues/66902
2019-12-02Rollup merge of #66907 - eddyb:br-nicer-named, r=oli-obkMazdak Farrokhzad-2/+6
rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl. Context: these `fmt::Debug` impls only get used with `-Z verbose` (which some tests use). I was going to print the path like in #66850 (or rather, use `DefId`'s `fmt::Debug`, which is close but not as nice), but then I realized that most of the `DefId`s were `crate0:DefIndex(0)`, i.e. the crate root. As the crate root is not a lifetime, they're clearly dummies of some sort, and we don't have to print anything other than the name for them. This means that out of all the tests, there's only 5 instances of `BrNamed` that now print the full path to the lifetime parameter, and everything else is shorter instead, which doesn't feel too bad. cc @nikomatsakis
2019-12-02Rollup merge of #66905 - petrochenkov:rmplugin2, r=CentrilMazdak Farrokhzad-6/+1
rustc_plugin: Remove some remaining plugin features - Plugin arguments (`#![plugin(my_plugin(args))]`) are no longer supported. - Registering additional plugins from command line (`-Z extra-plugins=my_plugin`) is no longer supported, `-Z crate-attr=plugin(my_plugin)` can be used instead. - Lint `plugin_as_library` is removed as mostly useless now, when plugins exist as a compatibility feature with greatly reduced functionality. - Plugins registering additional LLVM passes (`Registry::register_llvm_pass`) are no longer supported, `-C passes=my_passes` can be used instead. r? @Centril
2019-12-02Rollup merge of #66850 - eddyb:span-free-formats, r=oli-obkMazdak Farrokhzad-3/+7
rustc: hide HirId's fmt::Debug output from -Z span_free_formats. This replaces the only occurrences of `HirId {...}` from tests with paths, i.e.: ```rust [closure@HirId { owner: DefIndex(4), local_id: 15 } q:&i32, t:&T] ``` becomes, after this PR: ```rust [closure@foo<T>::{{closure}}#0 q:&i32, t:&T] ``` r? @oli-obk cc @michaelwoerister
2019-12-02Rollup merge of #66789 - eddyb:mir-source-scope-local-data, r=oli-obkMazdak Farrokhzad-6/+12
rustc: move mir::SourceScopeLocalData to a field of SourceScopeData. By having one `ClearCrossCrate<SourceScopeLocalData>` for each scope, as opposed to a single `ClearCrossCrate` for all the `SourceScopeLocalData`s, we can represent the fact that some scopes have `SourceScopeLocalData` associated with them, and some don't. This is useful when doing MIR inlining across crates, because the `ClearCrossCrate` will be `Clear` for the cross-crate MIR scopes and `Set` for the local ones. Also see https://github.com/rust-lang/rust/pull/66203#issuecomment-555589574 for some context around this approach. Fixes #51314.
2019-12-01Remove ord lang itemcad97-1/+0
2019-12-01rustc_plugin: Remove support for plugins adding LLVM passesVadim Petrochenkov-2/+0
2019-12-01rustc_plugin: Remove support for adding plugins from command lineVadim Petrochenkov-4/+1
2019-12-01Miri core engine: use throw_ub instead of throw_panicRalf Jung-5/+21
2019-12-01add reusable MachineStop variant to Miri engine error enumRalf Jung-16/+12
2019-12-01Conditional compilation for sanitizersTomasz Miąsko-0/+15
Configure sanitize option when compiling with a sanitizer to make it possible to execute different code depending on whether given sanitizer is enabled or not.
2019-12-01Rollup merge of #66832 - RalfJung:const-prop-no-alloc, r=oli-obkMazdak Farrokhzad-7/+13
const_prop: detect and avoid catching Miri errors that require allocation r? @wesleywiser @oli-obk
2019-12-01Rollup merge of #66726 - CAD97:miri-recursion-limit, r=RalfJungMazdak Farrokhzad-4/+0
Use recursion_limit for const eval stack limit cc https://github.com/rust-lang/miri/issues/643 @orium @RalfJung I'm really not certain how exactly to handle this change, but it looks like it's that simple. Reuse `recursion_limit` ("The maximum recursion limit for potentially infinitely recursive operations such as auto-dereference and monomorphization") which is configurable by the user for the const evaluation stack frame limit. The other option is to make `const_eval_stack_frame_limit` configurable in the same way as `recursion_limit` (but I'm not sure how to do that and it'd be a bigger change). Fixes https://github.com/rust-lang/miri/issues/643.
2019-12-01Rollup merge of #66679 - mark-i-m:fix-anon-lifetime-errors, r=matthewjasperMazdak Farrokhzad-1/+1
Improve lifetime errors with implicit trait object lifetimes r? @matthewjasper cc @estebank I still think the ideal solution would be to construct a `BrAnon`, but that seems like a more invasive change, and can be done later. This at least gets rid of the hack in `OutliveSuggestion` and is slightly more principled.
2019-11-30Rollup merge of #66895 - Centril:rustc_feature, r=oli-obkMazdak Farrokhzad-27/+28
Feature gating *declarations* => new crate `rustc_feature` This PR moves the data-oriented parts of feature gating into its own crate, `rustc_feature`. The parts consist of some data types as well as `accepted`, `active`, `removed`, and `builtin_attrs`. Feature gate checking itself remains in `syntax::feature_gate::check`. The parts which define how to emit feature gate errors could probably be moved to `rustc_errors` or to the new `rustc_session` crate introduced in #66878. The visitor itself could probably be moved as a pass in `rustc_passes` depending on how the dependency edges work out. The PR also contains some drive-by cleanup of feature gate checking. As such, the PR probably best read commit-by-commit. r? @oli-obk cc @petrochenkov cc @Mark-Simulacrum
2019-11-30Rollup merge of #66883 - eddyb:we-cant-have-nice-things, r=oli-obkMazdak Farrokhzad-14/+35
rustc_typeck: gate AnonConst's generics on feature(const_generics). This PR employs the fix for #43408 when `#![feature(const_generics)]` is enabled, making the feature-gate the opt-in for all the possible breakage this may incur. For example, if this PR lands, this will cause a cycle error (due to #60471): ```rust #![feature(const_generics)] fn foo<T: Into<[u8; 4]>>() {} ``` And so will anything with type-level const expressions, in its bounds. Surprisingly, `impl`s don't seem to be affected (if they were, even libcore wouldn't compile). One thing I'm worried about is not knowing how much unstable code out there, using const-generics, will be broken. But types like `Foo<{N+1}>` never really worked, and do after this PR, just not in bounds - so ironically, it's type-level const expressions that don't depend on generics, which will break (in bounds). Also, if we do this, we'll have effectively blocked stabilization of const generics on #60471. r? @oli-obk cc @varkor @yodaldevoid @nikomatsakis
2019-11-30rustc: don't just show raw DefIndex's in BrNamed's fmt::Debug impl.Eduard-Mihai Burtescu-2/+6
2019-11-30move GateIssue to rustc_feature & simplify emit_feature_errMazdak Farrokhzad-13/+17
2019-11-29Use recursion_limit for const eval stack limitcad97-4/+0
2019-11-30move UnstableFeatures -> rustc_featureMazdak Farrokhzad-3/+3
2019-11-30rustc: move mir::SourceScopeLocalData to a field of SourceScopeData.Eduard-Mihai Burtescu-6/+5
2019-11-30rustc: move MIR source_scope_local_data's ClearCrossCrate to be around elements.Eduard-Mihai Burtescu-2/+9
2019-11-30introduce crate rustc_feature and move active, accepted, and removed to itMazdak Farrokhzad-11/+8
2019-11-30rustc: fix ty::Const::eval's handling of inference variables.Eduard-Mihai Burtescu-14/+35
2019-11-29Rollup merge of #66793 - matthewjasper:record-static-refs, r=cramertjRalf Jung-0/+17
Record temporary static references in generator witnesses Closes #66695 * Record the pointer to static's type in MIR. * Normalize the static's type (so that constants can be compared correctly).
2019-11-29Rollup merge of #66791 - cjgillot:arena, r=Mark-SimulacrumRalf Jung-7/+9
Handle GlobalCtxt directly from librustc_interface query system This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface. This simplifies the code to construct it, at the expense of added complexity in the query control flow. This allows to handle the arenas directly from librustc_interface. Based on #66707 r? @Zoxc
2019-11-29Rollup merge of #66613 - Areredify:trait-ref-print, r=eddybRalf Jung-31/+77
Allow customising ty::TraitRef's printing behavior This pr allows to explicitly choose which representation of `TraitRef` (`<T as Trait<U>>` or `Trait<U>`) you want to print. `Debug` and `Display` representations of `TraitRef` now match. Closes #59188.
2019-11-29Auto merge of #66321 - ninjasource:async-fn-resume-after-completion, r=oli-obkbors-9/+29
Async fn resume after completion #65419 -- Attempting to run an async fn after completion mentions generators Not yet ready for review - work in progress Just need to run the tests on a proper build server
2019-11-29improve lifetime errors with implicit trait object lifetimesMark Mansi-1/+1
2019-11-29Auto merge of #66697 - petrochenkov:nocstore, r=eddybbors-22/+10
rustc_metadata: Privatize more things and a couple of other refactorings This PR continues https://github.com/rust-lang/rust/pull/66496 and hits the point of diminishing returns. All fields of `CrateRoot` and `CrateMetadata` are privatized. For read-only fields this certainly makes sense, but for a few fields updateable from outside of `rmeta.rs` (mostly `creader.rs`) it was done mostly for consistency, I can make them `pub(crate)` again if requested. `cstore.rs` (which became small after #66496) was merged into `creader.rs`. A few things noticed while making the privacy changes were addressed in the remaining refactoring commits. Fixes https://github.com/rust-lang/rust/issues/66550 r? @eddyb @Mark-Simulacrum
2019-11-29allow customising ty::TraitRef's printing behaviorMikhail Babenko-31/+77
fix clippy allow customising ty::TraitRef's printing behavior fix clippy stylistic fix
2019-11-29Auto merge of #66645 - RalfJung:dereferenceable, r=pnkfelixbors-1/+8
remove the 'dereferenceable' attribute from Box Fixes https://github.com/rust-lang/rust/issues/66600 r? @eddyb @rkruppe
2019-11-29Auto merge of #66590 - Aaron1011:fix/real-impl-trait-coherence, r=varkorbors-15/+33
Apply proper commit from PR #63934 While working on PR #63934, I accidentally reverted to an older version of the PR while working on a rebase. The PR was then merged, not with the later, approved changes, but with earlier, unapproved changes. This PR applies the changes that were *suppoesd* to be mereged in PR #63934. All of the proper tests appear to have been merged in PR #63934, so this PR adds no new tests
2019-11-28rustc: hide HirId's fmt::Debug output from -Z span_free_formats.Eduard-Mihai Burtescu-3/+7
2019-11-28review commentsEsteban Küber-76/+78
2019-11-28Deduplicate type param constraint suggestion codeEsteban Küber-67/+91
2019-11-28Apply proper commit from PR #63934Aaron Hill-15/+33
While working on PR #63934, I accidentally reverted to an older version of the PR while working on a rebase. The PR was then merged, not with the later, approved changes, but with earlier, unapproved changes. This PR applies the changes that were *suppoesd* to be mereged in PR #63934. All of the proper tests appear to have been merged in PR #63934, so this PR adds no new tests Fixes #66580
2019-11-28rustc: Move some queries to `rustc_metadata`Vadim Petrochenkov-23/+3
2019-11-28rustc_metadata: Move `has_global_allocator` from session to cstoreVadim Petrochenkov-4/+5
2019-11-28rustc_metadata: Privatize `CrateMetadata::extern_crate`Vadim Petrochenkov-0/+7