Commit graph

129290 commits

Author SHA1 Message Date
bors
59dafb876e Auto merge of #77630 - Dylan-DPC:rollup-kfwl55z, r=Dylan-DPC
Rollup of 11 pull requests

Successful merges:

 - #76784 (Add some docs to rustdoc::clean::inline and def_id functions)
 - #76911 (fix VecDeque::iter_mut aliasing issues)
 - #77400 (Fix suggestions for x.py setup)
 - #77515 (Update to chalk 0.31)
 - #77568 (inliner: use caller param_env)
 - #77571 (Use matches! for core::char methods)
 - #77582 (Move `EarlyOtherwiseBranch` to mir-opt-level 2)
 - #77590 (Update RLS and Rustfmt)
 - #77605 (Fix rustc_def_path to show the full path and not the trimmed one)
 - #77614 (Let backends access span information)
 - #77624 (Add c as a shorthand check alternative for new options #77603)

Failed merges:

r? `@ghost`
2020-10-06 23:07:17 +00:00
bors
c8d89ba5d5 Auto merge of #6127 - ebroto:reinstate_forbid_restriction, r=flip1995
Reinstate test for forbid(clippy::restriction)

In [this commit](5747c15961) coming from rust-lang/rust (#6126) the test for `#![forbid(clippy::restriction)]` was removed because some restriction lints were being allowed after the forbid.

This change reinstates the test for `forbid` by using a separate file.

changelog: none

r? `@flip1995`
2020-10-06 22:33:57 +00:00
Joshua Nelson
2a41342e9c Make src/bootstrap/CHANGELOG.md more helpful 2020-10-06 18:28:01 -04:00
Dylan DPC
f600154be6
Rollup merge of #77624 - akoptelov:c-all-targets-fix, r=jyn514
Add c as a shorthand check alternative for new options #77603

There is a missing "c" that is a shorthand for "check" in newly added match arm for handling check-specific options.
2020-10-07 00:16:16 +02:00
Dylan DPC
1b056157e9
Rollup merge of #77614 - khyperia:set_span, r=eddyb
Let backends access span information

Sometimes, a backend may need to emit warnings, errors, or otherwise need to know the span of the current item in a basic block. So, add a `set_span` method to give the backend that information.

The `set_source_location` method already partially does this, however, it's disabled when debug info is disabled. There needs to be a way to unconditionally provide the span.
2020-10-07 00:16:14 +02:00
Dylan DPC
207832bdc0
Rollup merge of #77605 - da-x:fix-rustc-def-path, r=petrochenkov
Fix rustc_def_path to show the full path and not the trimmed one

Follow-up fix for #73996.
2020-10-07 00:16:12 +02:00
Dylan DPC
6951c3180e
Rollup merge of #77590 - Xanewok:update-rls, r=dtolnay
Update RLS and Rustfmt

refs: https://github.com/rust-lang/rls/pull/1701

cc @calebcartwright

r? @dtolnay
2020-10-07 00:16:10 +02:00
Dylan DPC
6b4dbb196c
Rollup merge of #77582 - ecstatic-morse:disable-early-otherwise-branch, r=wesleywiser
Move `EarlyOtherwiseBranch` to mir-opt-level 2

cc #75119

This didn't have an [effect in most cases](https://perf.rust-lang.org/compare.html?start=81e02708f1f4760244756548981277d5199baa9a&end=2e0edc0f28c5647141bedba02e7a222d3a5dc9c3&stat=instructions:u), and is not trivially sound. Let it bake at `mir-opt-level=2` for a while.

Also, this missed the cutoff for beta, so we'll have to backport this.
r? @wesleywiser
2020-10-07 00:16:08 +02:00
Dylan DPC
5314c72de8
Rollup merge of #77571 - pickfire:patch-6, r=cramertj
Use matches! for core::char methods
2020-10-07 00:16:07 +02:00
Dylan DPC
83c58d6fb6
Rollup merge of #77568 - lcnr:mir-inline-def-id, r=ecstatic-morse
inliner: use caller param_env

We used the callee param env instead of the caller param env by accident in #77430, this PR fixes that and caches it in the `Inliner` struct.

fixes #77564

r? @ecstatic-morse
2020-10-07 00:16:05 +02:00
Dylan DPC
a7a75b908a
Rollup merge of #77515 - jackh726:chalk-0.31, r=matthewjasper
Update to chalk 0.31

Gonna assign @nikomatsakis to the review here, but since he is pretty busy recently, if anyone else wants to review this, that would be much appreciated.

r? @nikomatsakis
2020-10-07 00:16:03 +02:00
Dylan DPC
59707c5748
Rollup merge of #77400 - alarsyo:xpy-setup-suggestions, r=jyn514
Fix suggestions for x.py setup

#76631 introduced a new `setup` command to x.py

By default the command prompts for a profile to use:

```
Welcome to the Rust project! What do you want to do with x.py?
a) Contribute to the standard library
b) Contribute to the compiler
c) Contribute to the compiler, and also modify LLVM or codegen
d) Install Rust from source
```

and then displays command suggestions, depending on which profile was chosen. However [the mapping between chosen profile](9cba260df0/src/bootstrap/setup.rs (L75-L85)) and [suggestion](9cba260df0/src/bootstrap/setup.rs (L42-L47)) isn't exact, leading to suggestions not being shown if the user presses `c` or `d`. (because "c" is translated to "llvm" and "d" to "maintainer", but suggestions trigger for "codegen" and "user" respectively)

A more thorough refactor would stop using "strings-as-type" to make sure this kind of error doesn't happen, but it may be overkill for that kind of "script" program?

Tagging the setup command author: @jyn514
2020-10-07 00:16:01 +02:00
Dylan DPC
5ae45ea4e2
Rollup merge of #76911 - RalfJung:vecdeque-aliasing, r=oli-obk
fix VecDeque::iter_mut aliasing issues

Fixes https://github.com/rust-lang/rust/issues/74029
2020-10-07 00:15:59 +02:00
Dylan DPC
d26ca984c3
Rollup merge of #76784 - lzutao:rd_doc, r=GuillaumeGomez
Add some docs to rustdoc::clean::inline and def_id functions

Split from #76571 .
2020-10-07 00:15:58 +02:00
Tamir Duberstein
49ade22bd9
Parse SocketAddrV6::scope_id 2020-10-06 22:13:15 +00:00
Tamir Duberstein
a093957f43
Avoid unused return 2020-10-06 22:12:16 +00:00
Eduardo Broto
6c3611bdef Reinstate test for forbid blanket restriction 2020-10-07 00:02:28 +02:00
bors
1a4175bcec Auto merge of #6126 - flip1995:rustup, r=flip1995
Rustup

Supersedes #6121. There was another breakage.

r? `@ghost`

changelog: none
2020-10-06 21:34:50 +00:00
flip1995
b05aeaa9bc
Run fmt 2020-10-06 23:32:38 +02:00
bors
98edd1fbf8 Auto merge of #77386 - joshtriplett:static-glibc, r=petrochenkov
Support static linking with glibc and target-feature=+crt-static

With this change, it's possible to build on a linux-gnu target and pass
RUSTFLAGS='-C target-feature=+crt-static' or the equivalent via a
`.cargo/config.toml` file, and get a statically linked executable.

Update to libc 0.2.78, which adds support for static linking with glibc.

Add `crt_static_respected` to the `linux_base` target spec.

Update `android_base` and `linux_musl_base` accordingly. Avoid enabling
crt_static_respected on Android platforms, since that hasn't been
tested.

Closes https://github.com/rust-lang/rust/issues/65447.
2020-10-06 21:11:04 +00:00
Alexander Koptelov
db46f43977 Add c as a shorthand check alternative for new options #77603 2020-10-06 22:05:11 +03:00
Dylan MacKenzie
b5693a39d9 Update error code page 2020-10-06 11:22:24 -07:00
Jack Huey
23491084bc Update to chalk 0.31. Implement some unimplemented. Ignore some tests in compare mode chalk don't finish. 2020-10-06 14:14:25 -04:00
Ivan Tham
7021d70d2e
Use more concrete explanation for methods
Show some code rather than "a single method call".
2020-10-06 23:58:32 +08:00
AnthonyMikh
981cb8c191 Eliminate bounds checking in slice::Windows 2020-10-06 18:23:37 +03:00
bors
9fdaeb393a Auto merge of #76356 - caass:hooks, r=jyn514
Add a command to install a git hook to automatically run `x.py test tidy --bless`

Some folks (such as myself) would probably find a lot of convenience in a pre-commit hook that automatically runs tidy before committing, to avoid burning CI time learning that your commit wasn't tidy.

I'm absolutely positive I have missed some stuff. I basically just got this to where you can run `./x.py run install-git-hook` and then clicked the commit button. Please let me know what else you'd like me to add before this can be merged!

[rustc-dev-guide companion PR](https://github.com/rust-lang/rustc-dev-guide/pull/848)
2020-10-06 14:51:51 +00:00
Antoine Martin
d67a7e6cfc Use String type for Profile parse error 2020-10-06 16:40:30 +02:00
Antoine Martin
3afc004845 Show available profiles on error 2020-10-06 16:40:30 +02:00
Antoine Martin
d3d3397121 Use Profile enum for x.py setup 2020-10-06 16:40:30 +02:00
Antoine Martin
6e06388a7f Fix suggestions for x.py setup 2020-10-06 15:53:58 +02:00
khyperia
c5bc95676b Let backends access span information
Sometimes, a backend may need to emit warnings, errors, or otherwise
need to know the span of the current item in a basic block. So, add a
set_span method to give the backend that information.
2020-10-06 15:39:12 +02:00
Philipp Hansch
da57a16872
clippy_lints: Replace lazy_static with SyncLazy 2020-10-06 14:39:04 +02:00
bors
08e2d46166 Auto merge of #73905 - matthewjasper:projection-bounds-2, r=nikomatsakis
Separate projection bounds and predicates

Follow up to #72788.

- Rename `projection_predicates` to `item_bounds`
- Separate bounds on associated types (the things after the `:` in `type X: ...`) and opaque types (the things after `impl`)  from predicates.
- Projection candidates now have the correct nested obligations
- Trait object candidates now check that the associated types on the trait object satisfy their bounds as nested obligations
- Type alias impl trait types are now checked (#73035)
- `feature(generic_associated_types)` no longer changes how we handle bounds (#73816)

Opening for a perf and crater runs.

r? `@nikomatsakis`
2020-10-06 12:26:54 +00:00
Matthew Jasper
69fc6d8c5c Fix NLL compare mode tests 2020-10-06 11:19:33 +01:00
Matthew Jasper
c9eeb60b63 Deduplicate some code 2020-10-06 11:19:33 +01:00
Matthew Jasper
022c148fcd Fix tests from rebase 2020-10-06 11:19:33 +01:00
Matthew Jasper
1db284ecb0 Avoid creating useless projection predicate 2020-10-06 11:19:33 +01:00
Matthew Jasper
27534b3932 Fix rebase 2020-10-06 11:19:33 +01:00
Matthew Jasper
852073a7d2 Deduplicate item bounds after normalization 2020-10-06 11:19:32 +01:00
Matthew Jasper
e42c97919c Don't require lifetime super-bounds on traits apply to trait objects of that trait 2020-10-06 11:19:32 +01:00
Matthew Jasper
e674cf0200 Normalize super trait bounds when confirming object candidates 2020-10-06 11:19:32 +01:00
Matthew Jasper
d08ab945de Fix rebase 2020-10-06 11:19:32 +01:00
Matthew Jasper
e29765250b Don't immediately error for recursive projections 2020-10-06 11:19:32 +01:00
Matthew Jasper
6c4feb681f Fix bootstrap 2020-10-06 11:19:32 +01:00
Matthew Jasper
ed32482534 Handle multiple trait-def projection candidates 2020-10-06 11:19:32 +01:00
Matthew Jasper
0dfa6ff3be Avoid cycles from projection bounds
Only check the own predicates of associated types when confirming
projection candidates.
Also consider implied bounds when comparing trait and impl methods.
2020-10-06 11:19:32 +01:00
Matthew Jasper
596d6c4b3b Avoid cycle with projections from object types
Normalizing `<dyn Iterator<Item = ()> as Iterator>::Item` no longer
requires selecting `dyn Iterator<Item = ()>: Iterator`. This was
previously worked around by using a special type-folder to normalize
things.
2020-10-06 11:19:31 +01:00
Matthew Jasper
34e5a4992c Normalize projection bounds when considering candidates
This unfortunately requires some winnowing hacks to avoid
now ambiguous candidates.
2020-10-06 11:19:31 +01:00
Matthew Jasper
cfee49593d Handle multiple applicable projection candidates 2020-10-06 11:19:31 +01:00
Matthew Jasper
bc08b791bc Fix bugs in evaluating WellFormed predicates
- List the nestsed obligations in an order that works with the
  single pass used by evaluation
- Propagate recursion depth correctly
2020-10-06 11:19:31 +01:00