summary refs log tree commit diff
path: root/src/librustc/ty
AgeCommit message (Collapse)AuthorLines
2018-04-26Allow variant discriminant initializers to refer to other initializers of ↵Oliver Schneider-17/+23
the same enum
2018-04-23Auto merge of #50182 - alexcrichton:beta-next, r=alexcrichtonbors-0/+8
[beta] Another round of backports This is a backport of: * https://github.com/rust-lang/rust/pull/50039 * https://github.com/rust-lang/rust/pull/50121
2018-04-23Improve assertion in Query::force().Michael Woerister-1/+10
2018-04-21Bring back old fallback semantics: Without feature(never_type), fallback to ↵Felix S. Klock II-0/+8
`()`, not `!`. Note that this commit, since it is trying to be minimal in order to ease backporting to the beta and release channels, does *not* include the old future-proofing warnings that we used to have associated with such fallback to `()`; see discussion at this comment: https://github.com/rust-lang/rust/issues/49691#issuecomment-381266730
2018-04-20Paper over a bug on masterAlex Crichton-2/+4
This commit papers over #49889 (introducing a fixme pointing at #50125) for a bug that was introduced with #49695. This workaround is taken from #49891.
2018-04-20Properly handle ranges of signed enums using both extremums (fixes #49973)Anthony Ramine-5/+6
2018-04-20Use InternedString instead of Symbol for type parameters.Michael Woerister-11/+11
2018-04-17Don't abort const eval due to long running evals, just warnOliver Schneider-1/+0
2018-04-17Get rid of redundant `HashSet`Oliver Schneider-16/+15
2018-04-17Stop referring to statics' AllocIds directlyOliver Schneider-23/+16
2018-04-17Don't recurse into allocations, use a global table insteadOliver Schneider-60/+75
2018-03-29Auto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakisbors-66/+19
Remove universes from `ty::ParamEnv` This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now. r? @nikomatsakis
2018-03-26Allow niche-filling dataful variants to be represented as a ScalarPairAnthony Ramine-4/+15
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-25/+0
Stabilize the copy_closures and clone_closures features In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do. Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-24Auto merge of #48482 - davidtwco:issue-47184, r=nikomatsakisbors-0/+75
NLL should identify and respect the lifetime annotations that the user wrote Part of #47184. r? @nikomatsakis
2018-03-23Fix failures after rebaseSean Griffin-5/+4
2018-03-23Revert "introduce `UniverseIndex` into `ParamEnv`"Sean Griffin-45/+6
This reverts commit d4df52cacbee5d95e912a43188192a5054d36b4f.
2018-03-23Revert "change skolemizations to use universe index"Sean Griffin-16/+9
This reverts commit 35e78b5cddc04c6bd13da2a1290d27cfb8ae8db8.
2018-03-23Improved comments for UserAssertTy statement.David Wood-1/+2
2018-03-23Rollup merge of #49262 - oli-obk:fixed_size_array_len, r=estebankAlex Crichton-1/+0
Produce nice array lengths on a best effort basis fixes #49208 r? @estebank
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-16/+19
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-23Rollup merge of #48883 - alexcrichton:wasm-custom-sections, r=nikomatsakisAlex Crichton-1/+40
rustc: Add a `#[wasm_custom_section]` attribute This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-23Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAusAlex Crichton-3/+3
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
2018-03-23Fixed issues with incremental tests.David Wood-0/+23
2018-03-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-25/+0
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-22UserAssertTy can handle inference variables.David Wood-0/+51
This commit modifies the UserAssertTy statement to take a canonicalized type rather than a regular type so that we can handle the case where the user provided type contains a inference variable.
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-1/+31
This commit adds a new attribute to the Rust compiler specific to the wasm target (and no other targets). The `#[wasm_import_module]` attribute is used to specify the module that a name is imported from, and is used like so: #[wasm_import_module = "./foo.js"] extern { fn some_js_function(); } Here the import of the symbol `some_js_function` is tagged with the `./foo.js` module in the wasm output file. Wasm-the-format includes two fields on all imports, a module and a field. The field is the symbol name (`some_js_function` above) and the module has historically unconditionally been `"env"`. I'm not sure if this `"env"` convention has asm.js or LLVM roots, but regardless we'd like the ability to configure it! The proposed ES module integration with wasm (aka a wasm module is "just another ES module") requires that the import module of wasm imports is interpreted as an ES module import, meaning that you'll need to encode paths, NPM packages, etc. As a result, we'll need this to be something other than `"env"`! Unfortunately neither our version of LLVM nor LLD supports custom import modules (aka anything not `"env"`). My hope is that by the time LLVM 7 is released both will have support, but in the meantime this commit adds some primitive encoding/decoding of wasm files to the compiler. This way rustc postprocesses the wasm module that LLVM emits to ensure it's got all the imports we'd like to have in it. Eventually I'd ideally like to unconditionally require this attribute to be placed on all `extern { ... }` blocks. For now though it seemed prudent to add it as an unstable attribute, so for now it's not required (as that'd force usage of a feature gate). Hopefully it doesn't take too long to "stabilize" this! cc rust-lang-nursery/rust-wasm#29
2018-03-22rustc: Add a `#[wasm_custom_section]` attributeAlex Crichton-0/+9
This commit is an implementation of adding custom sections to wasm artifacts in rustc. The intention here is to expose the ability of the wasm binary format to contain custom sections with arbitrary user-defined data. Currently neither our version of LLVM nor LLD supports this so the implementation is currently custom to rustc itself. The implementation here is to attach a `#[wasm_custom_section = "foo"]` attribute to any `const` which has a type like `[u8; N]`. Other types of constants aren't supported yet but may be added one day! This should hopefully be enough to get off the ground with *some* custom section support. The current semantics are that any constant tagged with `#[wasm_custom_section]` section will be *appended* to the corresponding section in the final output wasm artifact (and this affects dependencies linked in as well, not just the final crate). This means that whatever is interpreting the contents must be able to interpret binary-concatenated sections (or each constant needs to be in its own custom section). To test this change the existing `run-make` test suite was moved to a `run-make-fulldeps` folder and a new `run-make` test suite was added which applies to all targets by default. This test suite currently only has one test which only runs for the wasm target (using a node.js script to use `WebAssembly` in JS to parse the wasm output).
2018-03-22Auto merge of #49210 - oli-obk:pango_crash, r=eddybbors-38/+39
Fix the conversion between bit representations and i128 representations fixes #49181 the `Discr` type now encodes the bit representation instead of `i128` or `u128` casted to `u128`. r? @eddyb
2018-03-22Rollup merge of #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-0/+7
Querify WF-checking so it can be cached r? @michaelwoerister
2018-03-22Fix the conversion between bit representations and i128 representationsOliver Schneider-38/+39
2018-03-22Auto merge of #49041 - nikomatsakis:issue-46541-impl-trait-hidden-lifetimes, ↵bors-11/+21
r=cramertj Detect illegal hidden lifetimes in `impl Trait` This branch fixes #46541 -- however, it presently doesn't build because it also *breaks* a number of existing usages of impl Trait. I'm opening it as a WIP for now, just because we want to move on impl Trait, but I'll try to fix the problem in a bit. ~~(The problem is due to the fact that we apparently infer stricter lifetimes in closures that we need to; for example, if you capture a variable of type `&'a &'b u32`, we will put *precisely* those lifetimes into the closure, even if the closure would be happy with `&'a &'a u32`. This causes the present chance to affect things that are not invariant.)~~ fixed r? @cramertj
2018-03-21work around fallout from these changes in rustcNiko Matsakis-11/+21
2018-03-21Auto merge of #49200 - oli-obk:extern_static_metadata, r=michaelwoeristerbors-1/+1
Encode/decode extern statics in metadata and incremental cache fixes #49153 cc @abonander r? @michaelwoerister incremental ICE
2018-03-20Remove outdated commentOliver Schneider-1/+0
2018-03-20Encode/decode extern statics in metadata and incremental cacheOliver Schneider-1/+1
2018-03-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-1/+2
Replace many of the last references to readmes In particular, this removes the dep track readme, so it should not be merged before https://github.com/rust-lang-nursery/rustc-guide/pull/92 Fix #47935 cc #48478 r? @nikomatsakis
2018-03-20Rollup merge of #49004 - wesleywiser:incr_specialization_graph_query, ↵kennytm-1/+4
r=michaelwoerister Cache the specialization_graph query Fixes #48987 r? @michaelwoerister
2018-03-19Auto merge of #49079 - oli-obk:cross_miri, r=michaelwoeristerbors-63/+63
Cleanup metadata and incremental cache processing of constants fixes #49033 fixes #49081 we really need tests for this. do we have any cross compilation tests? I couldn't find any
2018-03-18Auto merge of #48985 - scalexm:lowering, r=nikomatsakisbors-3/+17
MVP for chalkification r? @nikomatsakis
2018-03-17Use num::NonZero* instead of NonZero<_> in rustc and testsSimon Sapin-3/+3
2018-03-17Make interners thread-safeJohn Kåre Alsaker-6/+9
2018-03-17Minor cleanupJohn Kåre Alsaker-6/+5
2018-03-17Replace Rc with LrcJohn Kåre Alsaker-1/+2
2018-03-17Don't get the global lock in the fast caseJohn Kåre Alsaker-3/+3
2018-03-16Replace many of the last references to readmesMark Mansi-1/+2
2018-03-16Cleanup metadata and incremental cache processing of constantsOliver Schneider-63/+63
2018-03-15Queryify check_impl_item_well_formedWesley Wiser-0/+2
Fixes #46753
2018-03-15Queryify check_trait_item_well_formedWesley Wiser-0/+2
Fixes #46753
2018-03-15Queryify check_item_well_formedWesley Wiser-0/+3
Fixes #46753