Skip to content

hygiene: Do not treat Self ctor as a local variable - #57560

Merged
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:selfinmac
Jan 13, 2019
Merged

hygiene: Do not treat Self ctor as a local variable#57560
bors merged 1 commit into
rust-lang:masterfrom
petrochenkov:selfinmac

Conversation

@petrochenkov

Copy link
Copy Markdown
Contributor

Fixes#57523

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 12, 2019
@Centril

Copy link
Copy Markdown
Contributor

r? @alexreg

@Centril

Copy link
Copy Markdown
Contributor

Apparently bors hasn't rebooted yet...

@bors delegate=alexreg

@bors

bors commented Jan 13, 2019

Copy link
Copy Markdown
Collaborator

✌️ @alexreg can now approve this pull request

@alexreg

Copy link
Copy Markdown
Contributor

This is a small delta and looks totally fine to me, so I'm going to go ahead and r+ it. Travis would fail before Bors gets around to it anyway...

@bors r+

@bors

bors commented Jan 13, 2019

Copy link
Copy Markdown
Collaborator

📌 Commit 805099c has been approved by alexreg

@borsbors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jan 13, 2019
@varkor

Copy link
Copy Markdown
Contributor

@petrochenkov: are these still necessary now?

(Def::SelfTy(..), _)if ns == ValueNS => {
err.span_label(span, fallback_label);
err.note("can't use `Self` as a constructor, you must use the \
implemented struct");
return(err, candidates);
}
(Def::TyAlias(_), _) | (Def::AssociatedTy(..), _)if ns == ValueNS => {
err.note("can't use a type alias as a constructor");
return(err, candidates);
}

@petrochenkov

Copy link
Copy Markdown
ContributorAuthor

@varkor
The type alias case is necessary.
The SelfTy case is necessary only in corner cases when we have Self in type namespace, but not in value namespace (i.e. probably not necessary in practice).

@CentrilCentril mentioned this pull request Jan 13, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 13, 2019
hygiene: Do not treat `Self` ctor as a local variable
Fixesrust-lang#57523
@CentrilCentril mentioned this pull request Jan 13, 2019
bors added a commit that referenced this pull request Jan 13, 2019
Rollup of 16 pull requests
Successful merges:
- #57351 (Don't actually create a full MIR stack frame when not needed)
- #57353 (Optimise floating point `is_finite` (2x) and `is_infinite` (1.6x).)
- #57412 (Improve the wording)
- #57436 (save-analysis: use a fallback when access levels couldn't be computed)
- #57453 (lldb_batchmode.py: try `import _thread` for Python 3)
- #57454 (Some cleanups for core::fmt)
- #57461 (Change `String` to `&'static str` in `ParseResult::Failure`.)
- #57473 (std: Render large exit codes as hex on Windows)
- #57474 (save-analysis: Get path def from parent in case there's no def for the path itself.)
- #57494 (Speed up item_bodies for large match statements involving regions)
- #57496 (re-do docs for core::cmp)
- #57508 (rustdoc: Allow inlining of reexported crates and crate items)
- #57547 (Use `ptr::eq` where applicable)
- #57557 (resolve: Mark extern crate items as used in more cases)
- #57560 (hygiene: Do not treat `Self` ctor as a local variable)
- #57564 (Update the const fn tracking issue to the new metabug)
Failed merges:
r? @ghost
@bors
bors merged commit 805099c into rust-lang:masterJan 13, 2019
@petrochenkov
petrochenkov deleted the selfinmac branch June 5, 2019 16:28
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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.

7 participants

@petrochenkov@Centril@bors@alexreg@varkor@cramertj@rust-highfive