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

Fixed issue with using `Self` ctor in typedefs #56850

Merged
merged 4 commits into from Dec 16, 2018

Conversation

Projects
None yet
6 participants
@alexreg
Copy link
Contributor

alexreg commented Dec 15, 2018

Added two regression tests.

This is definitely suitable for a beta backport.

CC @Centril


Includes regression tests labelled with issues #56199, #56835, #56611

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 15, 2018

c39a642 is missing

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 15, 2018

r=me with error message wording updated (#56850 (comment))

@alexreg

This comment has been minimized.

Copy link
Contributor

alexreg commented Dec 15, 2018

@alexreg alexreg force-pushed the alexreg:fix-self-in-typedefs branch from 215ad91 to d04986a Dec 15, 2018

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 15, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:00856986:start=1544887679055168668,finish=1544887680103388685,duration=1048220017
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:10:42] 
[00:10:42] error[E0433]: failed to resolve: use of undeclared type or module `AdtKind`
[00:10:42]     --> src/librustc_typeck/check/mod.rs:5179:33
[00:10:42]      |
[00:10:42] 5179 |                                 AdtKind::Union => {
[00:10:42]      |                                 ^^^^^^^ use of undeclared type or module `AdtKind`
[00:10:42] error[E0425]: cannot find value `tcx` in this scope
[00:10:42]     --> src/librustc_typeck/check/mod.rs:5168:39
[00:10:42]      |
[00:10:42]      |
[00:10:42] 5168 |                         (variant.did, tcx.type_of(variant.did))
[00:10:42] 
[00:10:42] error[E0425]: cannot find value `tcx` in this scope
[00:10:42]     --> src/librustc_typeck/check/mod.rs:5171:39
[00:10:42]      |
[00:10:42]      |
[00:10:42] 5171 |                         let mut err = tcx.sess.struct_span_err(span,
[00:10:42] 
[00:10:42] error[E0425]: cannot find value `tcx` in this scope
[00:10:42]     --> src/librustc_typeck/check/mod.rs:5189:39
[00:10:42]      |
[00:10:42]      |
[00:10:42] 5189 |                         (impl_def_id, tcx.types.err)
[00:10:42] 
[00:10:48] error: aborting due to 7 previous errors
[00:10:48] 
[00:10:48] Some errors occurred: E0425, E0433.
---
[00:13:15] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:13:15] expected success, got: exit code: 101
[00:13:15] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:13:15] Build completed unsuccessfully in 0:10:28
[00:13:15] Makefile:28: recipe for target 'all' failed
[00:13:15] make: *** [all] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0030aa07
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sat Dec 15 15:41:23 UTC 2018

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexreg alexreg force-pushed the alexreg:fix-self-in-typedefs branch 2 times, most recently from d620d88 to bf5c5e3 Dec 15, 2018

@alexreg

This comment has been minimized.

Copy link
Contributor

alexreg commented Dec 15, 2018

@petrochenkov AppVeyor is borked. Could you r+ this anyway please?

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 15, 2018

Error wording is updated, but tests are not.

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 15, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:0186fa5c:start=1544895218629916967,finish=1544895220797194802,duration=2167277835
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:11:30]    Compiling rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[00:11:32] error[E0603]: enum `AdtKind` is private
[00:11:32]   --> src/librustc_typeck/check/mod.rs:98:24
[00:11:32]    |
[00:11:32] 98 | use rustc::hir::{self, AdtKind, GenericArg, ItemKind, Node, PatKind};
[00:11:32] 
[00:11:38] error: aborting due to previous error
[00:11:38] 
[00:11:38] For more information about this error, try `rustc --explain E0603`.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexreg alexreg force-pushed the alexreg:fix-self-in-typedefs branch from 0333a33 to ec274ae Dec 15, 2018

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

