about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-02-16Rollup merge of #58293 - xfix:patch-16, r=Mark-Simulacrumkennytm-23/+7
Remove code for updating copyright years in generate-deriving-span-tests It's no longer necessary, as there is no license header anymore.
2019-02-16Rollup merge of #58196 - varkor:const-fn-feature-gate-error, r=oli-obkkennytm-103/+352
Add specific feature gate error for const-unstable features Before: ``` error: `impl Trait` in const fn is unstable --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ error: aborting due to previous error ``` After: ``` error[E0723]: `impl Trait` in const fn is unstable (see issue #57563) --> src/lib.rs:7:19 | 7 | const fn foo() -> impl T { | ^^^^^^ = help: add #![feature(const_fn)] to the crate attributes to enable error: aborting due to previous error ``` This improves the situation with https://github.com/rust-lang/rust/issues/57563. Fixes https://github.com/rust-lang/rust/issues/57544. Fixes https://github.com/rust-lang/rust/issues/54469. r? @oli-obk
2019-02-16Rollup merge of #58074 - scottmcm:stabilize-sort_by_cached_key, r=SimonSapinkennytm-14/+9
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
2019-02-16Rollup merge of #57981 - Zoxc:fix-57979, r=nikomatsakiskennytm-1/+60
Fix #57730 cc https://github.com/rust-lang/rust/pull/57730 r? @cramertj
2019-02-15nll: remove `IdentityMap` and `LiveVariableMap`Lucas Molas-97/+41
With `NllLivenessMap` and `LiveVar` removed, the `IdentityMap` (remaining structure implementing the `LiveVariableMap` trait) loses its meaning. Specialize the `LiveVarSet` to a `BitSet<Local>` removing the `V` and related parameters. The `LiveVarSet<V>` was only being used as `LiveVarSet<Local>` so this commit doesn't bring any change to the logic, it just removes an unused parameter (that without `LiveVar` now, it couldn't have been specialized to anything but `Local`).
2019-02-15nll: remove `NllLivenessMap` and `LiveVar`Lucas Molas-117/+71
Extract the `compute` logic (now renamed `compute_live_locals`) from `NllLivenessMap` to the `liveness` module. Remove the unused structures.
2019-02-15nll: remove `NllLivenessMap` from `LocalUseMap`Lucas Molas-33/+52
Extend `LocalUseMap`'s `IndexVec`s that track def/use/drop data to store the original `Local` indexes and not the compacted `LiveVar` ones (favoring speed and code simplicity over space). Remove the `NllLivenessMap` embedded inside it since it's no longer needed to perform the `LiveVar`/`Local` conversion.
2019-02-15nll: remove `NllLivenessMap` from `LivenessContext`Lucas Molas-32/+27
It was used in `compute_for_all_locals` to iterate only the `Local`s that need liveness analysis (filtered through `compute`). Instead, explicitly extract that reduced set (as `live_locals`) in `trace` and pass it to `compute_for_all_locals`. Change the variable type used in `compute_for_all_locals` from `LiveVar` to `Local` and do the same for its helper functions (and the functions in `LocalUseMap` they rely on): * `add_defs_for` -> `LocalUseMap::defs` * `compute_use_live_points_for` -> `LocalUseMap::uses` * `compute_drop_live_points_for` -> `LocalUseMap::drops` Push back the use of `LiveVar` to the `LocalUseMap` (where the other `NllLivenessMap` remains embedded) functions which internally do the `from_local` conversion.
2019-02-15Fix rebase issuevarkor-2/+2
2019-02-15Update testsvarkor-12/+12
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Take Const into account with nonstandard style lintvarkor-0/+10
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Drive-by cleanupvarkor-20/+10
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Take Const into account in HIRvarkor-113/+166
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Add E0111varkor-0/+4
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Add Const kind to rustdocvarkor-6/+75
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Move const generic error from lowering to collectvarkor-16/+28
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Add pretty-printing for const genericsvarkor-18/+21
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Add Const kind to HIRvarkor-1/+17
Co-Authored-By: Gabriel Smith <yodaldevoid@users.noreply.github.com>
2019-02-15Auto merge of #57880 - Zoxc:error-on-cycle, r=michaelwoeristerbors-178/+149
Always emit an error for a query cycle r? @michaelwoerister cc @nikomatsakis @wesleywiser
2019-02-15Fix documentation for std::path::PathBuf::popNathan-2/+1
Closes #58474.
2019-02-15Auto merge of #58406 - Disasm:rv64-support, r=nagisabors-0/+68
Add riscv64{imac,gc}-unknown-none-elf targets Previous attempt by @fintelia: https://github.com/rust-lang/rust/pull/58012 Related: https://github.com/rust-embedded/wg/issues/218
2019-02-15fix tests post-rebaseFelix S. Klock II-14/+14
2019-02-15Fix runtime error in generate-keyword-testsKonrad Borowski-2/+2
The script was made unusable after removing license headers.
2019-02-15make generalization code create new variables in correct universeNiko Matsakis-31/+110
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.
2019-02-15include more universe information in `debug!` printoutsNiko Matsakis-5/+17
2019-02-15print more information for closures when `-Zverbose` is givenNiko Matsakis-0/+9
Ideally, we'd probably print the closure substs themselves actually.
2019-02-15Auto merge of #58403 - eddyb:requalify, r=oli-obkbors-578/+851
rustc_mir: split qualify_consts' "value qualification" bitflags into separate computations. Prerequisite for computing those bits through a dataflow algorithm ~~(which I might do in this PR later)~~. This PR should not change behavior overall, other than treating `simd_shuffle*` identically to `#[rustc_args_required_const]` (maybe we should just have `#[rustc_args_required_const]` on the intrinsic imports of `simd_shuffle*`? cc @gnzlbg) cc @oli-obk @alexreg
2019-02-15Fix SECURITY_SQOS_PRESENT missingPaul Dicker-2/+5
if security_qos_flags(SECURITY_ANONYMOUS) is set
2019-02-15compile-pass test for #53606Saleem Jaffer-0/+8
2019-02-15Fix the syntax error in publish_toolstate.pykennytm-3/+3
2019-02-15Remove `stolen`John Kåre Alsaker-4/+0
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-178/+153
2019-02-14make Centril happyRalf Jung-3/+3
2019-02-14Whitelist the ARM v8 target-featuregnzlbg-0/+1
2019-02-14split MaybeUninit into several features, expand docs a bitRalf Jung-33/+55
2019-02-14Add updated NLL testsvarkor-37/+108
2019-02-14add .stderr fileNiko Matsakis-0/+17
2019-02-14remove MaybeUninit::into_innerRalf Jung-8/+0
2019-02-14update stdsimdRalf Jung-2/+2
2019-02-14fixed for libstd buildRalf Jung-1/+6
2019-02-14add missing feature flagRalf Jung-0/+1
2019-02-14update stdsimdRalf Jung-0/+0
2019-02-14Fix documentation typovarkor-2/+2
2019-02-14Update const fn testsvarkor-65/+202
2019-02-14Add specific error for unstable const fn featuresvarkor-1/+42
2019-02-14Require defining uses to use generic parameters for all parameters of a ↵Oliver Scherer-27/+98
generic existential type
2019-02-14rustc_mir: compute all the qualification bits separately in qualify_consts.Eduard-Mihai Burtescu-364/+504
2019-02-14rustc_mir: rename qualify_consts::Qualifier to ConstCx and keep in Checker ↵Eduard-Mihai Burtescu-34/+35
as a field.
2019-02-14rustc_mir: do not treat NEEDS_DROP as unexpected in qualify_consts.Eduard-Mihai Burtescu-8/+3
2019-02-14rustc_mir: avoid having an Option around each local qualification in ↵Eduard-Mihai Burtescu-59/+48
qualify_consts.