Skip to content
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 9 pull requests #61198

Closed
wants to merge 21 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 25, 2019

Successful merges:

Failed merges:

r? @ghost

estebank and others added 21 commits May 24, 2019 18:23
We are going to uniform the terminology of all associated items.
Methods that may or may not have `self` are called "associated
functions". Because `AssociatedFn` is a bit long, we rename `Associated`
to `Assoc`.
This makes it easier to figure out when const propagation fails.
Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```
Move a bunch of error recovery methods to `diagnostics.rs` away from
`parser.rs`.
Tweak `self` arg not as first argument of a method diagnostic

Mention that `self` is only valid on "associated functions"
```
error: unexpected `self` argument in function
  --> $DIR/self-in-function-arg.rs:1:15
   |
LL | fn foo(x:i32, self: i32) -> i32 { self }
   |               ^^^^ not valid as function argument
   |
   = note: `self` is only valid as the first argument of an associated function
```

When it is a method, mention it must be first
```
error: unexpected `self` argument in function
  --> $DIR/trait-fn.rs:4:20
   |
LL |     fn c(foo: u32, self) {}
   |                    ^^^^ must be the first associated function argument
```

Move a bunch of error recovery methods to `diagnostics.rs` away from `parser.rs`.

Fix rust-lang#51547. CC rust-lang#60015.
Vec: avoid creating slices to the elements

Instead of `self.deref_mut().as_mut_ptr()` to get a raw pointer to the buffer, use `self.buf.ptr_mut()`. This (a) avoids creating a unique reference to all existing elements without any need, and (b) creates a pointer that can actually be used for the *entire* buffer, and not just for the part of it covered by `self.deref_mut()`.

I also got worried about `RawVec::ptr` returning a `*mut T` from an `&self`, so I added both a mutable and an immutable version.

Cc @gankro in particular for the `assume` changes -- I don't know why that is not in `Unique`, but I moved it up from `Vec::deref` to `RawVec::ptr` to avoid having to repeat it everywhere.

Fixes rust-lang#60847
MaybeUninit doctest: remove unnecessary type ascription
Auto-derive Encode and Decode implementations of DefPathTable

See rust-lang#60647 (comment)
…li-obk

Add additional trace statements to the const propagator

This makes it easier to figure out when const propagation fails.
@Centril
Copy link
Contributor Author

Centril commented May 25, 2019

@bors r+ p=9 rollup=never

@bors
Copy link
Contributor

bors commented May 25, 2019

📌 Commit c2877ca has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 25, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-6.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:0a878030:start=1558825991989590043,finish=1558826081954928493,duration=89965338450
$ 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
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
$ export AWS_ACCESS_KEY_ID=AKIA46X5W6CZEJZ6XT55
---
[00:07:31]    Compiling rustc_macros v0.1.0 (/checkout/src/librustc_macros)
[00:07:38]    Compiling syntax_pos v0.0.0 (/checkout/src/libsyntax_pos)
[00:07:42]    Compiling rustc_errors v0.0.0 (/checkout/src/librustc_errors)
[00:08:51]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:09:23] error[E0599]: no variant named `AssociatedConst` found for type `hir::def::DefKind` in the current scope
[00:09:23]    --> src/librustc/ty/print/pretty.rs:826:33
[00:09:23]     |
[00:09:23] 826 |                 | Some(DefKind::AssociatedConst) => p!(print_value_path(did, substs)),
[00:09:23]     |                                 |
[00:09:23]     |                                 variant not found in `hir::def::DefKind`
[00:09:23]     |                                 help: did you mean: `AssocConst`
[00:09:23]     | 
[00:09:23]     | 
[00:09:23]    ::: src/librustc/hir/def.rs:48:1
[00:09:23]     |
[00:09:23] 48  | pub enum DefKind {
[00:09:23]     | ---------------- variant `AssociatedConst` not found here
[00:09:27] error: aborting due to previous error
[00:09:27] 
[00:09:27] For more information about this error, try `rustc --explain E0599`.
[00:09:28] error: Could not compile `rustc`.
---
travis_time:end:033f75de:start=1558826660768890565,finish=1558826660774246810,duration=5356245
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:02f85b3a
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:056e79f7
travis_time:start:056e79f7
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0eb169c7
$ dmesg | grep -i kill

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)

@Centril Centril closed this May 26, 2019
@Centril Centril deleted the rollup-ps5thar branch May 26, 2019 00:12
@Centril Centril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants