Commit graph

129481 commits

Author SHA1 Message Date
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
Guillaume Gomez
11f3476c59 Enforce whitespace ascii character check for doc alias 2020-10-06 14:29:42 +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
Matthew Jasper
f52b2d8890 Avoid cycle in nested obligations for object candidate
Bounds of the form `type Future: Future<Result=Self::Result>` exist in
some ecosystem crates. To validate these bounds for trait objects we
need to normalize `Self::Result` in a way that doesn't cause a cycle.
2020-10-06 11:19:31 +01:00
Matthew Jasper
582ccec1c5 Remove predicates on associated types from traits
These need to only be bounds to avoid cycle errors in trait checking.
2020-10-06 11:19:31 +01:00
Matthew Jasper
8787090964 Address review comments 2020-10-06 11:19:31 +01:00
Matthew Jasper
adb7fc6283 Fix tools 2020-10-06 11:19:30 +01:00
Matthew Jasper
21eccbb587 Fix ICE 2020-10-06 11:19:30 +01:00
Matthew Jasper
0dda4154bd Fix tools 2020-10-06 11:19:30 +01:00
Matthew Jasper
042464f75a Fix tests and bootstrap 2020-10-06 11:19:30 +01:00
Matthew Jasper
2bdf723da7 Ensure that associated types for trait objects satisfy their bounds 2020-10-06 11:19:30 +01:00
Matthew Jasper
0a76584dcc Move some code from rustc_typeck to rustc_trait_selection 2020-10-06 11:19:30 +01:00
Matthew Jasper
d4d9e7f67f Remove unused part of return value from replace_bound_vars_with_placeholders 2020-10-06 11:19:30 +01:00
Matthew Jasper
1b07991574 Check associated type bounds for object safety violations 2020-10-06 11:19:30 +01:00
Matthew Jasper
5b279c8016 Check opaque types satisfy their bounds 2020-10-06 11:19:30 +01:00
Matthew Jasper
b3057f4d5f Check projections are well-formed when using projection candidates 2020-10-06 11:19:29 +01:00
Matthew Jasper
87f2f42dc2 Make projection wf check the predicates for the projection 2020-10-06 11:19:29 +01:00