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 10 pull requests #61027

Merged
merged 27 commits into from
May 22, 2019
Merged

Rollup of 10 pull requests #61027

merged 27 commits into from
May 22, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented May 22, 2019

Successful merges:

Failed merges:

r? @ghost

hellow554 and others added 27 commits May 6, 2019 14:54
This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.
`Symbol` received the same treatment in rust-lang#60630.

Also, we can derive `PartialEq` for `InternedString`.
Move `edition` outside the hygiene lock and avoid accessing it

r? @petrochenkov
Update boxed::Box docs on memory layout

The existing docs for the `Box` type state that "the way `Box` allocates and releases memory is unspecified", and that therefore the only valid pointer to pass to `Box::from_raw` is one obtained from `Box::into_raw`. This is inconsistent with the module-level docs which specify,

> It is valid to convert both ways between a Box and a raw pointer allocated with the Global allocator, given that the Layout used with the allocator is correct for the type. More precisely, a value: *mut T that has been allocated with the Global allocator with Layout::for_value(&*value) may be converted into a box using Box::<T>::from_raw(value). Conversely, the memory backing a value: *mut T obtained from Box::<T>::into_raw may be deallocated using the Global allocator with Layout::for_value(&*value).

This pull request updates the docs for `Box` to make them consistent with the module-level docs and adds some examples of how to use the global allocator in conjunction with `Box::from_raw` and `Box::into_raw`.
… r=michaelwoerister

Avoid symbol interning in `file_metadata`.

This commit changes `created_files` so it uses strings directly as keys,
rather than symbols derived from the strings. This avoids the cost of
having to do the hash table lookups to produce the symbols from the
strings.

The commit also uses `entry` to avoid doing a repeated hash table lookup
(`get` + `insert`).

Note that PR rust-lang#60467 improved this code somewhat; this is a further
improvement.

r? @davidtwco
Do not fail on child without DefId

Addresses rust-lang#60976, leaving open to come up with a repro case.
…base-dir, r=michaelwoerister

Add stream_to_parser_with_base_dir

This PR adds `stream_to_parser_with_base_dir`, which creates a parser from a token stream and a base directory.

Context: I would like to parse `cfg_if!` macro and get a list of modules defined inside it from rustfmt so that rustfmt can format those modules (cc rust-lang/rustfmt#3253). To do so, I need to create a parser from `TokenStream` and set the directory of `Parser` to the same directory as the parent directory of a file which contains `cfg_if!` invocation. AFAIK there is no way to achieve this, and hence this PR.

Alternatively, I could change the visibility of `Parser.directory` from `crate` to `pub` so that the value can be modified after initializing a parser. I don't have a preference over either approach (or others, as long as it works).
static_assert: make use of anonymous constants
…alEq-impls, r=petrochenkov

Remove impls for `InternedString`/string equality.

`Symbol` received the same treatment in rust-lang#60630.

Also, we can derive `PartialEq` for `InternedString`.

r? @petrochenkov
adjust deprecation date of mem::uninitialized

In rust-lang#60445 we [decided](rust-lang#60445 (comment)) that we'd deprecate for 1.38 instead of 1.40, but I forgot to adjust for that.
@Centril
Copy link
Contributor Author

Centril commented May 22, 2019

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented May 22, 2019

📌 Commit 2551a54 has been approved by Centril

@bors
Copy link
Contributor

bors commented May 22, 2019

🌲 The tree is currently closed for pull requests below priority 500, this pull request will be tested once the tree is reopened

@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 22, 2019
@Centril
Copy link
Contributor Author

Centril commented May 22, 2019

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 22, 2019
@Centril Centril closed this May 22, 2019
@Centril Centril reopened this May 22, 2019
@Centril
Copy link
Contributor Author

Centril commented May 22, 2019

@bors r+ p=10 rollup=never

@bors
Copy link
Contributor

bors commented May 22, 2019

📌 Commit 2551a54 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels May 22, 2019
@bors
Copy link
Contributor

bors commented May 22, 2019

⌛ Testing commit 2551a54 with merge dbfe70d...

bors added a commit that referenced this pull request May 22, 2019
Rollup of 10 pull requests

Successful merges:

 - #59742 (Move `edition` outside the hygiene lock and avoid accessing it)
 - #60581 (convert custom try macro to `?`)
 - #60963 (Update boxed::Box docs on memory layout)
 - #60973 (Avoid symbol interning in `file_metadata`.)
 - #60982 (Do not fail on child without DefId)
 - #60991 (LocalDecl push returns Local len)
 - #60995 (Add stream_to_parser_with_base_dir)
 - #60998 (static_assert: make use of anonymous constants)
 - #61003 (Remove impls for `InternedString`/string equality.)
 - #61006 (adjust deprecation date of mem::uninitialized)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented May 22, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing dbfe70d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 22, 2019
@bors bors merged commit 2551a54 into rust-lang:master May 22, 2019
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #61027!

Tested on commit dbfe70d.
Direct link to PR: #61027

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request May 22, 2019
Tested on commit rust-lang/rust@dbfe70d.
Direct link to PR: <rust-lang/rust#61027>

💔 clippy-driver on windows: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 clippy-driver on linux: test-pass → build-fail (cc @Manishearth @llogiq @mcarton @oli-obk @phansch, @rust-lang/infra).
💔 rls on windows: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
💔 rls on linux: test-pass → build-fail (cc @Xanewok, @rust-lang/infra).
@Centril Centril deleted the rollup-oewauf1 branch May 22, 2019 04:44
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.