summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-04-06Don't report deprecation lints in derive expansionsOliver Scherer-2/+20
2019-03-17Do not accidentally treat multi-segment meta-items as single-segmentVadim Petrochenkov-29/+35
2019-03-16Make migrate mode work at item level granularityMatthew Jasper-2/+6
2019-03-16Temporarily emulate the (accidentally) omitted recursion during impl Trait ↵Felix S. Klock II-0/+14
check. Note that the two previous visitors were omitting slightly different recursive calls, so I need two flags to properly emulate them.
2019-02-25Auto merge of #58649 - ↵bors-1/+10
pnkfelix:issue-57464-avoid-ice-when-region-sneaks-into-impl-trait, r=pnkfelix avoid ICE when region sneaks into impl trait Addresses non-NLL instances of #57464
2019-02-25Rollup merge of #58723 - Centril:deny-elided_lifetimes_in_paths-librustc, ↵Mazdak Farrokhzad-2/+0
r=oli-obk librustc: deny(elided_lifetimes_in_paths) As part of the Rust 2018 transition, remove `#![allow(elided_lifetimes_in_paths)]` from `librustc`. r? @oli-obk
2019-02-25Rollup merge of #58690 - kenta7777:reduce-code-repetition-miri-related, ↵Mazdak Farrokhzad-3/+2
r=oli-obk Reduce a Code Repetition like `(n << amt) >> amt` Fixes a part of [#49937](https://github.com/rust-lang/rust/issues/49937).
2019-02-25librustc: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-2/+0
2019-02-25Auto merge of #57609 - matthewjasper:more-restrictive-match, r=pnkfelixbors-5/+15
Use normal mutable borrows in matches `ref mut` borrows are currently two-phase with NLL enabled. This changes them to be proper mutable borrows. To accommodate this, first the position of fake borrows is changed: ```text [ 1. Pre-match ] | [ (old create fake borrows) ] [ 2. Discriminant testing -- check discriminants ] <-+ | | | (once a specific arm is chosen) | | | [ (old read fake borrows) ] | [ 3. Create "guard bindings" for arm ] | [ (create fake borrows) ] | | | [ 4. Execute guard code ] | [ (read fake borrows) ] --(guard is false)-----------+ | | (guard results in true) | [ 5. Create real bindings and execute arm ] | [ Exit match ] ``` The following additional changes are made to accommodate `ref mut` bindings: * We no longer create fake `Shared` borrows. These borrows are no longer needed for soundness, just to avoid some arguably strange cases. * `Shallow` borrows no longer conflict with existing borrows, avoiding conflicting access between the guard borrow access and the `ref mut` borrow. There is some further clean up done in this PR: * Avoid the "later used here" note for Shallow borrows (since it's not relevant with the message provided) * Make any use of a two-phase borrow activate it. * Simplify the cleanup_post_borrowck passes into a single pass. cc #56254 r? @nikomatsakis
2019-02-25Rollup merge of #58697 - taiki-e:question-in-macros, r=CentrilMazdak Farrokhzad-6/+6
Use ? in some macros
2019-02-24Auto merge of #58315 - gnzlbg:returns_twice, r=alexcrichtonbors-0/+3
Implement unstable ffi_return_twice attribute This PR implements [RFC2633](https://github.com/rust-lang/rfcs/pull/2633) r? @eddyb
2019-02-24Use ? in some macrosTaiki Endo-6/+6
2019-02-24Rollup merge of #58511 - oli-obk:const_to_op, r=RalfJungMazdak Farrokhzad-6/+6
Const to op simplification r? @RalfJung alternative to https://github.com/rust-lang/rust/pull/58486
2019-02-24reduce a code repetition like (n << amt) >> amtkenta7777-3/+2
2019-02-24Auto merge of #58232 - ljedrz:HirIdification_continued, r=Zoxcbors-200/+201
HirId-ify intravisit A big step towards https://github.com/rust-lang/rust/pull/57578. This affects mostly `hir::{collector, intravisit}` and `rustc::lint`.
2019-02-23Auto merge of #57051 - Eijebong:parking_lot, r=nikomatsakisbors-1/+1
Update parking_lot to 0.7 Unfortunately this'll dupe parking_lot until the data_structures crate is published and be updated in rls in conjunction with crossbeam-channel
2019-02-23Implement ffi_returns_twice attributegnzlbg-0/+3
2019-02-23Rollup merge of #58476 - nnethercote:rm-LazyTokenStream, r=petrochenkovMazdak Farrokhzad-7/+7
Remove `LazyTokenStream`. `LazyTokenStream` was added in #40939. Perhaps it was an effective optimization then, but no longer. This PR removes it, making the code both simpler and faster. r? @alexcrichton
2019-02-22Fix #57979 by allowing a legitimate type error to take precedence over an ICE.Felix S. Klock II-1/+10
2019-02-22Update parking_lot to 0.7Bastien Orivel-1/+1
Unfortunately this'll dupe parking_lot until the data_structures crate is published and be updated in rls in conjunction with crossbeam-channel
2019-02-21Use normal mutable borrows in MIR match loweringMatthew Jasper-5/+15
2019-02-21partially revert 904a0bde93f0348f69914ee90b1f8b6e4e0d7cbcNiko Matsakis-1/+19
This preserves the error you currently get on stable for the old-lub-glb-object.rs test.
2019-02-21update test files to reflect new outputNiko Matsakis-0/+12
One surprise: old-lub-glb-object.rs, may indicate a bug
2019-02-21restore the actual leak-checkNiko Matsakis-14/+193
2019-02-21introduce a dummy leak check and invoke it in all the right placesNiko Matsakis-39/+105
This set of diffs was produced by combing through b68fad670bb3612cac26e50751e4fd9150e59977 and seeing where the `leak_check` used to be invoked and how.
2019-02-21reintroduce `commit_if_ok` calls to `subtype_predicate`Niko Matsakis-14/+16
2019-02-21reintroduce `commit_if_ok` call into `higher_ranked_sub`Niko Matsakis-26/+25
2019-02-21s/skol_/placeholder_/Niko Matsakis-10/+10
2019-02-20Auto merge of #58056 - nikomatsakis:issue-57843-universe-leak, r=pnkfelixbors-26/+90
make generalization code create new variables in correct universe In our type inference system, when we "generalize" a type T to become a suitable value for a type variable V, we sometimes wind up creating new inference variables. So, for example, if we are making V be some subtype of `&'X u32`, then we might instantiate V with `&'Y u32`. This generalized type is then related `&'Y u32 <: &'X u32`, resulting in a region constriant `'Y: 'X`. Previously, however, we were making these fresh variables like `'Y` in the "current universe", but they should be created in the universe of V. Moreover, we sometimes cheat in an invariant context and avoid creating fresh variables if we know the result must be equal -- we can only do that when the universes work out. Fixes #57843 r? @pnkfelix
2019-02-20Auto merge of #58578 - kennytm:rollup, r=kennytmbors-22/+26
Rollup of 24 pull requests Successful merges: - #56470 (Modify doctest's auto-`fn main()` to allow `Result`s) - #58044 (Make overflowing and wrapping negation const) - #58303 (Improve stability tags display) - #58336 (Fix search results interactions) - #58384 (Fix tables display) - #58392 (Use less explicit shifting in std::net::ip) - #58409 (rustdoc: respect alternate flag when formatting impl trait) - #58456 (Remove no longer accurate diagnostic code about NLL) - #58528 (Don't use an allocation for ItemId in StmtKind) - #58530 (Monomorphize less code in fs::{read|write}) - #58534 (Mention capping forbid lints) - #58536 (Remove UB in pointer tests) - #58538 (Add missing fmt structs examples) - #58539 (Add alias methods to PathBuf for underlying OsString (#58234)) - #58544 (Fix doc for rustc "-g" flag) - #58545 (Add regression test for a specialization-related ICE (#39448)) - #58546 (librustc_codegen_llvm => 2018) - #58551 (Explain a panic in test case net::tcp::tests::double_bind) - #58553 (Use more impl header lifetime elision) - #58562 (Fix style nits) - #58565 (Fix typo in std::future::Future docs) - #58568 (Fix a transposition in driver.rs.) - #58569 (Reduce Some Code Repetitions like `(n << amt) >> amt`) - #58576 (Stabilize iter::successors and iter::from_fn)
2019-02-20adjust intravisit HirIdificationljedrz-16/+12
2019-02-20hir: remove parent_node from NodeCollectorljedrz-24/+17
2019-02-20hir: change HirIdValidator.hir_ids_seen to a setljedrz-10/+15
2019-02-20hir: add and use hir_to_node_id in NodeCollectorljedrz-32/+34
2019-02-20hir: HirId-ify intravisitljedrz-181/+186
2019-02-20Rollup merge of #58562 - dlrobertson:fix_nits, r=alexregkennytm-12/+19
Fix style nits Fix style nits discovered in reading code. r? @alexreg
2019-02-20Rollup merge of #58528 - Zoxc:stmtkind-item, r=oli-obkkennytm-6/+7
Don't use an allocation for ItemId in StmtKind
2019-02-20Rollup merge of #58456 - lzutao:nll, r=Centrilkennytm-4/+0
Remove no longer accurate diagnostic code about NLL r? @steveklabnik
2019-02-19Auto merge of #57896 - oli-obk:permissive_existence, r=cramertjbors-3/+19
Be more permissive with required bounds on existential types fixes #54184 r? @pnkfelix
2019-02-19Auto merge of #58503 - varkor:const-generics-hir, r=petrochenkovbors-135/+150
Add const generics to the HIR Split out from https://github.com/rust-lang/rust/pull/53645. cc @yodaldevoid r? @eddyb
2019-02-18Fix style nitsDan Robertson-12/+19
Fix style nits discovered in reading code.
2019-02-18Remove some unnecessary `into()` calls.Nicholas Nethercote-1/+1
These are probably leftovers from recent `TokenStream` simplifications.
2019-02-18Make `interpolated_to_tokenstream` a method on `Nonterminal`.Nicholas Nethercote-1/+1
2019-02-18Remove `LazyTokenStream`.Nicholas Nethercote-1/+1
It's present within `Token::Interpolated` as an optimization, so that if a nonterminal is converted to a `TokenStream` multiple times, the first-computed value is saved and reused. But in practice it's not needed. `interpolated_to_tokenstream()` is a cold function: it's only called a few dozen times while compiling rustc itself, and a few hundred times across the entire `rustc-perf` suite. Furthermore, when it is called, it is almost always the first conversion, so no benefit is gained from it. So this commit removes `LazyTokenStream`, along with the now-unnecessary `Token::interpolated()`. As well as a significant simplification, the removal speeds things up slightly, mostly due to not having to `drop` the `LazyTokenStream` instances.
2019-02-18Change `Token::interpolated_to_tokenstream()`.Nicholas Nethercote-5/+5
It is currently a method of `Token`, but it only is valid to call if `self` is a `Token::Interpolated`. This commit eliminates the possibility of misuse by changing it to an associated function that takes a `Nonterminal`, which also simplifies the call sites. This requires splitting out a new function, `nonterminal_to_string`.
2019-02-17Rollup merge of #58509 - phansch:add_myself_to_clippy_toolstate_maintainers, ↵kennytm-150/+103
r=oli-obk Notify myself when Clippy toolstate changes
2019-02-17Don't use an allocation for ItemId in StmtKindJohn Kåre Alsaker-6/+7
2019-02-16Reintroduce the invariant comment for clarityOliver Scherer-0/+1
2019-02-16Reuse the `Pointer` type instead of passing reassembling it at many use sitesOliver Scherer-6/+5
2019-02-16Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapinkennytm-1/+0
Stabilize slice_sort_by_cached_key I was going to ask on the tracking issue (https://github.com/rust-lang/rust/issues/34447), but decided to just send this and hope for an FCP here. The method was added last March by https://github.com/rust-lang/rust/pull/48639. Signature: https://doc.rust-lang.org/std/primitive.slice.html#method.sort_by_cached_key ```rust impl [T] { pub fn sort_by_cached_key<K, F>(&mut self, f: F) where F: FnMut(&T) -> K, K: Ord; } ``` That's an identical signature to the existing `sort_by_key`, so I think the questions are just naming, implementation, and the usual "do we want this?". The implementation seems to have proven its use in rustc at least, which many uses: https://github.com/rust-lang/rust/search?l=Rust&q=sort_by_cached_key (I'm asking because it's exactly what I just needed the other day: ```rust all_positions.sort_by_cached_key(|&n| data::CITIES.iter() .map(|x| *metric_closure.get_edge(n, x.pos).unwrap()) .sum::<usize>() ); ``` since caching that key is a pretty obviously good idea.) Closes #34447