about summary refs log tree commit diff
path: root/compiler/rustc_mir/src
AgeCommit message (Collapse)AuthorLines
2021-02-27Rollup merge of #82607 - bjorn3:frame_loc_getter, r=RalfJungDylan DPC-0/+10
Add a getter for Frame.loc This is necessary for Priroda. For context see https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Frame.3A.3Aloc.20no.20longer.20public/near/228070266 and oli-obk/priroda#27. cc `@DJMcNab` r? `@RalfJung`
2021-02-27Rollup merge of #82498 - tmiasko:partitioning-debug, r=matthewjasperDylan DPC-6/+15
Use log level to control partitioning debug output
2021-02-27Add a getter for Frame.locbjorn3-0/+10
This is necessary for Priroda.
2021-02-27Use optional values for inlining thresholdsTomasz Miąsko-2/+2
Turn inlining threshold into optional values to make it possible to configure different defaults depending on the current mir-opt-level.
2021-02-27Add option enabling MIR inlining independently of mir-opt-levelTomasz Miąsko-15/+20
2021-02-27Rollup merge of #82482 - tmiasko:small-cycles, r=varkorDylan DPC-7/+4
Use small hash set in `mir_inliner_callees` Use small hash set in `mir_inliner_callees` to avoid temporary allocation when possible and quadratic behaviour for large number of callees.
2021-02-27Rollup merge of #82442 - Aaron1011:fix/closure-mut-crash, r=matthewjasperDylan DPC-25/+26
Skip emitting closure diagnostic when closure_kind_origins has no entry Fixes #82438 This map is not guarnateed to have an entry for a closure.
2021-02-26Auto merge of #82559 - tmiasko:inlined, r=petrochenkovbors-0/+1
Miscellaneous inlining improvements Inline a few small and hot functions.
2021-02-26Rollup merge of #82491 - tmiasko:i, r=lcnrGuillaume Gomez-124/+146
Consider inexpensive inlining criteria first Refactor inlining decisions so that inexpensive criteria are considered first: 1. Based on code generation attributes. 2. Based on MIR availability (examines call graph). 3. Based on MIR body.
2021-02-26Rollup merge of #82456 - klensy:or-else, r=estebankGuillaume Gomez-1/+1
Replaced some unwrap_or and map_or with lazy variants Replaced some `unwrap_or` and `map_or` with `unwrap_or_else` and `map_or_else`.
2021-02-26Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-seGuillaume Gomez-1/+0
Stabilize str_split_once Closes #74773
2021-02-26Auto merge of #78429 - casey:doctest-attribute-splitting, r=jyn514bors-2/+2
[librustdoc] Only split lang string on `,`, ` `, and `\t` Split markdown lang strings into tokens on `,`. The previous behavior was to split lang strings into tokens on any character that wasn't a `_`, `_`, or alphanumeric. This is a potentially breaking change, so please scrutinize! See discussion in #78344. I noticed some test cases that made me wonder if there might have been some reason for the original behavior: ``` t("{.no_run .example}", false, true, Ignore::None, true, false, false, false, v(), None); t("{.sh .should_panic}", true, false, Ignore::None, false, false, false, false, v(), None); t("{.example .rust}", false, false, Ignore::None, true, false, false, false, v(), None); t("{.test_harness .rust}", false, false, Ignore::None, true, true, false, false, v(), None); ``` It seemed pretty peculiar to specifically test lang strings in braces, with all the tokens prefixed by `.`. I did some digging, and it looks like the test cases were added way back in [this commit from 2014](https://github.com/rust-lang/rust/commit/3fef7a74ca9a) by `@skade.` It looks like they were added just to make sure that the splitting was permissive, and aren't testing that those strings in particular are accepted. Closes https://github.com/rust-lang/rust/issues/78344.
2021-02-26Miscellaneous inlining improvementsTomasz Miąsko-0/+1
Inline a few small and hot functions.
2021-02-25Auto merge of #82338 - RalfJung:interp-error-allocs, r=oli-obkbors-10/+2
all InterpError allocate now, so adjust alloc-error-check Cc https://github.com/rust-lang/rust/pull/82116#discussion_r578310770 r? `@oli-obk`
2021-02-25fix reviewklensy-1/+1
2021-02-24Auto merge of #82159 - BoxyUwU:uwu, r=varkorbors-4/+7
Use correct param_env in conservative_is_privately_uninhabited cc `@lcnr` r? `@varkor` since this is your FIXME that was removed ^^
2021-02-24Auto merge of #80475 - simonvandel:fix-77355, r=oli-obkbors-18/+146
New mir-opt pass to simplify gotos with const values (reopening #77486) Reopening PR #77486 Fixes #77355 This pass optimizes the following sequence ```rust bb2: { _2 = const true; goto -> bb3; } bb3: { switchInt(_2) -> [false: bb4, otherwise: bb5]; } ``` into ```rust bb2: { _2 = const true; goto -> bb5; } ```
2021-02-24Add suggestion for iterators in iteratorsKevin Per-4/+29
2021-02-24Use log level to control partitioning debug outputTomasz Miąsko-6/+15
2021-02-24Use small hash set in `mir_inliner_callees`Tomasz Miąsko-7/+4
Use small hash set in `mir_inliner_callees` to avoid temporary allocation when possible and quadratic behaviour for large number of callees.
2021-02-24Consider inexpensive inlining criteria firstTomasz Miąsko-124/+146
Refactor inlining decisions so that inexpensive criteria are considered first: 1. Based on code generation attributes. 2. Based on MIR availability (examines call graph). 3. Based on MIR body.
2021-02-24replaced some map_or with map_or_elseklensy-1/+1
2021-02-23yeetEllen-4/+7
2021-02-23Rollup merge of #82362 - osa1:issue81918, r=oli-obkDylan DPC-5/+18
Fix mir-cfg dumps Fixes #81918 Fixes #82326 (duplicate) Fixes #82325 --- r? ``@oli-obk``
2021-02-23Rollup merge of #81629 - 1000teslas:issue-81365-fix, r=Aaron1011Dylan DPC-4/+37
Point out implicit deref coercions in borrow Fixes #81365 `@Aaron1011` I'm not sure why my code shows the note even in an implicit `Deref` call. See the output for `issue-81365-8.rs`.
2021-02-23Skip emitting closure diagnostic when closure_kind_origins has no entryAaron Hill-25/+26
Fixes #82438 This map is not guarnateed to have an entry for a closure.
2021-02-23Rollup merge of #82091 - henryboisdequin:use-place-ref-more, r=RalfJungDylan DPC-14/+14
use PlaceRef abstractions more consistently Addresses this [comment](https://github.com/rust-lang/rust/pull/80865/files#r558978715) Associated issue: #80647 r? ```@RalfJung```
2021-02-22New mir-opt pass to simplify gotos with const valuesSimon Vandel Sillesen-18/+146
Fixes #77355
2021-02-22Fix mir-cfg dumpsÖmer Sinan Ağacan-5/+18
Fixes #81918 Fixes #82326 (duplicate) Fixes #82325
2021-02-22Auto merge of #77551 - simonvandel:extend-simplify-branch-same, r=oli-obkbors-3/+207
MIR-OPT: Pass to deduplicate blocks This pass finds basic blocks that are completely equal, and replaces all uses with just one of them. ```bash $ RUSTC_LOG=rustc_mir::transform::deduplicate_blocks ./x.py build --stage 2 | grep "SUCCESS: Replacing: " > log ... $ cat log | wc -l 23875 ```
2021-02-22Extract deref coercion explanation into method1000teslas-3/+6
2021-02-21New pass to deduplicate blocksSimon Vandel Sillesen-1/+196
2021-02-21Make MatchBranchSimplification clean up after itselfSimon Vandel Sillesen-1/+10
2021-02-21Drive-by formatting of commentSimon Vandel Sillesen-2/+2
2021-02-21remove redundant wrapping of return types of allow_internal_unstable() and ↵Matthias Krüger-2/+1
rustc_allow_const_fn_unstable()
2021-02-21rustc_mir: remove redundant wrapping of return type in numeric_intrinsic()Matthias Krüger-7/+3
2021-02-20Rollup merge of #82176 - RalfJung:mir-fn-ptr-pretty, r=oli-obkGuillaume Gomez-1/+1
fix MIR fn-ptr pretty-printing An uninitialized function pointer would get printed as `{{uninit fn()}` (notice the unbalanced parentheses), and a dangling fn ptr would ICE. This fixes both of that. However, I have no idea how to add tests for this. Also, I don't understand this MIR pretty-printing code. Somehow the print function `pretty_print_const_scalar` actually *returns* a transformed form of the const (but there is no doc comment explaining what is being returned); some match arms do `p!` while others do `self =`, and there's a wild mixture of `p!` and `write!`... all very mysterious and confusing.^^ r? ``@oli-obk``
2021-02-20all InterpError allocate now, so adjust alloc-error-checkRalf Jung-10/+2
2021-02-20make `super_projection` take a `PlaceRef`Henry Boisdequin-2/+1
2021-02-20Auto merge of #82124 - tmiasko:op-ty-ref, r=oli-obkbors-358/+401
Pass large interpreter types by reference, not value r? `@ghost`
2021-02-19Add deref definition location1000teslas-0/+1
Update conflict_errors.rs Add deref definition location
2021-02-18Stabilize `unsafe_op_in_unsafe_fn` lintLeSeulArtichaut-3/+2
2021-02-18Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.Eduard-Mihai Burtescu-3/+3
2021-02-18Rollup merge of #82240 - matthiaskrgr:qmark, r=Dylan-DPCYuki Okushi-1/+1
remove useless ?s (clippy::needless_question_marks) Example code: ```rust fn opts() -> Option<String> { let s: Option<String> = Some(String::new()); Some(s?) // this can just be "s" } ```
2021-02-18Rollup merge of #82212 - est31:graph_graph_graph, r=oli-obkYuki Okushi-4/+4
Remove redundant rustc_data_structures path component
2021-02-17remove useless ?s (clippy::needless_question_marks)Matthias Krüger-1/+1
Example code: ``` fn opts() -> Option<String> { let s: Option<String> = Some(String::new()); Some(s?) // this can just be "s" } ```
2021-02-17Auto merge of #82235 - GuillaumeGomez:rollup-oflxc08, r=GuillaumeGomezbors-7/+4
Rollup of 11 pull requests Successful merges: - #79981 (Add 'consider using' message to overflowing_literals) - #82094 (To digit simplification) - #82105 (Don't fail to remove files if they are missing) - #82136 (Fix ICE: Use delay_span_bug for mismatched subst/hir arg) - #82169 (Document that `assert!` format arguments are evaluated lazily) - #82174 (Replace File::create and write_all with fs::write) - #82196 (Add caveat to Path::display() about lossiness) - #82198 (Use internal iteration in Iterator::is_sorted_by) - #82204 (Update books) - #82207 (rustdoc: treat edition 2021 as unstable) - #82231 (Add long explanation for E0543) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-02-17Rollup merge of #82136 - edward-shen:mismatched-subst-and-hir, r=lcnrGuillaume Gomez-7/+4
Fix ICE: Use delay_span_bug for mismatched subst/hir arg Fixes #82126.
2021-02-17Remove redundant rustc_data_structures path componentest31-4/+4
2021-02-17Reduce size of InterpErrorInfo to 8 bytesTomasz Miąsko-18/+25