]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agopropagate "short form" into all Html prints
QuietMisdreavus [Fri, 18 May 2018 19:55:11 +0000 (14:55 -0500)]
propagate "short form" into all Html prints

6 years agoAuto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichton
bors [Thu, 17 May 2018 16:44:38 +0000 (16:44 +0000)]
Auto merge of #50629 - Mark-Simulacrum:stage-step, r=alexcrichton

Switch to bootstrapping from 1.27

It's possible the Float trait could be removed from core, but I couldn't tell whether it was intended to be removed or not. @SimonSapin may be able to comment more here; we can presumably also do that in a follow up PR as this one is already quite large.

6 years agoRemove MAKEFLAGS to prevent accidental inheritance
Mark Simulacrum [Wed, 16 May 2018 23:04:12 +0000 (17:04 -0600)]
Remove MAKEFLAGS to prevent accidental inheritance

6 years agoFix rustc binary metadata overwriting librustc metadata
Mark Simulacrum [Sat, 12 May 2018 03:30:02 +0000 (21:30 -0600)]
Fix rustc binary metadata overwriting librustc metadata

In #49289, rustc was changed to emit metadata for binaries, which made
it so that the librustc.rmeta file created when compiling librustc was
overwritten by the rustc-main compilation. This commit renames the
rustc-main binary to avoid this problem.

https://github.com/rust-lang/cargo/issues/5524 has also been filed to
see if Cargo can learn to warn on this situation instead of leaving it
for the user to debug.

6 years agoRename rustdoc to use underscores
Mark Simulacrum [Sat, 12 May 2018 02:51:05 +0000 (20:51 -0600)]
Rename rustdoc to use underscores

6 years agoSwitch to 1.26 bootstrap compiler
Mark Simulacrum [Thu, 10 May 2018 18:02:19 +0000 (12:02 -0600)]
Switch to 1.26 bootstrap compiler

6 years agoAuto merge of #50615 - irinagpopa:rename-trans, r=nikomatsakis
bors [Thu, 17 May 2018 14:10:11 +0000 (14:10 +0000)]
Auto merge of #50615 - irinagpopa:rename-trans, r=nikomatsakis

Rename trans to codegen everywhere.

Part of #45274.

6 years agoRename trans to codegen everywhere.
Irina Popa [Tue, 8 May 2018 13:10:16 +0000 (16:10 +0300)]
Rename trans to codegen everywhere.

6 years agoAuto merge of #50400 - ehuss:compiletest-revisions, r=alexcrichton
bors [Thu, 17 May 2018 08:29:11 +0000 (08:29 +0000)]
Auto merge of #50400 - ehuss:compiletest-revisions, r=alexcrichton

 compiletest: Run revisions as independent tests.

Fixes #47604.

- The output of each test is now in its own directory.
- "auxiliary" output is now under the respective test directory.
- `stage_id` removed from filenames, and instead placed in the stamp file as a hash.  This helps keep path lengths down for Windows.

In brief, the new layout looks like this:
```
<build_base>/<relative_dir>/<testname>.<revision>.<mode>/
    stamp
    <testname>.err
    <testname>.out
    a (binary)
    auxiliary/lib<auxname>.dylib
    auxiliary/<auxname>/<auxname>.err
    auxiliary/<auxname>/<auxname>.out
```
(revision and mode are optional)

6 years agoFix running multiple targets.
Eric Huss [Sun, 13 May 2018 05:18:55 +0000 (22:18 -0700)]
Fix running multiple targets.

The aux dir, which previously had the `stage_id` embedded in it, was picking up remnants from previous runs.

6 years agoFix update-references for tests within subdirectories.
Eric Huss [Fri, 4 May 2018 21:31:43 +0000 (14:31 -0700)]
Fix update-references for tests within subdirectories.

6 years agocompiletest: Run revisions as independent tests.
Eric Huss [Thu, 26 Apr 2018 22:27:31 +0000 (15:27 -0700)]
compiletest: Run revisions as independent tests.

- The output of each test is now in its own directory.
- "auxiliary" output is now under the respective test directory.
- `stage_id` removed from filenames, and instead placed in the stamp file as a hash.  This helps keep path lengths down for Windows.

In brief, the new layout looks like this:
```
<build_base>/<relative_dir>/<testname>.<revision>.<mode>/
    stamp
    <testname>.err
    <testname>.out
    a (binary)
    auxiliary/lib<auxname>.dylib
    auxiliary/<auxname>/<auxname>.err
    auxiliary/<auxname>/<auxname>.out
```
(revision and mode are optional)

6 years agocompiletest: rustfmt
Eric Huss [Thu, 26 Apr 2018 22:16:27 +0000 (15:16 -0700)]
compiletest: rustfmt

6 years agoAuto merge of #50665 - alexcrichton:fix-single-item-path-warnings, r=oli-obk
bors [Thu, 17 May 2018 05:00:14 +0000 (05:00 +0000)]
Auto merge of #50665 - alexcrichton:fix-single-item-path-warnings, r=oli-obk

rustc: Fix `crate` lint for single-item paths

This commit fixes recommending the `crate` prefix when migrating to 2018 for
paths that look like `use foo;` or `use {bar, baz}`

Closes #50660

6 years agoAuto merge of #50807 - kennytm:rollup, r=kennytm
bors [Thu, 17 May 2018 02:05:39 +0000 (02:05 +0000)]
Auto merge of #50807 - kennytm:rollup, r=kennytm

Rollup of 17 pull requests

Successful merges:

 - #50170 (Implement From for more types on Cow)
 - #50638 (Don't unconditionally set CLOEXEC twice on every fd we open on Linux)
 - #50656 (Fix `fn main() -> impl Trait` for non-`Termination` trait)
 - #50669 (rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`)
 - #50726 (read2: Use inner function instead of closure)
 - #50728 (Fix rustdoc panic with `impl Trait` in type parameters)
 - #50736 (env: remove unwrap in examples in favor of try op)
 - #50740 (Remove LazyBTreeMap.)
 - #50752 (Add missing error codes in libsyntax-ext asm)
 - #50779 (Make mutable_noalias and arg_align_attributes be tracked)
 - #50787 (Fix run-make wasm tests)
 - #50788 (Fix an ICE when casting a nonexistent const)
 - #50789 (Ensure libraries built in stage0 have unique metadata)
 - #50793 (tidy: Add a check for empty UI test files)
 - #50797 (fix a typo in signed-integer::from_str_radix())
 - #50808 (Stabilize num::NonZeroU*)
 - #50809 (GitHub: Stop treating Cargo.lock as a generated file.)

Failed merges:

6 years agoAuto merge of #50696 - ehuss:cargo-update, r=alexcrichton
bors [Wed, 16 May 2018 23:46:19 +0000 (23:46 +0000)]
Auto merge of #50696 - ehuss:cargo-update, r=alexcrichton

Update Cargo

Unblocking PRs:
- rust-lang/cargo#5535 - Ignore tab in libtest output. (unblocks #50387)
- rust-lang/cargo#5537 - Remove -Zno-trans test. (unblocks #50615)
- rust-lang/cargo#5540 - Fix tests when CARGO_TARGET_DIR is set. (unblocks self)

Regression fixes:
- rust-lang/cargo#5503 - cargo rustc broken for tests in project with bins
- rust-lang/cargo#5520 - shared proc-macro dependency built incorrectly

Changes:
- rust-lang/cargo#5527 - Point Source Replacement to the Overriding Dependencies section
- rust-lang/cargo#5533 - Detail how to run locally-built nightly cargo
- rust-lang/cargo#5522 - Add option to set user-agent
- rust-lang/cargo#5519 - NFC: fix a couple of typos, found by codespell.
- rust-lang/cargo#5513 - Fix `panic` for binaries built during tests.
- rust-lang/cargo#5512 - simplify build_requirements
- rust-lang/cargo#5301 - Add --build-plan for 'cargo build'
- rust-lang/cargo#5460 - Be more conservative about which files are linked to the output dir.
- rust-lang/cargo#5509 - Use the new stable
- rust-lang/cargo#5507 - Does not print seconds fraction with minutes
- rust-lang/cargo#5498 - Bump to 0.29.0
- rust-lang/cargo#5497 - Mention +nightly in ARCHITECTURE.md

The PR fixes #50640.

6 years agoRollup merge of #50809 - kennytm:show-cargo-lock-diff, r=alexcrichton
kennytm [Wed, 16 May 2018 21:24:42 +0000 (05:24 +0800)]
Rollup merge of #50809 - kennytm:show-cargo-lock-diff, r=alexcrichton

GitHub: Stop treating Cargo.lock as a generated file.

We do want to inspect the changes to Cargo.lock, hiding the diff by default would make it easier to miss important details like https://github.com/rust-lang/rust/pull/50629#discussion_r187556602 and https://github.com/rust-lang/rust/pull/50696#pullrequestreview-119648156

6 years agoRollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton
kennytm [Wed, 16 May 2018 21:22:07 +0000 (05:22 +0800)]
Rollup merge of #50170 - burtonageo:more_cow_from, r=alexcrichton

Implement From for more types on Cow

This is basically https://github.com/rust-lang/rust/pull/48191, except that it should be implemented in a way that doesn't break third party crates.

6 years agoRollup merge of #50808 - SimonSapin:nonzero, r=alexcrichton
kennytm [Wed, 16 May 2018 19:07:52 +0000 (03:07 +0800)]
Rollup merge of #50808 - SimonSapin:nonzero, r=alexcrichton

Stabilize num::NonZeroU*

Tracking issue: https://github.com/rust-lang/rust/issues/49137

6 years agoRollup merge of #50793 - jrlusby:master, r=petrochenkov
kennytm [Wed, 16 May 2018 19:07:35 +0000 (03:07 +0800)]
Rollup merge of #50793 - jrlusby:master, r=petrochenkov

tidy: Add a check for empty UI test files

Check for empty `.stderr` and `.stdout` files in UI test directories.
Empty files could  still pass testing for `compile-pass` tests with no output
so they can get into the repo accidentally, but they are not necessary and can
be removed.

This is very much an in progress pull request. I'm having an issue with rustfmt. It wanted to reformat the entire file for almost every file by default. And when I run tidy it just errors out because it catches the empty files that are already in the repo.

My next step is goin got be to remove those empty file and see if running tidy again will actually reformat things outside of the context of `cargo fmt`

Fixes https://github.com/rust-lang/rust/issues/50785

6 years agoRollup merge of #50797 - shamiao:patch-1, r=kennytm
kennytm [Wed, 16 May 2018 15:23:04 +0000 (23:23 +0800)]
Rollup merge of #50797 - shamiao:patch-1, r=kennytm

fix a typo in signed-integer::from_str_radix()

a minor typo in docs.

6 years agoRollup merge of #50789 - cuviper:bootstrap-metadata, r=alexcrichton
kennytm [Wed, 16 May 2018 15:23:02 +0000 (23:23 +0800)]
Rollup merge of #50789 - cuviper:bootstrap-metadata, r=alexcrichton

Ensure libraries built in stage0 have unique metadata

Issue #50786 shows a case with local rebuild where the libraries built
by stage0 had the same suffix as stage0's own, and were accidentally
loaded by that stage0 rustc when compiling `librustc_trans`.

Now we set `__CARGO_DEFAULT_LIB_METADATA` to "bootstrap" during stage0,
rather than the release channel like usual, so the library suffix will
always be completely distinct from the stage0 compiler.

6 years agoRollup merge of #50788 - varkor:missing-const-cast, r=cramertj
kennytm [Wed, 16 May 2018 15:23:00 +0000 (23:23 +0800)]
Rollup merge of #50788 - varkor:missing-const-cast, r=cramertj

Fix an ICE when casting a nonexistent const

Fixes https://github.com/rust-lang/rust/issues/50599.

6 years agoRollup merge of #50787 - ehuss:fix-run-make-wasm, r=alexcrichton
kennytm [Wed, 16 May 2018 15:22:59 +0000 (23:22 +0800)]
Rollup merge of #50787 - ehuss:fix-run-make-wasm, r=alexcrichton

Fix run-make wasm tests

Fixes #50711

6 years agoRollup merge of #50779 - nox:untracked-options, r=rkruppe
kennytm [Wed, 16 May 2018 15:22:58 +0000 (23:22 +0800)]
Rollup merge of #50779 - nox:untracked-options, r=rkruppe

Make mutable_noalias and arg_align_attributes be tracked

6 years agoRollup merge of #50752 - GuillaumeGomez:more-error-code-in-libsyntax-ext, r=frewsxcv
kennytm [Wed, 16 May 2018 15:22:57 +0000 (23:22 +0800)]
Rollup merge of #50752 - GuillaumeGomez:more-error-code-in-libsyntax-ext, r=frewsxcv

Add missing error codes in libsyntax-ext asm

6 years agoRollup merge of #50740 - nnethercote:rm-LazyBTreeMap, r=cramertj
kennytm [Wed, 16 May 2018 15:22:56 +0000 (23:22 +0800)]
Rollup merge of #50740 - nnethercote:rm-LazyBTreeMap, r=cramertj

Remove LazyBTreeMap.

It was introduced in #50240 to avoid an allocation when creating a new
BTreeMap, which gave some speed-ups. But then #50352 made that the
default behaviour for BTreeMap, so LazyBTreeMap is no longer necessary.

6 years agoRollup merge of #50736 - udoprog:env-try-op, r=shepmaster
kennytm [Wed, 16 May 2018 15:22:54 +0000 (23:22 +0800)]
Rollup merge of #50736 - udoprog:env-try-op, r=shepmaster

env: remove unwrap in examples in favor of try op

6 years agoRollup merge of #50728 - sinkuu:fix_50702, r=GuillaumeGomez
kennytm [Wed, 16 May 2018 15:22:53 +0000 (23:22 +0800)]
Rollup merge of #50728 - sinkuu:fix_50702, r=GuillaumeGomez

Fix rustdoc panic with `impl Trait` in type parameters

Fixes #50702.

I'm not sure `impl Trait`s neither in arguments nor in return types are supposed to work, though.

6 years agoRollup merge of #50726 - udoprog:read2-inner-fn, r=alexcrichton
kennytm [Wed, 16 May 2018 15:22:52 +0000 (23:22 +0800)]
Rollup merge of #50726 - udoprog:read2-inner-fn, r=alexcrichton

read2: Use inner function instead of closure

Very minor thing, but there doesn't appear to be a reason to use a closure here.

Generated code is identical in my tests, but I believe it's clearer that nothing from the environment is being used.