rust-highfive commented Dec 15, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:2514e170:start=1544896992779342396,finish=1544896995059318226,duration=2279975830
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:11:07]     --> src/librustc_typeck/check/mod.rs:5160:28
[00:11:07]      |
[00:11:07] 5160 |           let (def_id, ty) = match def {
[00:11:07]      |  ____________________________^
[00:11:07] 5161 | |             Def::SelfCtor(impl_def_id) => {
[00:11:07] 5162 | |                 let ty = self.impl_self_ty(span, impl_def_id).ty;
[00:11:07] 5163 | |                 let adt_def = ty.ty_adt_def();
[00:11:07] 5201 | |             }
[00:11:07] 5202 | |         };
[00:11:07]      | |_________^ expected (), found tuple
[00:11:07]      |
[00:11:07]      |
[00:11:07]      = note: expected type `()`
[00:11:07]                 found type `(rustc::hir::def_id::DefId, &rustc::ty::TyS<'_>)`
[00:11:07] note: match arm with an incompatible type
[00:11:07]     --> src/librustc_typeck/check/mod.rs:5194:18
[00:11:07] 5194 |               _ => {
[00:11:07]      |  __________________^
[00:11:07] 5195 | |                 let def_id = def.def_id();
[00:11:07] 5196 | |
[00:11:07] 5196 | |
[00:11:07] 5197 | |                 // The things we are substituting into the type should not contain
[00:11:07] 5200 | |                 (def_id, ty)
[00:11:07] 5201 | |             }
[00:11:07]      | |_____________^
[00:11:07] 

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@alexreg alexreg force-pushed the alexreg:fix-self-in-typedefs branch from ec274ae to e5e63b5 Dec 15, 2018

@alexreg alexreg force-pushed the alexreg:fix-self-in-typedefs branch from e5e63b5 to 0211856 Dec 15, 2018

@rust-lang rust-lang deleted a comment from rust-highfive Dec 15, 2018

@alexreg

This comment has been minimized.

Copy link
Contributor

alexreg commented Dec 15, 2018

@petrochenkov LGTM! :-)

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 16, 2018

@bors r+
@bors delegate+

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 16, 2018

✌️ @alexreg can now approve this pull request

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 16, 2018

📌 Commit 0211856 has been approved by petrochenkov

@petrochenkov

This comment has been minimized.

Copy link
Contributor

petrochenkov commented Dec 16, 2018

@alexreg
Could you squash commits into one if you have time?

Centril added a commit to Centril/rust that referenced this pull request Dec 16, 2018

Rollup merge of rust-lang#56850 - alexreg:fix-self-in-typedefs, r=pet…
…rochenkov

Fixed issue with using `Self` ctor in typedefs

Added two regression tests.

This is definitely suitable for a beta backport.

CC @Centril

bors added a commit that referenced this pull request Dec 16, 2018

Auto merge of #56873 - Centril:rollup, r=Centril
Rollup of 22 pull requests

Successful merges:

 - #53506 (Documentation for impl From for AtomicBool and other Atomic types)
 - #56343 (Remove not used mod)
 - #56439 (Clearer error message for dead assign)
 - #56640 (Add FreeBSD unsigned char platforms to std::os::raw)
 - #56647 (Rework treatment of `$crate` in procedural macros)
 - #56648 (Fix BTreeMap UB)
 - #56672 (Document time of back operations of a Linked List)
 - #56706 (Make `const unsafe fn` bodies `unsafe`)
 - #56737 (`TokenStream` improvements)
 - #56742 (infer: remove Box from a returned Iterator)
 - #56761 (Suggest using `.display()` when trying to print a `Path`)
 - #56781 (Update LLVM submodule)
 - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic)
 - #56790 (Make RValue::Discriminant a normal Shallow read)
 - #56793 (rustdoc: look for comments when scraping attributes/crates from doctests)
 - #56826 (rustc: Add the `cmpxchg16b` target feature on x86/x86_64)
 - #56832 (std: Use `rustc_demangle` from crates.io)
 - #56844 (Improve CSS rule)
 - #56850 (Fixed issue with using `Self` ctor in typedefs)
 - #56855 (Remove u8 cttz hack)
 - #56857 (Fix a small mistake regarding NaNs in a deprecation message)
 - #56858 (Fix doc of `std::fs::canonicalize`)

Failed merges:

r? @ghost

Centril added a commit to Centril/rust that referenced this pull request Dec 16, 2018

Rollup merge of rust-lang#56850 - alexreg:fix-self-in-typedefs, r=pet…
…rochenkov

Fixed issue with using `Self` ctor in typedefs

Added two regression tests.

