-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 10 pull requests #75606
Rollup of 10 pull requests #75606
Commits on Jul 10, 2020
-
Don't visit foreign function bodies when lowering ast to hir
Previously the existence of bodies inside a foreign function block would cause a panic in the hir `NodeCollector` during its collection of crate bodies to compute a crate hash: https://github.com/rust-lang/rust/blob/e59b08e62ea691916d2f063cac5aab4634128022/src/librustc_middle/hir/map/collector.rs#L154-L158 The collector walks the hir tree and creates a map of hir nodes, then attaching bodies in the crate to their owner in the map. For a code like ```rust extern "C" { fn f() { fn g() {} } } ``` The crate bodies include the body of the function `g`. But foreign functions cannot have bodies, and while the parser AST permits a foreign function to have a body, the hir doesn't. This means that the body of `f` is not present in the hir, and so neither is `g`. So when the `NodeCollector` finishes the walking the hir, it has no record of `g`, cannot find an owner for the body of `g` it sees in the crate bodies, and blows up. Why do the crate bodies include the body of `g`? The AST walker has a need a for walking function bodies, and FFIs share the same AST node as functions in other contexts. There are at least two options to fix this: - Don't unwrap the map entry for an hir node in the `NodeCollector` - Modifier the ast->hir lowering visitor to ignore foreign function blocks I don't think the first is preferrable, since we want to know when we can't find a body for an hir node that we thought had one (dropping this information may lead to an invalid hash). So this commit implements the second option. Closes rust-lang#74120
Configuration menu - View commit details
-
Copy full SHA for 2303939 - Browse repository at this point
Copy the full SHA 2303939View commit details -
Configuration menu - View commit details
-
Copy full SHA for ab4275c - Browse repository at this point
Copy the full SHA ab4275cView commit details
Commits on Jul 15, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 68aca3b - Browse repository at this point
Copy the full SHA 68aca3bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c64d32 - Browse repository at this point
Copy the full SHA 0c64d32View commit details
Commits on Jul 16, 2020
-
Configuration menu - View commit details
-
Copy full SHA for d442bf7 - Browse repository at this point
Copy the full SHA d442bf7View commit details
Commits on Aug 5, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 50ead68 - Browse repository at this point
Copy the full SHA 50ead68View commit details
Commits on Aug 6, 2020
-
Add #[track_caller] to
Session::delay_span_bug
This forwards the caller span to `Handler::delay_span_bug`
Configuration menu - View commit details
-
Copy full SHA for 0d0546a - Browse repository at this point
Copy the full SHA 0d0546aView commit details
Commits on Aug 11, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 3c2eb18 - Browse repository at this point
Copy the full SHA 3c2eb18View commit details -
Configuration menu - View commit details
-
Copy full SHA for c492341 - Browse repository at this point
Copy the full SHA c492341View commit details
Commits on Aug 12, 2020
-
Remove intra-doc link as it resolves without reference link
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
Configuration menu - View commit details
-
Copy full SHA for 4c5896f - Browse repository at this point
Copy the full SHA 4c5896fView commit details
Commits on Aug 15, 2020
-
Bump minor version of emsdk to 1.38.47
Release Notes: ``` v1.38.47: 10/02/2019 -------------------- - Add support for FETCH API in WASM backend. This doesn't support FETCH in the main thread (`USE_FETCH_WORKER=0` is enforced). rust-lang#9490 - Redefine errno values to be consistent with wasi. This will let us avoid needing to convert the values back and forth as we use more wasi APIs. This is an ABI change, which should not be noticeable from user code unless you use errno defines (like EAGAIN) *and* keep around binaries compiled with an older version that you link against. In that case, you should rebuild them. See rust-lang#9545. - Removed build option `-s ONLY_MY_CODE` as we now have much better solutions for that, like building to a wasm object file or using `STANDALONE_WASM` etc. (see https://github.com/emscripten-core/emscripten/wiki/WebAssembly-Standalone). - Emscripten now supports the config file (.emscripten) being placed in the emscripten directory rather that the current user's home directory. See rust-lang#9543 ```
Configuration menu - View commit details
-
Copy full SHA for 8de63eb - Browse repository at this point
Copy the full SHA 8de63ebView commit details
Commits on Aug 16, 2020
-
lang_items: add support for lang items on variants
This commit adds support for lang items (`#[lang = "..."]` attributes) on enum variants. Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 764dc3d - Browse repository at this point
Copy the full SHA 764dc3dView commit details -
tests: add test for rust-lang#61019's current behaviour
This commit adds a test for rust-lang#61019 where a extern crate is imported as `std` which results in name resolution to fail due to the uses of `std` types introduced from lowering. Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 734441c - Browse repository at this point
Copy the full SHA 734441cView commit details -
hir: introduce lang items for AST lowering
This commit adds new lang items which will be used in AST lowering once `QPath::LangItem` is introduced. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 7dee5f8 - Browse repository at this point
Copy the full SHA 7dee5f8View commit details -
hir: introduce
QPath::LangItem
This commit introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols. This might be better for performance, but is also much cleaner as the previous approach is fragile. In addition, it resolves a bug (rust-lang#61019) where an extern crate imported as "std" would result in the paths created during AST lowering being resolved incorrectly (or not at all). Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 762137e - Browse repository at this point
Copy the full SHA 762137eView commit details -
save_analysis: support
QPath::LangItem
This commit implements support for `QPath::LangItem` and `GenericBound::LangItemTrait` in save analysis. Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 1e2f350 - Browse repository at this point
Copy the full SHA 1e2f350View commit details -
hir: simplify
is_range_literal
This commit simplifies `is_range_literal` by checking for `QPath::LangItem` containing range-related lang items, rather than using a heuristic. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 664ecf1 - Browse repository at this point
Copy the full SHA 664ecf1View commit details -
resolve: support
GenericBound::LangItemTrait
This commit modifies name resolution to ensure that new scopes are introduced from lang-item generic bounds. Co-authored-by: Matthew Jasper <mjjasper1@gmail.com> Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for 8367af4 - Browse repository at this point
Copy the full SHA 8367af4View commit details -
rustdoc: clean
QPath::LangItem
This commit adds support for cleaning `QPath::LangItem` and `hir::GenericBound::LangItemTrait` in rustdoc. `QPath::LangItem` does not require lowering, and `hir::GenericBound::LangItemTrait` is lowered to a `GenericBound::TraitBound`. Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for dde93c9 - Browse repository at this point
Copy the full SHA dde93c9View commit details -
clippy: support
QPath::LangItem
This commit updates clippy with the introduction of `QPath::LangItem` so that it still compiles. Signed-off-by: David Wood <david@davidtw.co>
Configuration menu - View commit details
-
Copy full SHA for bde529f - Browse repository at this point
Copy the full SHA bde529fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0a96e08 - Browse repository at this point
Copy the full SHA 0a96e08View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8b86b28 - Browse repository at this point
Copy the full SHA 8b86b28View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5d44d54 - Browse repository at this point
Copy the full SHA 5d44d54View commit details -
Configuration menu - View commit details
-
Copy full SHA for e1cd185 - Browse repository at this point
Copy the full SHA e1cd185View commit details -
Rollup merge of rust-lang#74204 - ayazhafiz:i/74120, r=eddyb
Don't visit foreign function bodies when lowering ast to hir Previously the existence of bodies inside a foreign function block would cause a panic in the hir `NodeCollector` during its collection of crate bodies to compute a crate hash: https://github.com/rust-lang/rust/blob/e59b08e62ea691916d2f063cac5aab4634128022/src/librustc_middle/hir/map/collector.rs#L154-L158 The collector walks the hir tree and creates a map of hir nodes, then attaching bodies in the crate to their owner in the map. For a code like ```rust extern "C" { fn f() { fn g() {} } } ``` The crate bodies include the body of the function `g`. But foreign functions cannot have bodies, and while the parser AST permits a foreign function to have a body, the hir doesn't. This means that the body of `f` is not present in the hir, and so neither is `g`. So when the `NodeCollector` finishes the walking the hir, it has no record of `g`, cannot find an owner for the body of `g` it sees in the crate bodies, and blows up. Why do the crate bodies include the body of `g`? The AST walker has a need a for walking function bodies, and FFIs share the same AST node as functions in other contexts. There are at least two options to fix this: - Don't unwrap the map entry for an hir node in the `NodeCollector` - Modifier the ast->hir lowering visitor to ignore foreign function blocks I don't think the first is preferrable, since we want to know when we can't find a body for an hir node that we thought had one (dropping this information may lead to an invalid hash). So this commit implements the second option. Closes rust-lang#74120
Configuration menu - View commit details
-
Copy full SHA for 67f02ea - Browse repository at this point
Copy the full SHA 67f02eaView commit details -
Rollup merge of rust-lang#74314 - eddyb:closure-substs-direct, r=niko…
…matsakis rustc_typeck: construct {Closure,Generator}Substs more directly. We've previously not had a way to create `{Closure,Generator}Substs` other than instantiating all generics as inference variables and unifying the inference types (extracted using the regular `{Closure,Generator}Substs` accessors), with the actual types. With this PR, those hacks, and assumptions about the order of closure/generator-specific components, are replaced with a simple API where the base `Substs` are combined with the additional information into a `{Closure,Generator}Substs`. This might also be faster than relying inference, although probably not by much. r? @nikomatsakis cc rust-lang#53488 @blitzerr
Configuration menu - View commit details
-
Copy full SHA for 772038d - Browse repository at this point
Copy the full SHA 772038dView commit details -
Rollup merge of rust-lang#74346 - eddyb:reachable-defs, r=nikomatsakis
Use LocalDefId instead of HirId for reachable_set elements. The only `HirId`s being tracked there that don't have matching `DefId`s are local variables, and that's an accident from rust-lang#44316 (where I preserved the old behavior, even if nothing relied on reachability tracking local variables).
Configuration menu - View commit details
-
Copy full SHA for c531545 - Browse repository at this point
Copy the full SHA c531545View commit details -
Rollup merge of rust-lang#74399 - mark-i-m:ty-err-4, r=eddyb
Move DelaySpanBugEmitted to ty::context This makes it even hard to abuse. r? @eddyb cc @LeSeulArtichaut as this will probably conflict with your PR :/
Configuration menu - View commit details
-
Copy full SHA for c8a5acd - Browse repository at this point
Copy the full SHA c8a5acdView commit details -
Rollup merge of rust-lang#75145 - davidtwco:issue-60607-preallocate-d…
…efid-for-lang-items, r=petrochenkov Preallocate `DefId`s for lang items Fixes rust-lang#60607 and fixes rust-lang#61019. This PR introduces `QPath::LangItem` to the HIR and uses it in AST lowering instead of constructing a `hir::Path` from a slice of symbols: - Credit for much of this work goes to @matthewjasper, I basically just [rebased their earlier work](matthewjasper@a227c70#diff-c0f791ead38d2d02916faaad0f56f41d). - Changes to Clippy might not be correct, they compile but attempting to run tests through `./x.py` produced failures which appeared spurious, so I didn't run any clippy tests. - Changes to save analysis might not be correct - tests pass but I don't have a lot of confidence in those changes being correct. - I've used `GenericBounds::LangItemTrait` rather than changing `PolyTraitRef`, as suggested by @matthewjasper [in this comment](matthewjasper@a227c70#r40107992) but I'd prefer that be left for a follow-up. - I've split things into smaller commits fairly arbitrarily to make the diff easier to review, each commit should compile but might not pass tests until the final commit. r? @oli-obk cc @matthewjasper
Configuration menu - View commit details
-
Copy full SHA for 3e5ce7b - Browse repository at this point
Copy the full SHA 3e5ce7bView commit details -
Rollup merge of rust-lang#75177 - JohnTitor:broken-mir-test, r=eddyb
Add regression test for issue-66768 Fixes rust-lang#66768 This is fixed by rust-lang#70452 (in particular, https://github.com/rust-lang/rust/pull/70452/files#diff-53aef089a36a8e2ed07627fc8915fe63R1763) and I'm not sure it's worth to add this test (i.e. the tests in rust-lang#70452 are enough), so r? @eddyb to confirm it.
Configuration menu - View commit details
-
Copy full SHA for f33f111 - Browse repository at this point
Copy the full SHA f33f111View commit details -
Rollup merge of rust-lang#75223 - Aaron1011:feature/session-track-cal…
…ler, r=eddyb Add #[track_caller] to `Session::delay_span_bug` This forwards the caller span to `Handler::delay_span_bug`
Configuration menu - View commit details
-
Copy full SHA for 60fc66b - Browse repository at this point
Copy the full SHA 60fc66bView commit details -
Rollup merge of rust-lang#75423 - denisvasilik:intra-doc-links-core-h…
…int, r=dtolnay Move to intra-doc links for /library/core/src/hint.rs Helps with rust-lang#75080. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc
Configuration menu - View commit details
-
Copy full SHA for 58a0860 - Browse repository at this point
Copy the full SHA 58a0860View commit details -
Rollup merge of rust-lang#75569 - tmiasko:emscripten, r=tlively
Bump minor version of emsdk to 1.38.47 Release Notes: ``` v1.38.47: 10/02/2019 -------------------- - Add support for FETCH API in WASM backend. This doesn't support FETCH in the main thread (`USE_FETCH_WORKER=0` is enforced). rust-lang#9490 - Redefine errno values to be consistent with wasi. This will let us avoid needing to convert the values back and forth as we use more wasi APIs. This is an ABI change, which should not be noticeable from user code unless you use errno defines (like EAGAIN) *and* keep around binaries compiled with an older version that you link against. In that case, you should rebuild them. See rust-lang#9545. - Removed build option `-s ONLY_MY_CODE` as we now have much better solutions for that, like building to a wasm object file or using `STANDALONE_WASM` etc. (see https://github.com/emscripten-core/emscripten/wiki/WebAssembly-Standalone). - Emscripten now supports the config file (.emscripten) being placed in the emscripten directory rather that the current user's home directory. See rust-lang#9543 ``` Motivated by changes to errno values which are currently out of sync with those in libc crate which uses wasi values already. Helps with rust-lang#72808 and rust-lang#75532.
Configuration menu - View commit details
-
Copy full SHA for f350f9c - Browse repository at this point
Copy the full SHA f350f9cView commit details -
Rollup merge of rust-lang#75596 - nixphix:docs/windows-ext, r=jyn514
Switch to intra-doc links in /sys/windows/ext/{ffi,fs,process}.rs Partial fix for rust-lang#75080 @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc r? @jyn514
Configuration menu - View commit details
-
Copy full SHA for 76d61c7 - Browse repository at this point
Copy the full SHA 76d61c7View commit details