6 years agoAuto merge of #50710 - Zoxc:value_to_constvalue, r=oli-obk
bors [Wed, 16 May 2018 21:01:31 +0000 (21:01 +0000)]
Auto merge of #50710 - Zoxc:value_to_constvalue, r=oli-obk

Fix conversion from Miri Value to ConstValue

This fixes an error compiling the `immeta` 0.3.6 crate. https://github.com/rust-lang/rust/issues/50707 may be fixed too.

r? @oli-obk

6 years agoRemove empty file introduced by rebase
Jane Lusby [Wed, 16 May 2018 17:21:15 +0000 (10:21 -0700)]
Remove empty file introduced by rebase

6 years agoRemove empty files
Jane Lusby [Wed, 16 May 2018 02:53:43 +0000 (19:53 -0700)]
Remove empty files

6 years agotidy: Add a check for empty UI test files
Jane Lusby [Wed, 16 May 2018 02:15:43 +0000 (19:15 -0700)]
tidy: Add a check for empty UI test files

Check for empty `.stderr` and `.stdout` files in UI test directories.
Empty files could  still pass testing for `compile-pass` tests with no output
so they can get into the repo accidentally, but they are not necessary and can
be removed.

6 years agoAuto merge of #49479 - nox:merge-funcs, r=nagisa
bors [Wed, 16 May 2018 17:15:37 +0000 (17:15 +0000)]
Auto merge of #49479 - nox:merge-funcs, r=nagisa

Reenable the MergeFunctions pass

The crash that happened in #23566 doesn't happen anymore with the LLVM mergefunc
pass enabled and it hugely reduces code size (for example it shaves off 10% of the
final Servo executable). This patch reenables it.