This is definitely suitable for a beta backport.

CC @Centril

bors added a commit that referenced this pull request Dec 16, 2018

Auto merge of #56875 - Centril:rollup, r=Centril
Rollup of 20 pull requests

Successful merges:

 - #53506 (Documentation for impl From for AtomicBool and other Atomic types)
 - #56343 (Remove not used mod)
 - #56439 (Clearer error message for dead assign)
 - #56640 (Add FreeBSD unsigned char platforms to std::os::raw)
 - #56648 (Fix BTreeMap UB)
 - #56672 (Document time of back operations of a Linked List)
 - #56706 (Make `const unsafe fn` bodies `unsafe`)
 - #56742 (infer: remove Box from a returned Iterator)
 - #56761 (Suggest using `.display()` when trying to print a `Path`)
 - #56781 (Update LLVM submodule)
 - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic)
 - #56790 (Make RValue::Discriminant a normal Shallow read)
 - #56793 (rustdoc: look for comments when scraping attributes/crates from doctests)
 - #56826 (rustc: Add the `cmpxchg16b` target feature on x86/x86_64)
 - #56832 (std: Use `rustc_demangle` from crates.io)
 - #56844 (Improve CSS rule)
 - #56850 (Fixed issue with using `Self` ctor in typedefs)
 - #56855 (Remove u8 cttz hack)
 - #56857 (Fix a small mistake regarding NaNs in a deprecation message)
 - #56858 (Fix doc of `std::fs::canonicalize`)

Failed merges:

 - #56741 (treat ref-to-raw cast like a reborrow: do a special kind of retag)

r? @ghost

bors added a commit that referenced this pull request Dec 16, 2018

Auto merge of #56875 - Centril:rollup, r=Centril
Rollup of 20 pull requests

Successful merges:

 - #53506 (Documentation for impl From for AtomicBool and other Atomic types)
 - #56343 (Remove not used mod)
 - #56439 (Clearer error message for dead assign)
 - #56640 (Add FreeBSD unsigned char platforms to std::os::raw)
 - #56648 (Fix BTreeMap UB)
 - #56672 (Document time of back operations of a Linked List)
 - #56706 (Make `const unsafe fn` bodies `unsafe`)
 - #56742 (infer: remove Box from a returned Iterator)
 - #56761 (Suggest using `.display()` when trying to print a `Path`)
 - #56781 (Update LLVM submodule)
 - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic)
 - #56790 (Make RValue::Discriminant a normal Shallow read)
 - #56793 (rustdoc: look for comments when scraping attributes/crates from doctests)
 - #56826 (rustc: Add the `cmpxchg16b` target feature on x86/x86_64)
 - #56832 (std: Use `rustc_demangle` from crates.io)
 - #56844 (Improve CSS rule)
 - #56850 (Fixed issue with using `Self` ctor in typedefs)
 - #56855 (Remove u8 cttz hack)
 - #56857 (Fix a small mistake regarding NaNs in a deprecation message)
 - #56858 (Fix doc of `std::fs::canonicalize`)

Failed merges:

 - #56741 (treat ref-to-raw cast like a reborrow: do a special kind of retag)

r? @ghost

@bors bors merged commit 0211856 into rust-lang:master Dec 16, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@pnkfelix pnkfelix added the T-compiler label Dec 20, 2018

@pnkfelix

This comment has been minimized.

Copy link
Member

pnkfelix commented Dec 20, 2018

discussed at T-compiler meeting. beta-accepted.

bors added a commit that referenced this pull request Dec 31, 2018

Auto merge of #57236 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

* #56919: Remove a wrong multiplier on relocation offset computation
* #56916: Fix mutable references in `static mut`
* #56863: fix trait objects with a Self-containing projection values
* #56850: Fixed issue with using `Self` ctor in typedefs

r? @ghost

bors added a commit that referenced this pull request Jan 1, 2019

Auto merge of #57236 - pietroalbini:beta-backports, r=pietroalbini
[beta] Rollup backports

* #56919: Remove a wrong multiplier on relocation offset computation
* #56916: Fix mutable references in `static mut`
* #56863: fix trait objects with a Self-containing projection values
* #56850: Fixed issue with using `Self` ctor in typedefs

r? @ghost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment