about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-07-15Add debug assertions to write_bytes and copy*Valentin Tolmer-4/+35
2019-07-15Auto merge of #62629 - matthewjasper:cleanup-borrowck-errors, r=petrochenkovbors-322/+128
Cleanup borrowck errors This removes some of the unnecessary code that allowed sharing error reporting between two borrow checkers. closes #59193
2019-07-15Auto merge of #62674 - RalfJung:miri-abi, r=eddybbors-2/+7
RustIntrinsic and PlatformIntrinsic are also the same ABI as Rust r? @eddyb
2019-07-15Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkovbors-15/+91
Detect `fn` with a body in an `extern` block Fix #62109.
2019-07-14Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkovbors-61/+42
Do not emit type errors after parse error in last statement of block When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-14`pub(crate)` -> `crate`Matthew Jasper-27/+27
The borrow checker code is already using `crate` extensively, so prefer being consistent with it.
2019-07-14Move suggest_ref_mut into rustc_mir::borrow_checkMatthew Jasper-18/+14
2019-07-14Remove BorrowckErrors traitMatthew Jasper-135/+109
Its methods are now inherent methods of `MirBorrowckCtxt`
2019-07-14Remove rustc_mir::borrowck_errors::OriginMatthew Jasper-78/+19
2019-07-14Remove unused BorrowckErrors methodsMatthew Jasper-108/+3
2019-07-14Auto merge of #62638 - estebank:issue-62554, r=petrochenkovbors-22/+52
Use snippet instead of pprinting statement Fix #62554.
2019-07-14Auto merge of #62610 - Stargateur:fix-miri-error-cstring-into_inner, r=RalfJungbors-5/+6
Fix miri error in into_inner() of CString Fix #62553 I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work. r? @RalfJung
2019-07-14remove outdated commentRalf Jung-1/+0
2019-07-14Auto merge of #62464 - GuillaumeGomez:add-missing-urls-osstr, r=QuietMisdreavusbors-3/+4
Add missing urls for osstr r? @QuietMisdreavus
2019-07-14RustIntrinsic and PlatformIntrinsic are also the same ABI as RustRalf Jung-1/+7
2019-07-13review commentEsteban Küber-2/+2
2019-07-14Auto merge of #62331 - wesleywiser:fix_early_return_leak, r=matthewjasperbors-1/+92
Fix leak when early returning out of `box` syntax Fixes #62289 r? @matthewjasper
2019-07-13Detect `fn` with a body in an `extern` blockEsteban Küber-15/+91
2019-07-13Auto merge of #62584 - eddyb:circular-math-is-hard, r=pnkfelixbors-24/+126
rustc_codegen_ssa: fix range check in codegen_get_discr. Fixes #61696, see https://github.com/rust-lang/rust/issues/61696#issuecomment-505473018 for more details. In short, I had wanted to use `x - a <= b - a` to check whether `x` is in `a..=b` (as it's 1 comparison instead of 2 *and* `b - a` is guaranteed to fit in the same data type, while `b` itself might not), but I ended up with `x - a + c <= b - a + c` instead, because `x - a + c` was the final value needed. That latter comparison is equivalent to checking that `x` is in `(a - c)..=b`, i.e. it also includes `(a - c)..a`, not just `a..=b`, so if `c` is not `0`, it will cause false positives. This presented itself as the non-niche ("dataful") variant sometimes being treated like a niche variant, in the presence of uninhabited variants (which made `c`, aka the index of the first niche variant, arbitrarily large). r? @nagisa, @rkruppe or @oli-obk
2019-07-13Auto merge of #62659 - Centril:rollup-90oz643, r=Centrilbors-88/+312
Rollup of 5 pull requests Successful merges: - #62577 (Add an AtomicCell abstraction) - #62585 (Make struct_tail normalize when possible) - #62604 (Handle errors during error recovery gracefully) - #62636 (rustbuild: Improve assert about building tools once) - #62651 (Make some rustc macros more hygienic) Failed merges: r? @ghost
2019-07-13Rollup merge of #62651 - matthewjasper:rustc-macro-hygiene, r=petrochenkovMazdak Farrokhzad-40/+31
Make some rustc macros more hygienic
2019-07-13Rollup merge of #62636 - alexcrichton:assert-build-cargo-once, r=Mark-SimulacrumMazdak Farrokhzad-21/+48
rustbuild: Improve assert about building tools once In developing #61557 I noticed that there were two parts of our tools that were rebuilt twice on CI. One was rustfmt fixed in #61557, but another was Cargo. The actual fix for Cargo's double compile was rust-lang/cargo#7010 and took some time to propagate here. In an effort to continue to assert that Cargo is itself not compiled twice, I updated the assertion in rustbuild at the time of working on #61557 but couldn't land it because the fix wouldn't be ready until the next bootstrap. The next bootstrap is now here, so the fix can now land! This does not change the behavior of rustbuild but it is intended to catch the previous iteration of compiling cargo twice. The main update here was to consider more files than those in `$target/release/deps` but also consider those in `$target/release`. That's where, for example, `libcargo.rlib` shows up and it's the file we learn about, and that's what we want to deduplicate.
2019-07-13Rollup merge of #62604 - estebank:unemitted-err-ice, r=pnkfelixMazdak Farrokhzad-4/+27
Handle errors during error recovery gracefully Fix #62546.
2019-07-13Rollup merge of #62585 - ↵Mazdak Farrokhzad-22/+151
pnkfelix:issue-60431-make-struct-tail-normalize-when-possible, r=eddyb Make struct_tail normalize when possible As noted in commit message: this replaces the existing methods to extract the struct tail(s) with new entry points that make the handling of normalization explicit. Most of the places that call `struct_tail` are during codegen, post type-checking, and therefore they can get away with using `tcx.normalize_erasing_regions` (this is the entry point `struct_tail_erasing_lifetimes`) For other cases that may arise, one can use the core method, which is parameterized over the normalization `Ty -> Ty` closure (`struct_tail_with_normalize`). Or one can use the trivial entry point that does not normalization (`struct_tail_without_normalization`) ---- I spent a little while trying to make a test that exposed the bug via `impl Trait` rather than a projection, but I failed to find something that tripped up the current nightly `rustc`. * I have *not* spent any time trying to make tests that trip up the other places where `struct_tail` was previously being called. While I do think the task of making such tests could be worthwhile, I am simply running out of time. (Its also possible that the layout code is always the first point called, and thus it may be pointless to try to come up with such tests.) I also spent a little time discussing with @eddyb where this code should live. They suggested moving `struct_tail` and its sibling `struct_lockstep_tails` to the `LayoutCx`. But in the interest of time, I have left that refactoring (which may be questionable at this point) to a follow-up task. ---- Fix #60431
2019-07-13Rollup merge of #62577 - Zoxc:atomic-cell, r=matthewjasperMazdak Farrokhzad-1/+55
Add an AtomicCell abstraction Split out from https://github.com/rust-lang/rust/pull/61923.
2019-07-13Auto merge of #62468 - rust-lang:mutable-overloaded-operators, r=estebankbors-269/+282
Improve diagnostics for invalid mutation through overloaded operators Closes #58864 Closes #52941 Closes #57839
2019-07-13Auto merge of #60266 - albins:polonius-liveness, r=nikomatsakisbors-624/+445
Fact generation for liveness calculations in Polonius This PR tracks ongoing work to extend `rustc` with support for generating variable use, definition, and later also drop output for the Polonius solver, the whole of which is being tracked in [Polonius Issue #104](https://github.com/rust-lang/polonius/issues/104).
2019-07-13Make `register_[long_]diagnostics` hygienicMatthew Jasper-10/+10
2019-07-13Make `newtype_index` hygienic and use allow_internal_unstableMatthew Jasper-30/+21
2019-07-13Fix miri error in into_inner() of CStringAntoine PLASKOWSKI-5/+6
2019-07-13Auto merge of #61953 - Centril:shared-from-iter, r=RalfJungbors-140/+652
Add `impl<T> FromIterator<T> for Arc/Rc<[T]>` Add implementations of `FromIterator<T> for Arc/Rc<[T]>` with symmetrical logic. This also takes advantage of specialization in the case of iterators with known length (`TrustedLen`) to elide the final allocation/copying from a `Vec<T>` into `Rc<[T]>` because we can allocate the space for the `Rc<[T]>` directly when the size is known. This is the primary motivation and why this is to be preferred over `iter.collect::<Vec<_>>().into(): Rc<[T]>`. Moreover, this PR does some refactoring in some places. r? @RalfJung for the code cc @alexcrichton from T-libs
2019-07-13Auto merge of #62613 - lzutao:clippy-up, r=Manishearthbors-7/+9
submodules: Update clippy from 316da7eb to b0290424 r? @Manishearth
2019-07-12Do not emit type errors after parse error in last statement of blockEsteban Küber-61/+42
When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-12add testsEsteban Küber-0/+35
2019-07-12Use snippet instead of pprinting statementEsteban Küber-22/+17
2019-07-12rustbuild: Improve assert about building tools onceAlex Crichton-21/+48
In developing #61557 I noticed that there were two parts of our tools that were rebuilt twice on CI. One was rustfmt fixed in #61557, but another was Cargo. The actual fix for Cargo's double compile was rust-lang/cargo#7010 and took some time to propagate here. In an effort to continue to assert that Cargo is itself not compiled twice, I updated the assertion in rustbuild at the time of working on #61557 but couldn't land it because the fix wouldn't be ready until the next bootstrap. The next bootstrap is now here, so the fix can now land! This does not change the behavior of rustbuild but it is intended to catch the previous iteration of compiling cargo twice. The main update here was to consider more files than those in `$target/release/deps` but also consider those in `$target/release`. That's where, for example, `libcargo.rlib` shows up and it's the file we learn about, and that's what we want to deduplicate.
2019-07-12rustfmt all the things!Albin Stjerna-602/+246
2019-07-12polonius: add generation of liveneness-related factsAlbin Stjerna-20/+197
Notably contains an ugly hack to generate initialization information for variables that will go away when we have that functionality in Polonius.
2019-07-12Rollup merge of #62623 - ↵Mazdak Farrokhzad-14/+99
pnkfelix:issue-62614-downgrade-indirect-structural-match-lint-to-allow, r=zackmdavis downgrade indirect_structural_match lint to allow This is a short-term band-aid for the regression aspect of #62614.
2019-07-12Rollup merge of #62608 - delan:async-unsafe-fn-tests, r=CentrilMazdak Farrokhzad-2/+118
`async unsafe fn` tests - cc #62121 r? @Centril
2019-07-12Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkovMazdak Farrokhzad-2/+16
Correctly break out of recovery loop Fix #61858.
2019-07-12Rollup merge of #62605 - estebank:emit-dropped-err, r=pnkfelixMazdak Farrokhzad-12/+16
Emit dropped unemitted errors to aid in ICE debugging
2019-07-12Rollup merge of #62599 - RalfJung:uninit, r=cramertjMazdak Farrokhzad-1/+1
move mem::uninitialized deprecation back by 1 release, to 1.39 As per discussion at https://github.com/rust-lang/rust/issues/53491#issuecomment-509271182. Three releases also agrees with the precedent from `trim_left/right`. Three releases means that even nightly users (including rustc itself) get a full cycle from when the announcement is made in the stable release to when nightly starts to warn.
2019-07-12Rollup merge of #62595 - ngoldbaum:path-clarity-doc, r=CentrilMazdak Farrokhzad-1/+5
Document that the crate keyword refers to the project root :wave: this is my first rust contribution so I hope I'm doing everything correctly. Help very much appreciated if I'm not. As far as I can tell this use of `crate` is only documented [in the edition guide for rust 2018](https://doc.rust-lang.org/edition-guide/rust-2018/module-system/path-clarity.html#the-crate-keyword-refers-to-the-current-crate). However it should probably be in the documentation for the `crate` keyword itself. This adds that documentation.
2019-07-12Rollup merge of #62578 - JohnTitor:add-test-for-49919, r=alexcrichtonMazdak Farrokhzad-0/+16
Add test for #49919 Closes #49919
2019-07-12Rollup merge of #62568 - lzutao:replace_may_dangle, r=matthewjasperMazdak Farrokhzad-150/+32
Replace unsafe_destructor_blind_to_params with may_dangle This PR will completely remove support for `#[unsafe_destructor_blind_to_params]` attribute, which is deprecated in #38970 by `[may_dangle]` unsafe attribute. Closes #34761
2019-07-12Rollup merge of #62453 - zackmdavis:single_path, r=estebankMazdak Farrokhzad-26/+99
in which we suggest anonymizing single-use lifetimes in paths Following @nikomatsakis's [October 2017 comment](https://github.com/rust-lang/rust/issues/44752#issuecomment-340885834). ![path_anon_suggest](https://user-images.githubusercontent.com/1076988/60761598-e2619180-a000-11e9-9144-1bdf8eb848e3.png) r? @estebank cc @eddyb (you were saying something about running single-use-lifetimes against the tree the other week?)
2019-07-12Rollup merge of #62431 - czipperz:add-messages-to-must-use-is_-methods, ↵Mazdak Farrokhzad-4/+5
r=scottmcm Add messages to `Option`'s and `Result`'s `must_use` annotation for `is_*` r? @RalfJung
2019-07-12Rollup merge of #62274 - eddyb:const-false-unwind, r=pnkfelixMazdak Farrokhzad-28/+58
rustc_mir: follow FalseUnwind's real_target edge in qualify_consts. As far as I can tell, this was accidentally omitted from #47802. Fixes #62272. r? @matthewjasper or @nikomatsakis
2019-07-12Rollup merge of #61535 - ↵Mazdak Farrokhzad-0/+36
ohadravid:test-generic-with-default-assiociated-type-re-rebalance-coherence, r=nikomatsakis Coherence test when a generic type param has a default value from an associated type A followup on #61400. Before `re_rebalance_coherence`, this fails to compile (even though it should be accepted). `re_rebalance_coherence` had no direct test for this, and I wanted to (a) make sure it doesn't regress in the future and (b) get it on record that this is actually the intended behavior.