summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2018-06-01change `PointerKind::Implicit` to a noteNiko Matsakis-49/+56
`PointerKind` is included in `LoanPath` and hence forms part of the equality check; this led to having two unequal paths that both represent `*x`, depending on whether the `*` was inserted automatically or explicitly. Bad mojo. The `note` field, in contrast, is intended more-or-less primarily for this purpose of adding extra data.
2018-04-20make mem-categorization use adjusted type for patternsNiko Matsakis-4/+33
Fixes #49631
2018-03-24Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertjbors-70/+95
support elision in impl headers You can now do things like: ``` impl MyTrait<'_> for &u32 { ... } ``` Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138). We do not support elision with deprecated forms: ``` impl MyTrait for std::cell::Ref<u32> { } // ERROR ``` Builds on the in-band lifetime stuff. r? @cramertj Fixes #15872
2018-03-24Changed `check_stability` to take an `Option<NodeId>` instead of `NodeId`.kennytm-23/+33
This clarifies the intent of whether to emit deprecated lint or not.
2018-03-24When picking a candidate, consider the unstable ones last.kennytm-20/+52
If there is potential ambiguity after stabilizing those candidates, a warning will be emitted.
2018-03-23Rollup merge of #49030 - Zoxc:misc, r=michaelwoeristerAlex Crichton-2/+2
Misc changes from my parallel rustc branch r? @michaelwoerister
2018-03-22permit `'_` and `&T` in impl headersNiko Matsakis-3/+5
Deprecated forms of elision are not supported.
2018-03-22distinguish the three cases where elision occursNiko Matsakis-67/+90
2018-03-22rustc: Add a `#[wasm_import_module]` attributeAlex Crichton-0/+6
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/+5
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-20Rollup merge of #49092 - mark-i-m:deptrack_readme, r=nikomatsakiskennytm-7/+7
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-17Replace Rc with LrcJohn Kåre Alsaker-2/+2
2018-03-17Rollup merge of #48960 - nikomatsakis:issue-48468-dyn-trait-elision, r=cramertjkennytm-4/+21
resolve `'_` in `dyn Trait` just like ordinary elision r? @cramertj Fixes #48468
2018-03-16Replace many of the last references to readmesMark Mansi-7/+7
2018-03-16Rollup merge of #48706 - ehuss:main-not-found-in-crate, r=estebankkennytm-4/+10
Add crate name to "main function not found" error message. Fixes #44798 and rust-lang/cargo#4948. I was wondering if it might be cleaner to update the ui tests to add a simple `fn main() {}` for the unrelated tests. Let me know if you would prefer that.
2018-03-14resolve `'_` in `dyn Trait` just like ordinary elisionNiko Matsakis-4/+21
cc #48468
2018-03-14Add backticks to `main` not found errors.Eric Huss-2/+2
2018-03-14Add suggestion where to add main function.Eric Huss-0/+3
2018-03-14Add crate name to "main function not found" error message.Eric Huss-4/+7
Fixes #44798 and rust-lang/cargo#4948.
2018-03-14remove defaulting to unitAndrew Cann-1/+1
Types will no longer default to `()`, instead always defaulting to `!`. This disables the associated warning and removes the flag from TyTuple
2018-03-08Unregress error spans in constant errorsOliver Schneider-1/+1
2018-03-08Const eval error refactoringOliver Schneider-0/+7
2018-03-08Add stack traces to miri errorsOliver Schneider-13/+21
2018-03-08Remove unused error variants and const eval typesOliver Schneider-40/+2
2018-03-08Stop emitting `miri failed` in error messagesOliver Schneider-1/+1
2018-03-08Nuke ConstInt and Const*sizeOliver Schneider-14/+0
2018-03-08Rename ConstVal::to_u128 to to_raw_bitsOliver Schneider-3/+3
2018-03-08Add InterpretInterner to StableHashingContext for AllocId serializationOliver Schneider-4/+4
2018-03-08Fully use miri in transOliver Schneider-2/+11
2018-03-08Nuke the entire ctfe from orbit, it's the only way to be sureOliver Schneider-37/+1
2018-03-08Produce instead of pointersOliver Schneider-9/+34
2018-03-08Add miri errors to the const eval error enumOliver Schneider-0/+8
2018-03-08Add a variant to ConstVal for storing miri resultsOliver Schneider-0/+3
2018-03-07Merge branch 'incr_attr_queries' of https://github.com/wesleywiser/rust into ↵Alex Crichton-8/+13
update-cargo
2018-03-07Merge branch 'metadata-send-sync' of https://github.com/Zoxc/rust into ↵Alex Crichton-4/+3
update-cargo
2018-03-06Remove the contains_extern_indicator queryWesley Wiser-1/+1
Part of #47320
2018-03-06Add `inline` to `TransFnAttrs`Wesley Wiser-7/+12
Part of #47320
2018-03-07Make metadata references Send + SyncJohn Kåre Alsaker-4/+3
2018-03-06Auto merge of #48768 - kennytm:rollup, r=kennytmbors-5/+1
Rollup of 14 pull requests - Successful merges: #48403, #48432, #48546, #48573, #48590, #48657, #48727, #48732, #48753, #48754, #48761, #48474, #48507, #47463 - Failed merges:
2018-03-06Rollup merge of #48754 - leodasvacas:while-let-all-the-things, r=rkruppekennytm-5/+1
while let all the things
2018-03-06Don't show crate metadata symbol as exported symbol to downstream crates.Michael Woerister-1/+7
2018-03-06Don't recompute SymbolExportLevel for upstream crates.Michael Woerister-2/+2
2018-03-06Compute symbol names more lazily.Michael Woerister-0/+53
2018-03-06Clean up handling of symbol export information.Michael Woerister-5/+2
2018-03-05while let all the thingsleonardo.yvens-5/+1
2018-03-05Turn features() into a query.Michael Woerister-8/+6
2018-03-02Run Rustfix on librustcManish Goregaokar-10/+10
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-31/+32
2018-02-23Rollup merge of #48072 - cramertj:impl-trait-lifetime-res, r=nikomatsakisManish Goregaokar-11/+71
Fix nested impl trait lifetimes Fixes #46464 cc https://github.com/rust-lang/rust/issues/34511 r? @nikomatsakis
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1