about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
AgeCommit message (Collapse)AuthorLines
2021-07-10rustc_span: Revert addition of `proc_macro` field to `ExpnKind::Macro`Vadim Petrochenkov-5/+2
The flag has a vague meaning and is used for a single diagnostic change that is low benefit and appears only under `-Z macro_backtrace`.
2021-07-11Rollup merge of #87028 - aDotInTheVoid:patch-1, r=petrochenkovYuki Okushi-1/+1
Fix type: `'satic` -> `'static` Pointed out on discord: https://discord.com/channels/273534239310479360/490356824420122645/863434443170250793 ~~The fact that this compiles is probably a bug.~~ Nope it's `#![feature(in_band_lifetimes)]` (Thanks to [floppy](https://discord.com/channels/273534239310479360/490356824420122645/863437381671059486) ~~[The docs](https://doc.rust-lang.org/stable/nightly-rustc/rustc_mir/transform/inline/struct.Inliner.html#method.check_codegen_attributes) seem to indicate rust thinks this function is generic over the lifetime `'satic`~~ This is because of `in_band_lifetimes`
2021-07-10Fix typo: `satic` -> `static`Nixon Enraght-Moony-1/+1
2021-07-10Update testsDeadbeef-1/+1
2021-07-10Update CTFE to allow fns marked with the attrDeadbeef-6/+9
2021-07-10Permit calls to default const fns of impl constDeadbeef-7/+25
2021-07-10functions marked with attr are not constDeadbeef-3/+0
2021-07-10Skip check for calling functions in same traitDeadbeef-3/+11
2021-07-10Treat trait fns marked with the attr as constDeadbeef-1/+4
2021-07-10remove const_raw_ptr_to_usize_cast featureRalf Jung-40/+16
2021-07-09Rollup merge of #87000 - m-ou-se:const-panic-track-caller, r=oli-obkMara Bos-2/+11
Use #[track_caller] in const panic diagnostics. This change stops const panic diagnostics from reporting inside #[track_caller] functions by skipping over them.
2021-07-09Use #[track_caller] in const panic diagnostics.Mara Bos-2/+11
It was already used for the message. This also uses it for the spans used for the error and backtrace.
2021-07-08PR feedbackScott McMurray-1/+2
- Add `:Sized` assertion in interpreter impl - Use `Scalar::from_bool` instead of `ScalarInt: From<bool>` - Remove unneeded comparison in intrinsic typeck - Make this UB to call with undef, not just return undef in that case
2021-07-08Stop generating `alloca`s+`memcmp` for simple array equalityScott McMurray-0/+18
2021-07-08Rework SESSION_GLOBALS API to prevent overwriting itGuillaume Gomez-2/+2
2021-07-08Move [debug_]assert_matches to mod {core, std}::assert.Mara Bos-0/+1
2021-07-07Add help on reinitialization between move and accessPaul Trojahn-18/+74
Fixes #83760
2021-07-07Auto merge of #86901 - sexxi-goose:query_remove, r=nikomatsakisbors-2/+4
Make type_implements_trait not a query r? `@nikomatsakis`
2021-07-06Make type_implements_trait not a queryAman Arora-2/+4
2021-07-06Store macro parent module in ExpnData.Camille GILLOT-1/+1
2021-07-05Auto merge of #86674 - Aaron1011:new-querify-limits, r=michaelwoeristerbors-12/+39
Query-ify global limit attribute handling Currently, we read various 'global limits' from inner attributes the crate root (`recursion_limit`, `move_size_limit`, `type_length_limit`, `const_eval_limit`). These limits are then stored in `Sessions`, allowing them to be access from a `TyCtxt` without registering a dependency on the crate root attributes. This PR moves the calculation of these global limits behind queries, so that we properly track dependencies on crate root attributes. During the setup of macro expansion (before we've created a `TyCtxt`), we need to access the recursion limit, which is now done by directly calling into the code shared by the normal query implementations.
2021-07-05Rollup merge of #86862 - tmiasko:re-export-SwitchIntEdgeEffects, ↵Yuki Okushi-1/+1
r=jonas-schievink re-export SwitchIntEdgeEffects This makes it possible to use `switch_int_edge_effects` outside `rustc_mir::dataflow::impls`.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-7/+7
2021-07-04Auto merge of #86866 - nikomatsakis:issue-84841, r=oli-obkbors-13/+13
Hack: Ignore inference variables in certain queries Fixes #84841 Fixes #86753 Some queries are not built to accept types with inference variables, which can lead to ICEs. These queries probably ought to be converted to canonical form, but as a quick workaround, we can return conservative results in the case that inference variables are found. We should file a follow-up issue (and update the FIXMEs...) to do the proper refactoring. cc `@arora-aman` r? `@oli-obk`
2021-07-04Query-ify global limit attribute handlingAaron Hill-12/+39
2021-07-04remove some ad-hoc has_infer_types checks that aren't needed anymoreNiko Matsakis-15/+13
2021-07-04allow inference vars in type_implements_traitNiko Matsakis-1/+3
2021-07-04re-export SwitchIntEdgeEffectsTomasz Miąsko-1/+1
This makes it possible to use `switch_int_edge_effects` outside `rustc_mir::dataflow::impls`.
2021-07-04Auto merge of #86255 - Smittyvb:mir-alloc-oom, r=RalfJung,oli-obkbors-13/+26
Support allocation failures when interpreting MIR This closes #79601 by handling the case where memory allocation fails during MIR interpretation, and translates that failure into an `InterpError`. The error message is "tried to allocate more memory than available to compiler" to make it clear that the memory shortage is happening at compile-time by the compiler itself, and that it is not a runtime issue. Now that memory allocation can fail, it would be neat if Miri could simulate low-memory devices to make it easy to see how much memory a Rust program needs. Note that this breaks Miri because it assumes that allocation can never fail.
2021-07-03add note about MAX_ALLOC_LIMITSmittyvb-1/+1
Co-authored-by: Ralf Jung <post@ralfj.de>
2021-07-03Make vtable_allocation always succeedSmitty-1/+1
2021-07-02Allocation failure in constprop panics right awaySmitty-1/+7
2021-07-02Improve error reporting for modifications behind `&` referencesFabian Wolff-4/+20
2021-07-03Remove `ty::Binder::bind()`Yuki Okushi-6/+1
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2021-07-01Auto merge of #86304 - klensy:hex-length, r=jackh726bors-1/+21
rustc_mir: calc hex number length without string allocation
2021-07-01rustc_mir: calc hex number length without string allocationklensy-1/+21
2021-06-30Delay ICE on evaluation failSmitty-68/+15
2021-06-30Properly evaluate non-consts in const propSmitty-8/+51
2021-06-30Simplify memory failure checkingSmitty-17/+16
2021-06-30Auto merge of #86695 - sexxi-goose:closure_size, r=nikomatsakisbors-0/+81
Introduce -Zprofile-closures to evaluate the impact of 2229 This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +nightly rustc --lib -- -Zprofile-closures cargo +nightly rustc --bin {binary_name} -- -Zprofile-closures ``` r? `@nikomatsakis`
2021-06-30Rename is_spurious -> is_volatileSmitty-2/+2
2021-06-29Properly handle const prop failuresSmitty-0/+13
2021-06-29Unwrap allocated Location at creationSmitty-14/+9
2021-06-29Simplify const_prop logicSmitty-11/+9
2021-06-29Support allocation failures when interperting MIRSmitty-26/+38
Note that this breaks Miri. Closes #79601
2021-06-28Introduce -Zprofile-closures to evaluate the impact of 2229Aman Arora-0/+81
This creates a CSV with name "closure_profile_XXXXX.csv", where the variable part is the process id of the compiler. To profile a cargo project you can run one of the following depending on if you're compiling a library or a binary: ``` cargo +stage1 rustc --lib -- -Zprofile-closures cargo +stage1 rustc --bin -- -Zprofile-closures ```
2021-06-28Update other codegens to use tcx managed vtable allocations.Charles Lew-91/+6
2021-06-27Change miri to use tcx allocated allocations.Charles Lew-29/+36
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-1/+1
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-25Auto merge of #85603 - ogoffart:fix-uninhabited-enum-branching-pass, ↵bors-7/+5
r=wesleywiser Fix uninhabited enum branching pass when the discriminant is taken with some projection.