For those wondering, [here are the docs from LLVM about this pass](http://llvm.org/docs/MergeFunctions.html).

6 years agoStabilize num::NonZeroU*
Simon Sapin [Wed, 16 May 2018 16:07:35 +0000 (18:07 +0200)]
Stabilize num::NonZeroU*

Tracking issue: https://github.com/rust-lang/rust/issues/49137

6 years agoRemove unstable deprecated num::NonZeroI* types
Simon Sapin [Sat, 24 Mar 2018 10:36:29 +0000 (11:36 +0100)]
Remove unstable deprecated num::NonZeroI* types

6 years agoMake core::nonzero private
Simon Sapin [Fri, 16 Feb 2018 10:33:22 +0000 (11:33 +0100)]
Make core::nonzero private

It is now an implementation detail of ptr::NonNull and num::NonZero*

6 years agoGitHub: Stop treating Cargo.lock as a generated file.
kennytm [Wed, 16 May 2018 15:49:58 +0000 (23:49 +0800)]
GitHub: Stop treating Cargo.lock as a generated file.

We do want to inspect the changes to Cargo.lock, hiding the diff by default
would miss important details like
https://github.com/rust-lang/rust/pull/50629#discussion_r187556602

6 years agoRollup merge of #50669 - QuietMisdreavus:deprecated-attrs, r=GuillaumeGomez
kennytm [Wed, 16 May 2018 15:22:48 +0000 (23:22 +0800)]
Rollup merge of #50669 - QuietMisdreavus:deprecated-attrs, r=GuillaumeGomez

rustdoc: deprecate `#![doc(passes, plugins, no_default_passes)]`

Closes https://github.com/rust-lang/rust/issues/48164

Blocked on https://github.com/rust-lang/rust/pull/50541 - this includes those changes, which were necessary to create the UI test

cc https://github.com/rust-lang/rust/issues/44136

Turns out, there were special attributes to mess with rustdoc passes and plugins! Who knew! Since we deprecated the CLI flags for this functionality, it makes sense that we do the same for the attributes.

This PR also introduces a `#![doc(document_private_items)]` attribute, to match the `--document-private-items` flag introduced in https://github.com/rust-lang/rust/pull/44138 when the passes/plugins flags were deprecated.

I haven't done a search to see whether these attributes are being used at all, but if the flags were any indication, i don't expect to see any users of these.

6 years agoRollup merge of #50656 - leodasvacas:fix-impl-trait-in-main-ret, r=nikomatsakis
kennytm [Wed, 16 May 2018 15:22:47 +0000 (23:22 +0800)]
Rollup merge of #50656 - leodasvacas:fix-impl-trait-in-main-ret, r=nikomatsakis

Fix `fn main() -> impl Trait` for non-`Termination` trait

Fixes #50595.

This bug currently affects stable. Why I think we can go for hard error:
- It will in stable for at most one cycle and there is no legitimate reason to abuse it, nor any known uses in the wild.
- It only affects `bin` crates (which have a `main`), so there is little practical difference between a hard error or a deny lint, both are a one line fix.

The fix was to just unshadow a variable. Thanks @nikomatsakis for the mentoring!

r? @nikomatsakis

6 years agoRollup merge of #50638 - tbu-:pr_open_cloexec_once, r=nagisa
kennytm [Wed, 16 May 2018 15:22:45 +0000 (23:22 +0800)]
Rollup merge of #50638 - tbu-:pr_open_cloexec_once, r=nagisa

Don't unconditionally set CLOEXEC twice on every fd we open on Linux

Previously, every `open64` was accompanied by a `ioctl(…, FIOCLEX)`,
because some old Linux version would ignore the `O_CLOEXEC` flag we pass
to the `open64` function.

Now, we check whether the `CLOEXEC` flag is set on the first file we
open – if it is, we won't do extra syscalls for every opened file. If it
is not set, we fall back to the old behavior of unconditionally calling
`ioctl(…, FIOCLEX)` on newly opened files.

On old Linuxes, this amounts to one extra syscall per process, namely
the `fcntl(…, F_GETFD)` call to check the `CLOEXEC` flag.

On new Linuxes, this reduces the number of syscalls per opened file by
one, except for the first file, where it does the same number of
syscalls as before (`fcntl(…, F_GETFD)` to check the flag instead of
`ioctl(…, FIOCLEX)` to set it).

6 years agoAuto merge of #50045 - est31:label_break_value, r=eddyb
bors [Wed, 16 May 2018 14:22:17 +0000 (14:22 +0000)]
Auto merge of #50045 - est31:label_break_value, r=eddyb

Implement label break value (RFC 2046)

Implement label-break-value (#48594).

6 years agoUpdate Cargo
Eric Huss [Sat, 12 May 2018 20:08:55 +0000 (13:08 -0700)]
Update Cargo

Unblocking PRs:
- rust-lang/cargo#5535 - Ignore <tab> in libtest output. (unblocks #50387)
- rust-lang/cargo#5537 - Remove -Zno-trans test. (unblocks #50615)
- rust-lang/cargo#5540 - Fix tests when CARGO_TARGET_DIR is set. (unblocks self)

Regression fixes:
- rust-lang/cargo#5503 - cargo rustc broken for tests in project with bins
- rust-lang/cargo#5520 - (#50640) shared proc-macro dependency built incorrectly

Changes:
- rust-lang/cargo#5527 - Point Source Replacement to the Overriding Dependencies section
- rust-lang/cargo#5533 - Detail how to run locally-built nightly cargo
- rust-lang/cargo#5522 - Add option to set user-agent
- rust-lang/cargo#5519 - NFC: fix a couple of typos, found by codespell.
- rust-lang/cargo#5513 - Fix `panic` for binaries built during tests.
- rust-lang/cargo#5512 - simplify build_requirements
- rust-lang/cargo#5301 - Add --build-plan for 'cargo build'
- rust-lang/cargo#5460 - Be more conservative about which files are linked to the output dir.
- rust-lang/cargo#5509 - Use the new stable
- rust-lang/cargo#5507 - Does not print seconds fraction with minutes
- rust-lang/cargo#5498 - Bump to 0.29.0
- rust-lang/cargo#5497 - Mention +nightly in ARCHITECTURE.md

6 years agoAddress review comments
est31 [Wed, 16 May 2018 07:18:26 +0000 (09:18 +0200)]
Address review comments

6 years agoAdd feature gate label_break_value
est31 [Sat, 12 May 2018 09:33:33 +0000 (11:33 +0200)]
Add feature gate label_break_value

6 years agoTest that label break value only works on actual blocks
est31 [Sat, 12 May 2018 07:54:53 +0000 (09:54 +0200)]
Test that label break value only works on actual blocks

6 years agoAdd E0696 for continue pointing to a labeled block
est31 [Sat, 12 May 2018 08:18:21 +0000 (10:18 +0200)]
Add E0696 for continue pointing to a labeled block

6 years agoExtend error E0695 to unlabeled continue statements
est31 [Sat, 12 May 2018 09:09:36 +0000 (11:09 +0200)]
Extend error E0695 to unlabeled continue statements

6 years agoAdd E0695 for unlabeled breaks
est31 [Sat, 12 May 2018 07:52:20 +0000 (09:52 +0200)]
Add E0695 for unlabeled breaks

6 years agoMake the compiler support the label-break-value feature
est31 [Wed, 25 Apr 2018 17:28:04 +0000 (19:28 +0200)]
Make the compiler support the label-break-value feature

No error checking or feature gating yet

6 years agoAdd a file with test cases
est31 [Sat, 21 Apr 2018 08:50:14 +0000 (10:50 +0200)]
Add a file with test cases

6 years agolabel-break-value: Parsing and AST/HIR changes
est31 [Mon, 16 Apr 2018 03:44:39 +0000 (05:44 +0200)]
label-break-value: Parsing and AST/HIR changes

6 years agoAuto merge of #50473 - petrochenkov:pmapi, r=alexcrichton
bors [Wed, 16 May 2018 11:18:05 +0000 (11:18 +0000)]
Auto merge of #50473 - petrochenkov:pmapi, r=alexcrichton

Review proc macro API 1.2

cc https://github.com/rust-lang/rust/issues/38356

Summary of applied changes:
- Documentation for proc macro API 1.2 is expanded.
- Renamed APIs: `Term` -> `Ident`, `TokenTree::Term` -> `TokenTree::Ident`, `Op` -> `Punct`, `TokenTree::Op` -> `TokenTree::Punct`, `Op::op` -> `Punct::as_char`.
- Removed APIs: `Ident::as_str`, use `Display` impl for `Ident` instead.
- New APIs (not stabilized in 1.2): `Ident::new_raw` for creating a raw identifier (I'm not sure `new_x` it's a very idiomatic name though).
- Runtime changes:
    - `Punct::new` now ensures that the input `char` is a valid punctuation character in Rust.
    - `Ident::new` ensures that the input `str` is a valid identifier in Rust.
    - Lifetimes in proc macros are now represented as two joint tokens - `Punct('\'', Spacing::Joint)` and `Ident("lifetime_name_without_quote")` similarly to multi-character operators.
- Stabilized APIs: None yet.

A bit of motivation for renaming (although it was already stated in the review comments):
- With my compiler frontend glasses on `Ident` is the single most appropriate name for this thing, *especially* if we are doing input validation on construction. `TokenTree::Ident` effectively wraps `token::Ident` or `ast::Ident + is_raw`, its meaning is "identifier" and it's already named `ident` in declarative macros.
- Regarding `Punct`, the motivation is that `Op` is actively misleading. The thing doesn't mean an operator, it's neither a subset of operators (there is non-operator punctuation in the language), nor superset (operators can be multicharacter while this thing is always a single character). So I named it `Punct` (first proposed in [the original RFC](https://github.com/rust-lang/rfcs/pull/1566), then [by @SimonSapin](https://github.com/rust-lang/rust/issues/38356#issuecomment-276676526)) , together with input validation it's now a subset of ASCII punctuation character category (`u8::is_ascii_punctuation`).

6 years agoAuto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakis
bors [Wed, 16 May 2018 09:03:38 +0000 (09:03 +0000)]
Auto merge of #48557 - matthewjasper:allow-trvial-bounds, r=nikomatsakis

Implement RFC 2056 trivial constraints in where clauses

This is an implementation of the new behaviour for #48214. Tests are mostly updated to show the effects of this. Feature gate hasn't been added yet.

Some things that are worth noting and are maybe not want we want

* `&mut T: Copy` doesn't allow as much as someone might expect because there is often an implicit reborrow.
* ~There isn't a check that a where clause is well-formed any more, so `where Vec<str>: Debug` is now allowed (without a `str: Sized` bound).~

r? @nikomatsakis

6 years agoAuto merge of #50795 - nrc:update, r=oli-obk
bors [Wed, 16 May 2018 06:19:29 +0000 (06:19 +0000)]
Auto merge of #50795 - nrc:update, r=oli-obk

Update RLS and Rustfmt

Fixes RLS tests

r? @alexcrichton

6 years agofix a typo in signed-integer::from_str_radix()
SHA Miao [Wed, 16 May 2018 06:18:53 +0000 (14:18 +0800)]
fix a typo in signed-integer::from_str_radix()

just a small typo.

6 years agoAuto merge of #50750 - est31:master, r=eddyb
bors [Wed, 16 May 2018 04:00:33 +0000 (04:00 +0000)]
Auto merge of #50750 - est31:master, r=eddyb

 Remove ScopeTarget and LoopIdResult

* Remove ScopeTarget in preparation of label-break-value (PR #50045)
* Replace LoopIdResult by Result which is possible now thanks to commit 8ac65af81f5f9cf6c5e2c2306705b50eed77cfb5 " Implement Encodable and Decodable for Result."

r? @eddyb

6 years agoUpdate RLS and Rustfmt
Nick Cameron [Wed, 16 May 2018 03:38:11 +0000 (15:38 +1200)]
Update RLS and Rustfmt

6 years agoFix rustdoc panic with `impl Trait` in type parameters
Shotaro Yamada [Mon, 14 May 2018 03:07:34 +0000 (12:07 +0900)]
Fix rustdoc panic with `impl Trait` in type parameters

6 years agoAuto merge of #50541 - QuietMisdreavus:rustdoc-errors, r=GuillaumeGomez
bors [Wed, 16 May 2018 01:43:26 +0000 (01:43 +0000)]
Auto merge of #50541 - QuietMisdreavus:rustdoc-errors, r=GuillaumeGomez

rustdoc: replace most (e)println! statements with structured warnings/errors

Turns out, the rustc diagnostic handler doesn't need a whole lot of setup that we weren't already doing. For errors that occur outside a "dealing with source code" context, we can just use the format/color config we were already parsing and make up a `Handler` that we can emit structured warnings/errors from. So i did that. This will make it way easier to test things with `rustdoc-ui` tests, since those require the JSON error output. (In fact, this PR is a yak shave for a different one where i was trying to do just that. `>_>`)

6 years agoEnsure libraries built in stage0 have unique metadata
Josh Stone [Wed, 16 May 2018 00:48:02 +0000 (17:48 -0700)]
Ensure libraries built in stage0 have unique metadata

Issue #50786 shows a case with local rebuild where the libraries built
by stage0 had the same suffix as stage0's own, and were accidentally
loaded by that stage0 rustc when compiling `librustc_trans`.

Now we set `__CARGO_DEFAULT_LIB_METADATA` to "bootstrap" during stage0,
rather than the release channel like usual, so the library suffix will
always be completely distinct from the stage0 compiler.

6 years agoFix an ICE when casting a nonexistent const
varkor [Tue, 15 May 2018 23:43:43 +0000 (00:43 +0100)]
Fix an ICE when casting a nonexistent const

6 years agoFix run-make wasm tests
Eric Huss [Tue, 15 May 2018 23:39:21 +0000 (16:39 -0700)]
Fix run-make wasm tests

Fixes #50711

6 years agoAuto merge of #48523 - varkor:generics-ty-generalisations, r=nikomatsakis
bors [Tue, 15 May 2018 23:03:04 +0000 (23:03 +0000)]
Auto merge of #48523 - varkor:generics-ty-generalisations, r=nikomatsakis

The Great Generics Generalisation: Ty Edition

Part of the generic parameter refactoring effort, split off from https://github.com/rust-lang/rust/pull/48149. Contains the `ty`-relative refactoring.

r? @eddyb

6 years agoFix stability annotations for already stable bits of proc macro API 1.1
Vadim Petrochenkov [Sun, 13 May 2018 15:46:38 +0000 (18:46 +0300)]
Fix stability annotations for already stable bits of proc macro API 1.1

Remove unnecessary proc-macro-related `feature`s

6 years agoRepresent lifetimes as two joint tokens in proc macros
Vadim Petrochenkov [Sun, 13 May 2018 21:01:56 +0000 (00:01 +0300)]
Represent lifetimes as two joint tokens in proc macros

6 years agoMake is_global true for latebound regions
Matthew Jasper [Tue, 15 May 2018 20:48:35 +0000 (21:48 +0100)]
Make is_global true for latebound regions

6 years agoAddress feedback, remove remaining review comments, add some more docs
Vadim Petrochenkov [Sun, 13 May 2018 15:35:57 +0000 (18:35 +0300)]
Address feedback, remove remaining review comments, add some more docs

6 years agoproc_macro: Validate inputs to `Punct::new` and `Ident::new`
Vadim Petrochenkov [Sat, 5 May 2018 19:45:59 +0000 (22:45 +0300)]
proc_macro: Validate inputs to `Punct::new` and `Ident::new`

6 years agoproc_macro: Properly support raw identifiers
Vadim Petrochenkov [Sat, 5 May 2018 19:39:05 +0000 (22:39 +0300)]
proc_macro: Properly support raw identifiers

6 years agoTokenTree: Op -> Punct, Term -> Ident
Vadim Petrochenkov [Sat, 5 May 2018 18:09:41 +0000 (21:09 +0300)]
TokenTree: Op -> Punct, Term -> Ident

6 years agoExtend documentation and add review comments
Vadim Petrochenkov [Sat, 5 May 2018 17:12:37 +0000 (20:12 +0300)]
Extend documentation and add review comments

6 years agoAuto merge of #50767 - oli-obk:rls_clippy, r=kennytm
bors [Tue, 15 May 2018 20:18:13 +0000 (20:18 +0000)]
Auto merge of #50767 - oli-obk:rls_clippy, r=kennytm

Don't inject clippy into the rls anymore

r? @kennytm

sorry about breaking nightlies.

The issue is that the `[patch.crates-io]` doesn't work if the versions differ. So every time we update clippy, we can only update it to the verison that rls is depending on.

I'm disabling the injection of clippy into rls for now. I'm not sure how to do this properly. We could

* add a version check, so rls only builds clippy if its dependency clippy is the same as the submodule clippy
* do something crazy like auto-patching the Cargo.toml of the rls tool repo to just use a path dependency on clippy
* build crates-io clippy instead of submodule clippy and gate clippy injection on that
    * that's somewhat automatic, and is essentially what is necessary right now, but done manually
* make clippy 0.1.* instead of 0.0.* and update patch versions for nightly updates and minor version updates for `clippy_lints` api changes.
    * not sure how semver-great this is

6 years agoReenable the MergeFunctions pass
Anthony Ramine [Thu, 29 Mar 2018 07:41:41 +0000 (09:41 +0200)]
Reenable the MergeFunctions pass

The crash that happened in #23566 doesn't happen anymore with the LLVM mergefunc
pass enabled and it hugely reduces code size (for example it shaves off 10% of the
final Servo executable). This patch reenables it.

6 years agoRename ret_ty to declared_ret_ty
leonardo.yvens [Tue, 15 May 2018 18:42:41 +0000 (15:42 -0300)]
Rename ret_ty to declared_ret_ty

6 years agoMake mutable_noalias and arg_align_attributes be tracked
Anthony Ramine [Tue, 15 May 2018 16:03:10 +0000 (18:03 +0200)]
Make mutable_noalias and arg_align_attributes be tracked

6 years agorustc: Fix `crate` lint for single-item paths
Alex Crichton [Fri, 11 May 2018 17:02:17 +0000 (10:02 -0700)]
rustc: Fix `crate` lint for single-item paths

This commit fixes recommending the `crate` prefix when migrating to 2018 for
paths that look like `use foo;` or `use {bar, baz}`

Closes #50660

6 years agoUpdate LLVM to 1abfd0e562cc8f7a9577d97ee92246699093b954
Anthony Ramine [Thu, 10 May 2018 17:15:08 +0000 (19:15 +0200)]
Update LLVM to 1abfd0e562cc8f7a9577d97ee92246699093b954

https://github.com/rust-lang/llvm/pull/111
https://github.com/rust-lang/llvm/pull/114

6 years agoOne must always remember to clean up after themselves
varkor [Tue, 15 May 2018 13:52:53 +0000 (14:52 +0100)]
One must always remember to clean up after themselves

6 years agoPattern match on Ok instead of Some of .ok() retval
est31 [Tue, 15 May 2018 07:42:55 +0000 (09:42 +0200)]
Pattern match on Ok instead of Some of .ok() retval

6 years agoRemove LoopIdResult
est31 [Mon, 14 May 2018 17:07:05 +0000 (19:07 +0200)]
Remove LoopIdResult

It's redundant as Result already implements Encodable
as well as Decodable.

6 years agoRemove hir::ScopeTarget
est31 [Fri, 11 May 2018 13:00:09 +0000 (15:00 +0200)]
Remove hir::ScopeTarget

When we want to implement label-break-value,
we can't really decide whether to emit ScopeTarget::Loop or
ScopeTarget::Block in the code that is supposed to create it.
So we get rid of it and reconstruct the information when
needed.

6 years agoCollapse Substs::identity_for_item in collect
varkor [Tue, 15 May 2018 12:53:20 +0000 (13:53 +0100)]
Collapse Substs::identity_for_item in collect

6 years agoClean up dropck_outlives PhantomData handling
varkor [Tue, 15 May 2018 12:48:04 +0000 (13:48 +0100)]
Clean up dropck_outlives PhantomData handling

6 years agoAdd mk_param_from_def
varkor [Tue, 15 May 2018 12:35:53 +0000 (13:35 +0100)]
Add mk_param_from_def

6 years agoUse Kind instead of UnpackedKind in Substs methods
varkor [Tue, 15 May 2018 12:15:49 +0000 (13:15 +0100)]
Use Kind instead of UnpackedKind in Substs methods

6 years agoClean up shared subst code
varkor [Mon, 14 May 2018 18:57:59 +0000 (19:57 +0100)]
Clean up shared subst code

6 years agoRefactor Substs methods on generic parameters
varkor [Mon, 14 May 2018 17:27:13 +0000 (18:27 +0100)]
Refactor Substs methods on generic parameters

6 years agoClean up generic param handling
varkor [Mon, 14 May 2018 11:49:32 +0000 (12:49 +0100)]
Clean up generic param handling

6 years agoUpdate bad-annotation error message
varkor [Fri, 11 May 2018 15:46:38 +0000 (16:46 +0100)]
Update bad-annotation error message

6 years agoRefactoring generic counting loops
varkor [Fri, 11 May 2018 15:12:56 +0000 (16:12 +0100)]
Refactoring generic counting loops

6 years agoReview refactoring
varkor [Fri, 11 May 2018 00:56:05 +0000 (01:56 +0100)]
Review refactoring

6 years agoRename param_counts to own_counts
varkor [Thu, 10 May 2018 23:30:34 +0000 (00:30 +0100)]
Rename param_counts to own_counts

6 years agoRemove GenericParamDef::to_type
varkor [Thu, 10 May 2018 23:29:38 +0000 (00:29 +0100)]
Remove GenericParamDef::to_type

6 years agoLift pure_wrt_drop to GenericParamDef
varkor [Thu, 10 May 2018 22:46:57 +0000 (23:46 +0100)]
Lift pure_wrt_drop to GenericParamDef

6 years agoRefactor generic params loops
varkor [Thu, 10 May 2018 22:02:41 +0000 (23:02 +0100)]
Refactor generic params loops

6 years agoFix rebase fallout
varkor [Fri, 27 Apr 2018 22:44:25 +0000 (23:44 +0100)]
Fix rebase fallout

6 years agoRename RegionParamDef to LifetimeParamDef
varkor [Wed, 18 Apr 2018 23:41:29 +0000 (00:41 +0100)]
Rename RegionParamDef to LifetimeParamDef

6 years agoPull common parameters into GenericParamDef
varkor [Wed, 18 Apr 2018 23:40:22 +0000 (00:40 +0100)]
Pull common parameters into GenericParamDef

This leads to a lot of simplifications, as most code doesn't actually need to know about the specific lifetime/type data; rather, it's concerned with properties like name, index and def_id.