about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2019-06-19Change `ByRef` to a struct variant to clarify its fields via namesOliver Scherer-13/+21
2019-06-19Rollup merge of #61940 - spastorino:place-ty-iterate, r=oli-obkMazdak Farrokhzad-7/+19
Make Place::ty iterate r? @oli-obk Related to Place 2.0
2019-06-19Remove the `AllocId` from `ByRef` valuesOliver Scherer-4/+3
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.
2019-06-19Make `Allocation` stable hash robustOliver Scherer-5/+9
2019-06-19mark_definedness cannot failOliver Scherer-5/+7
2019-06-19Auto merge of #61172 - matthewjasper:cleanup-implied-bounds-lint, r=varkorbors-14/+12
Improve the explicit_outlives_requirements lint * Don't use Strings to compare parameters * Extend the lint to lifetime bounds * Extend the lint to enums and unions * Use the correct span for where clauses in tuple structs * Try to early-out where possible * Remove unnecessary bounds in rustc crates
2019-06-19Auto merge of #58351 - oli-obk:double_check_const_eval, r=RalfJungbors-3/+8
Refactor interning to properly mark memory as mutable or immutable r? @RalfJung This implementation is incomplete out of multiple reasons * [ ] add `-Zunleash_the_miri_inside_of_you` tests * [ ] report an error if there's an `UnsafeCell` behind a reference in a constant * [ ] make validity checks actually test whether the mutability of their allocations match what they see in the type
2019-06-19packed -> repr(packed)Oliver Scherer-1/+1
2019-06-19Fix comment about alignmentsOliver Scherer-2/+2
2019-06-19Explain existance of `Align` fieldOliver Scherer-1/+4
2019-06-19Weave the alignment through `ByRef`Oliver Scherer-3/+5
2019-06-19Auto merge of #61945 - Centril:rollup-xdqo2mn, r=Centrilbors-185/+238
Rollup of 11 pull requests Successful merges: - #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages) - #61701 (move stray run-pass const tests into const/ folder) - #61748 (Tweak transparent enums and unions diagnostic spans) - #61802 (Make MaybeUninit #[repr(transparent)]) - #61839 (ci: Add a script for generating CPU usage graphs) - #61842 (Remove unnecessary lift calls) - #61843 (Turn down the myriad-closures test) - #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.) - #61898 (syntax: Factor out common fields from `SyntaxExtension` variants) - #61938 (create an issue for miri even in status test-fail) - #61941 (Preserve generator and yield source for error messages) Failed merges: r? @ghost
2019-06-19Rollup merge of #61941 - cramertj:no-more-yield-errors, r=centrilMazdak Farrokhzad-100/+178
Preserve generator and yield source for error messages Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages. Fixes #60615.
2019-06-19Rollup merge of #61898 - petrochenkov:sekind, r=eddybMazdak Farrokhzad-14/+22
syntax: Factor out common fields from `SyntaxExtension` variants And some other related cleanups. Continuation of https://github.com/rust-lang/rust/pull/61606. This will also help to unblock https://github.com/rust-lang/rust/pull/61877.
2019-06-19Rollup merge of #61842 - Zoxc:trim-lift, r=eddybMazdak Farrokhzad-71/+38
Remove unnecessary lift calls Note that some of these might be useful for sanity checking that there's no infer types or regions. r? @eddyb
2019-06-18Preserve generator and yield source for error messagesTaylor Cramer-100/+178
Previously, error messages after HIR lowering all referred to generators and yield, regardless of whether the original source was a generator or an async/await body. This change tracks the kind of each generator and yield source in order to provide appropriately tailored error messages.
2019-06-18Remove the HirId/NodeId from where clausesMatthew Jasper-14/+12
Also give them a span in the HIR
2019-06-18Auto merge of #59625 - immunant:copy_variadics_typealias, r=eddybbors-4/+4
Refactor C FFI variadics to more closely match their C counterparts, and add Clone implementation We had to make some changes to expose `va_copy` and `va_end` directly to users (mainly for C2Rust, but not exclusively): - redefine the Rust variadic structures to more closely correspond to C: `VaList` now matches `va_list`, and `VaListImpl` matches `__va_list_tag` - add `Clone` for `VaListImpl` - add explicit `as_va_list()` conversion function from `VaListImpl` to `VaList` - add deref coercion from `VaList` to `VaListImpl` - add support for the `asmjs` target All these changes were needed for use cases like: ```Rust let mut ap2 = va_copy(ap); vprintf(fmt, ap2); va_end(&mut ap2); ```
2019-06-18Make Place::ty iterateSantiago Pastorino-7/+19
2019-06-18Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-6/+5
2019-06-18rustc: reintroduce lifetime bounds where necessary.Eduard-Mihai Burtescu-3/+3
2019-06-18rustc: remove unused lifetimes.Eduard-Mihai Burtescu-4/+4
2019-06-18rustc: remove leftover lifetimes with no bounds from where clauses.Eduard-Mihai Burtescu-5/+0
2019-06-18rustc: remove 'x: 'y bounds (except from comments/strings).Eduard-Mihai Burtescu-80/+80
2019-06-18syntax: Move `default_transparency` into `ExpnInfo`Vadim Petrochenkov-1/+8
2019-06-18syntax: Introduce `default`/`with_unstable` constructors for `ExpnInfo`Vadim Petrochenkov-8/+4
2019-06-18allow_internal_unstable: Avoid some more allocationsVadim Petrochenkov-5/+10
2019-06-17Expose `VaListImpl` as the Rust equivalent of `__va_list_tag` and implement ↵Andrei Homescu-4/+4
Clone for it.
2019-06-17change NodeId to HirId in some HIR docsljedrz-7/+7
2019-06-17simplify ICE handling in HirIdValidatorljedrz-12/+0
2019-06-17fix a HIR doc, simplify one HIR-related function callljedrz-3/+2
2019-06-17renamve hir_to_string to node_to_stringljedrz-25/+25
2019-06-17remove _by_hir_id if there is no NodeId counterpartljedrz-58/+58
2019-06-17replace some uses of NodeId with HirIdljedrz-142/+50
2019-06-16Auto merge of #61754 - nikomatsakis:trait-caching-perf-3, r=pnkfelixbors-82/+406
create a "provisional cache" to restore performance in the case of cycles Introduce a "provisional cache" that caches the results of auto trait resolutions but keeps them from entering the *main* cache until everything is ready. This turned out a bit more complex than I hoped, but I don't see another short term fix -- happy to take suggestions! In the meantime, it's very clear we need to rework the trait solver. This resolves the extreme performance slowdown experienced in #60846 -- I plan to add a perf.rust-lang.org regression test to track this. Caveat: I've not run `x.py test` in full yet. r? @pnkfelix cc @arielb1 Fixes #60846
2019-06-16Auto merge of #61739 - chansuke:separate-unit-tests, r=petrochenkovbors-710/+707
Separate unit tests I'm working on #61097. About half of the modules are done but dozens of modules are still remaining. I will rebase and squash the commits later.
2019-06-16Fix tidyVadim Petrochenkov-2/+0
2019-06-16Separate librustc modulechansuke-708/+707
2019-06-16Auto merge of #60730 - matthewjasper:optimize-false-edges, r=pnkfelixbors-13/+10
Optimize matches Attempt to fix or improve #60571 This is breaking some diagnostics because the MIR for match arms isn't in source order any more. cc @centril
2019-06-16Rollup merge of #61866 - sinkuu:redundant_clone, r=petrochenkovMazdak Farrokhzad-2/+2
Remove redundant `clone()`s
2019-06-15Rollup merge of #61844 - AaronKutch:master, r=CentrilMazdak Farrokhzad-1/+1
Change `...` to `..=` where applicable This is mainly to fix #61816, but I decided to manually check a few thousand `...` throughout the code base to check for any other cases. I think I found a documentation bug in `src\libsyntax\ast.rs` where both `1..` and `1...` where mentioned. If there is internal support for both `1..` and `1..=` (that can exist before error handling gets to it), then I can add that back. There were some other cases that look like `// struct Closure<'l0...'li, T0...Tj, CK, CS, U0...Uk> {`, `// <P0 as Trait<P1...Pn>>::Foo: 'a`, and `assert!(min <= max, "discriminant range is {}...{}", min, max);`, but I am not sure if I should change those. There are a bunch of cases in the `/test/` directory that could be changed, but I presume I should just leave those be.
2019-06-15Rollup merge of #61824 - rust-lang:single_derive, r=eddybMazdak Farrokhzad-0/+11
in which we decline to lint single-use lifetimes in `derive`d impls Resolves #53738. r? @eddyb
2019-06-15Remove unnecessary `.clone()`Shotaro Yamada-2/+2
2019-06-14Remove unnecessary lift callsJohn Kåre Alsaker-71/+38
2019-06-14Change `...` to `..=` where applicableAaron Kutch-1/+1
2019-06-14Auto merge of #61817 - eddyb:begone-gcx-attempt-2, r=oli-obkbors-2186/+1827
Unify all uses of 'gcx and 'tcx. This is made possible by @Zoxc landing #57214 (see https://github.com/rust-lang/rust/pull/57214#issuecomment-465036053 for the decision). A bit of context for the approach: just like #61722, this is *not* how I originally intended to go about this, but @Zoxc and my own experimentation independently resulted in the same conclusion: The interim alias `type TyCx<'tcx> = TyCtxt<'tcx, 'tcx>;` attempt required more work (adding `use`s), even only for handling the `TyCtxt<'tcx, 'tcx>` case and not the general `TyCtxt<'gcx, 'tcx>` one. What this PR is based on is the realization that `'gcx` is a special-enough name that it can be replaced, without caring for context, with `'tcx`, and then repetitions of the name `'tcx` be compacted away. After that, only a small number of error categories remained, each category easily dealt with with either more mass replacements (e.g. `TyCtxt<'tcx, '_>` -> `TyCtxt<'tcx>`) or by hand. For the `rustfmt` commit, I used https://github.com/rust-lang/rustfmt/issues/1324#issuecomment-482109952, and manually filtered out some noise, like in #61735 and #61722, and like the latter, there was also a weird bug to work around. It should be reviewed separately, and dropped if unwanted (in this PR it's pretty significant). cc @rust-lang/compiler r? @nikomatsakis
2019-06-14Run `rustfmt --file-lines ...` for changes from previous commits.Eduard-Mihai Burtescu-513/+364
2019-06-14Unify all uses of 'gcx and 'tcx.Eduard-Mihai Burtescu-1802/+1592
2019-06-14in which we decline to lint single-use lifetimes in `derive`d implsZack M. Davis-0/+11
Resolves #53738.
2019-06-14in which we decline to suggest the anonymous lifetime in declarationsZack M. Davis-8/+33
The elided-lifetimes-in-path lint (part of our suite of Rust 2018 idiom lints which we are hoping to promote to Warn status) was firing with an illegal suggestion to write an anonymous lifetime in a struct/item declaration (where we don't allow it). The linting code was already deciding whether to act on the basis of a `ParamMode` enum, indicating whether the present path-segment was part of an expression, or anywhere else. The present case seemed to be part of the "anywhere else", and yet meriting different rules as far as the lint was concerned, so it seemed expedient to introduce a new enum member. We yank out a `TyKind::Path` arm into its own method so that we can call it with our new `ParamMode` specifically when lowering struct fields. (The alternative strategy of changing the signature of `lower_ty` to take a `ParamMode` would be inelegant given that most of the `TyKind` match arm bodies therein don't concern themselves with `ParamMode`.) Resolves #61124.