summary refs log tree commit diff
path: root/src/librustc/dep_graph/dep_node.rs
AgeCommit message (Collapse)AuthorLines
2018-03-25Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakiskennytm-2/+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-23Stabilize the copy_closures and clone_closures featuresSimon Sapin-2/+0
In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-0/+3
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/+2
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-22Rollup merge of #48939 - wesleywiser:incr_query_wf_checking, r=michaelwoeristerkennytm-0/+3
Querify WF-checking so it can be cached r? @michaelwoerister
2018-03-15Queryify check_impl_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_trait_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-15Queryify check_item_well_formedWesley Wiser-0/+1
Fixes #46753
2018-03-14Add MVP for chalkificationscalexm-0/+2
2018-03-13transition various normalization functions to the new methodsNiko Matsakis-1/+0
In particular: - `fully_normalize_monormophic_ty` => `normalize_erasing_regions` - `normalize_associated_type_in_env` => `normalize_erasing_regions` - `fully_normalize_associated_types_in` => `normalize_erasing_regions` - `erase_late_bound_regions_and_normalize` => `normalize_erasing_late_bound_regions`
2018-03-13introduce `infcx.at(..).dropck_outlives(..)` operaton [VIC]Niko Matsakis-1/+3
Backed by a canonicalized query. This computes all the types/regions that need to be live when the destructor runs (i.e., that the dtor may access).
2018-03-13introduce `infcx.at(..).normalize(..)` operation [VIC]Niko Matsakis-2/+4
It is backed by the new `normalize_projection_ty` query, which uses canonicalization.
2018-03-13in `Foo(X)` dep-nodes, allow X to be a `ty` not a `tt`Niko Matsakis-21/+24
Before, the identifier `X` was also used when generating a pattern to match against the dep-node. So `Foo(DefId)` would generate a match pattern like: match foo { Foo(DefId) => ... } This does not scale to more general types like `&'tcx Ty<'tcx>`. Therefore, we now require *exactly one* argument (the macro was internally tupling anyway, and no actual nodes use more than one argument), and then we can generate a fixed pattern like: match foo { Foo(arg) => ... } Huzzah. (Also, hygiene is nice.)
2018-03-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-1/+1
2018-03-08Prepare for using miri in transAlexander Regueiro-4/+4
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-1/+0
2018-03-08Produce instead of pointersOliver Schneider-0/+1
2018-03-06Add target_features to TransFnAttrsWesley Wiser-1/+0
Part of #47320
2018-03-06Remove the contains_extern_indicator queryWesley Wiser-1/+0
Part of #47320
2018-03-06Remove export_name queryWesley Wiser-1/+0
Part of #47320
2018-03-06Add query for trans fn attributesWesley Wiser-0/+1
Part of #47320
2018-03-06Rename exported_symbol_ids query to something more explicit and document ↵Michael Woerister-2/+2
what it is doing.
2018-03-05Turn features() into a query.Michael Woerister-4/+6
2018-02-19Rename is_translated_fn query to is_translated_item and make it support statics.Michael Woerister-1/+1
2018-01-30rustc: Add an option to default hidden visibilityAlex Crichton-0/+3
This commit adds a new option to target specifictions to specify that symbols should be "hidden" visibility by default in LLVM. While there are no existing targets that take advantage of this the `wasm32-unknown-unknown` target will soon start to use this visibility. The LLD linker currently interprets `hidden` as "don't export this from the wasm module" which is what we want for 90% of our functions. While the LLD linker does have a "export this symbol" argument which is what we use for other linkers, it was also somewhat easier to do this change instead which'll involve less arguments flying around. Additionally there's no need for non-`hidden` visibility for most of our symbols! This change should not immediately impact the wasm targets as-is, but rather this is laying the foundations for soon integrating LLD as a linker for wasm code.
2018-01-19Add instance_def_size_estimate queryvarkor-0/+1
2018-01-14Auto merge of #47223 - alexcrichton:new-target-feature, r=eddybbors-0/+4
rustc: Tweak `#[target_feature]` syntax This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13rustc: Tweak `#[target_feature]` syntaxAlex Crichton-0/+4
This is an implementation of the `#[target_feature]` syntax-related changes of [RFC 2045][rfc]. Notably two changes have been implemented: * The new syntax is `#[target_feature(enable = "..")]` instead of `#[target_feature = "+.."]`. The `enable` key is necessary instead of the `+` to indicate that a feature is being enabled, and a sub-list is used for possible expansion in the future. Additionally within this syntax the feature names being enabled are now whitelisted against a known set of target feature names that we know about. * The `#[target_feature]` attribute can only be applied to unsafe functions. It was decided in the RFC that invoking an instruction possibly not defined for the current processor is undefined behavior, so to enable this feature for now it requires an `unsafe` intervention. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/2045-target-feature.md
2018-01-13Remove `impl Foo for ..` in favor of `auto trait Foo`leonardo.yvens-1/+0
No longer parse it. Remove AutoTrait variant from AST and HIR. Remove backwards compatibility lint. Remove coherence checks, they make no sense for the new syntax. Remove from rustdoc.
2017-12-27Make normalize_and_test_predicates into a queryBurntPizza-0/+2
2017-12-20incr.comp.: Replace Fingerprint::zero() with a constant.Michael Woerister-2/+2
2017-12-18incr.comp.: Mark DepKind node as input.Michael Woerister-1/+1
2017-12-11move `resolve_lifetimes` into a proper queryNiko Matsakis-3/+4
Now that we made `resolve_lifetimes` into a query, elision errors no longer abort compilation, which affects some tests. Also, remove `dep_graph_crosscontaminate_tables` -- there is no a path in the dep-graph, though red-green handles it. The same scenario is (correctly) tested by issue-42602.rs in any case.
2017-11-28incr.comp.: Add some missing DepNode [input] annotations.Michael Woerister-4/+4
2017-11-26improve error messagesAriel Ben-Yehuda-0/+1
2017-11-24QuerifyShotaro Yamada-0/+1
2017-11-18remove the `generator_sigs` map, query, and plumbingNiko Matsakis-1/+0
2017-11-18kill the `closure_kind` queryNiko Matsakis-1/+0
2017-11-15incr.comp.: Add missing [input] annotation for DepNode::MaybeUnusedExternCratesMichael Woerister-1/+1
2017-11-10Auto merge of #45785 - arielb1:unsafe-fixes, r=eddybbors-2/+2
fixes to MIR effectck r? @eddyb beta-nominating because regression (MIR effectck is new)
2017-11-08incr.comp.: Remove unused DepKind::WorkProduct.Michael Woerister-11/+0
2017-11-08incr.comp.: Remove outdated comment about TraitSelect dep-node.Michael Woerister-25/+0
2017-11-08incr.comp.: Make DefSpan an input dep-node so it is not affected by the ↵Michael Woerister-1/+7
existing Span/HIR hashing hack.
2017-11-07incr.comp.: Mark more input nodes as inputs.Michael Woerister-18/+18
2017-11-06collect unused unsafe codeAriel Ben-Yehuda-1/+1
FIXME: de-uglify
2017-11-06run unsafety checking before dead block collectionAriel Ben-Yehuda-1/+1
Fixes #45087.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-1/+1
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-10-27Auto merge of #45353 - wesleywiser:untracked_queries, r=michaelwoeristerbors-7/+25
[incremental] Add support for eval always queries Part of #45238
2017-10-26Switch several crate-wide queries to use eval_alwaysWesley Wiser-7/+7
Closes #45238
2017-10-26Allow declaring a DepNode as eval_alwaysWesley Wiser-0/+18
Part of #45238