]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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.

6 years agoInline get_type
varkor [Wed, 18 Apr 2018 16:54:05 +0000 (17:54 +0100)]
Inline get_type

6 years agoFix typo in late-bound region testing message
varkor [Wed, 18 Apr 2018 17:32:45 +0000 (18:32 +0100)]
Fix typo in late-bound region testing message

6 years agoRefactor to address comments
varkor [Wed, 18 Apr 2018 16:15:53 +0000 (17:15 +0100)]
Refactor to address comments

6 years agoReplace type_param_to_index with param_def_id_to_index
varkor [Wed, 18 Apr 2018 11:45:13 +0000 (12:45 +0100)]
Replace type_param_to_index with param_def_id_to_index

6 years agoUse GenericParamCount instead of FxHashMap
varkor [Wed, 18 Apr 2018 10:33:52 +0000 (11:33 +0100)]
Use GenericParamCount instead of FxHashMap

6 years agoPlace Self at the start of ty::Generics' param lists
varkor [Sun, 15 Apr 2018 00:36:31 +0000 (01:36 +0100)]
Place Self at the start of ty::Generics' param lists

6 years agoCorrect variable renaming fallout
varkor [Sat, 14 Apr 2018 23:22:29 +0000 (00:22 +0100)]
Correct variable renaming fallout

6 years agoEliminate ty::Generics::types()
varkor [Sat, 14 Apr 2018 18:20:51 +0000 (19:20 +0100)]
Eliminate ty::Generics::types()

And with one final incanation, the specific kind iterators were banished from ty::Generics, never to be seen again!

6 years agoEliminate ty::Generics::lifetimes()
varkor [Fri, 13 Apr 2018 23:07:25 +0000 (00:07 +0100)]
Eliminate ty::Generics::lifetimes()

Begone lazy lifetime code!

6 years agoGeneralise more cases of explicit iteration of specific kinds
varkor [Fri, 13 Apr 2018 22:12:14 +0000 (23:12 +0100)]
Generalise more cases of explicit iteration of specific kinds

6 years agoGeneralise cases of explicit iteration of specific kinds
varkor [Thu, 12 Apr 2018 23:57:38 +0000 (00:57 +0100)]
Generalise cases of explicit iteration of specific kinds

6 years agoFix tidy errors caused by renaming
varkor [Thu, 12 Apr 2018 19:36:18 +0000 (20:36 +0100)]
Fix tidy errors caused by renaming

6 years agoRename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDef
varkor [Thu, 12 Apr 2018 19:29:44 +0000 (20:29 +0100)]
Rename TypeParameterDef -> TypeParamDef and RegionParameterDef -> RegionParamDef

6 years agoRename GenericParam to GenericParamDef
varkor [Thu, 12 Apr 2018 16:53:29 +0000 (17:53 +0100)]
Rename GenericParam to GenericParamDef

6 years agoRename `has_type_parameters` to `requires_monomorphization`
varkor [Thu, 12 Apr 2018 16:51:08 +0000 (17:51 +0100)]
Rename `has_type_parameters` to `requires_monomorphization`

6 years agoFix generics type parameter handling in miri
varkor [Mon, 12 Mar 2018 12:47:03 +0000 (12:47 +0000)]
Fix generics type parameter handling in miri

6 years agoInline Generics::own_count
varkor [Thu, 8 Mar 2018 12:10:13 +0000 (12:10 +0000)]
Inline Generics::own_count

6 years agoPrefer iterator to vec
varkor [Sun, 25 Feb 2018 00:31:26 +0000 (00:31 +0000)]
Prefer iterator to vec

6 years agoRename ty::GenericParameterDef to GenericParam
varkor [Sun, 25 Feb 2018 00:01:05 +0000 (00:01 +0000)]
Rename ty::GenericParameterDef to GenericParam

6 years agoRename ty::Generics::parameters to params
varkor [Sat, 24 Feb 2018 02:40:40 +0000 (02:40 +0000)]
Rename ty::Generics::parameters to params

6 years agoReduce parent_params to parent_count
varkor [Sat, 24 Feb 2018 18:29:40 +0000 (18:29 +0000)]
Reduce parent_params to parent_count

6 years agoConsolidate ty::Generics
varkor [Thu, 8 Mar 2018 10:39:31 +0000 (10:39 +0000)]
Consolidate ty::Generics

6 years agoAuto merge of #50769 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 15 May 2018 13:14:08 +0000 (13:14 +0000)]
Auto merge of #50769 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 11 pull requests

Successful merges:

 - #49767 (Rewrite docs for `std::ptr`)
 - #50399 (save-analysis: handle aliasing imports a bit more nicely)
 - #50594 (Update the man page with additional --print options)
 - #50613 (Migrate the toolstate update bot to rust-highfive)
 - #50632 (Add minification process)
 - #50685 (ci: Add Dockerfile for dist-sparc64-linux)
 - #50691 (rustdoc: Add support for pub(restricted))
 - #50712 (Improve eager type resolution error message)
 - #50720 (Add “Examples” section header in f32/f64 doc comments.)
 - #50733 (Hyperlink DOI against preferred resolver)
 - #50745 (Uncapitalize "You")

Failed merges:

6 years agoRollup merge of #50745 - kraai:patch-1, r=kennytm
Guillaume Gomez [Tue, 15 May 2018 12:27:06 +0000 (14:27 +0200)]
Rollup merge of #50745 - kraai:patch-1, r=kennytm

Uncapitalize "You"

6 years agoRollup merge of #50733 - katrinleinweber:patch-secure-DOI, r=kennytm
Guillaume Gomez [Tue, 15 May 2018 12:27:05 +0000 (14:27 +0200)]
Rollup merge of #50733 - katrinleinweber:patch-secure-DOI, r=kennytm

Hyperlink DOI against preferred resolver

Hello :-)  The DOI foundation recommends [this new, secure resolver](https://www.doi.org/doi_handbook/3_Resolution.html#3.8). Accordingly, this PR updates a DOI link.

6 years agoRollup merge of #50720 - frewsxcv:frewsxcv-examples, r=QuietMisdreavus
Guillaume Gomez [Tue, 15 May 2018 12:27:04 +0000 (14:27 +0200)]
Rollup merge of #50720 - frewsxcv:frewsxcv-examples, r=QuietMisdreavus

Add “Examples” section header in f32/f64 doc comments.

This is recommend by [RFC 0505] and as far as I know, the only primitive
types without this heading.

[RFC 0505]: https://github.com/rust-lang/rfcs/blob/c892139be692586e0846fbf934be6fceec17f329/text/0505-api-comment-conventions.md#using-markdown

6 years agoRollup merge of #50712 - leodasvacas:improve-eager-resolution-error-message, r=estebank
Guillaume Gomez [Tue, 15 May 2018 12:27:02 +0000 (14:27 +0200)]
Rollup merge of #50712 - leodasvacas:improve-eager-resolution-error-message, r=estebank

Improve eager type resolution error message

This PR improves the span of eager resolution type errors referring to indexing and field access to use the base span rather than the whole expression.

Also a "note: type must be known at this point" is added where in the past we emitted the "type must be known at this context" error, so that early failures can be differentiated and will hopefully be less surprising.

Fixes #50692 (or at least does the best we can for the moment)

r? @estebank

6 years agoRollup merge of #50691 - ollie27:rustdoc_pub_restricted, r=QuietMisdreavus
Guillaume Gomez [Tue, 15 May 2018 12:27:01 +0000 (14:27 +0200)]
Rollup merge of #50691 - ollie27:rustdoc_pub_restricted, r=QuietMisdreavus

rustdoc: Add support for pub(restricted)

This is useful when using `--document-private-items`.

r? @QuietMisdreavus

6 years agoRollup merge of #50685 - glaubitz:sparc64-linux, r=alexcrichton
Guillaume Gomez [Tue, 15 May 2018 12:27:00 +0000 (14:27 +0200)]
Rollup merge of #50685 - glaubitz:sparc64-linux, r=alexcrichton

ci: Add Dockerfile for dist-sparc64-linux

This addresses https://github.com/rust-lang/rust/issues/47903.

6 years agoRollup merge of #50632 - GuillaumeGomez:minification, r=ollie27
Guillaume Gomez [Tue, 15 May 2018 12:26:59 +0000 (14:26 +0200)]
Rollup merge of #50632 - GuillaumeGomez:minification, r=ollie27

Add minification process

r? @QuietMisdreavus

6 years agoRollup merge of #50613 - kennytm:update-toolstate-with-highfive, r=alexcrichton
Guillaume Gomez [Tue, 15 May 2018 12:26:57 +0000 (14:26 +0200)]
Rollup merge of #50613 - kennytm:update-toolstate-with-highfive, r=alexcrichton

Migrate the toolstate update bot to rust-highfive

Rationale: Only members of the rust-lang organization can mention its teams. That means #50434 has no effect if we are still using @kennytm-githubbot.

6 years agoRollup merge of #50594 - sanxiyn:man-print, r=steveklabnik
Guillaume Gomez [Tue, 15 May 2018 12:26:56 +0000 (14:26 +0200)]
Rollup merge of #50594 - sanxiyn:man-print, r=steveklabnik

Update the man page with additional --print options

`\:` is a `groff` for `<wbr>` to get better line breaking.

6 years agoRollup merge of #50399 - nrc:alias, r=eddyb
Guillaume Gomez [Tue, 15 May 2018 12:26:55 +0000 (14:26 +0200)]
Rollup merge of #50399 - nrc:alias, r=eddyb

save-analysis: handle aliasing imports a bit more nicely

r? @eddyb

6 years agoRollup merge of #49767 - ecstatic-morse:ptr-docs, r=steveklabnik
Guillaume Gomez [Tue, 15 May 2018 12:26:54 +0000 (14:26 +0200)]
Rollup merge of #49767 - ecstatic-morse:ptr-docs, r=steveklabnik

Rewrite docs for `std::ptr`

This PR attempts to resolve #29371.

This is a fairly major rewrite of the `std::ptr` docs, and deserves a fair bit of scrutiny. It adds links to the GNU libc docs for various instrinsics, adds internal links to types and functions referenced in the docs, adds new, more complex examples for many functions, and introduces a common template for discussing unsafety of functions in `std::ptr`.

All functions in `std::ptr` (with the exception of `ptr::eq`) are unsafe because they either read from or write to a raw pointer. The "Safety" section now informs that the function is unsafe because it dereferences a raw pointer and requires that any pointer to be read by the function points to "a valid vaue of type `T`".

Additionally, each function imposes some subset of the following conditions on its arguments.

* The pointer points to valid memory.
* The pointer points to initialized memory.
* The pointer is properly aligned.

These requirements are discussed in the "Undefined Behavior" section along with the  consequences of using functions that perform bitwise copies without requiring `T: Copy`. I don't love my new descriptions of the consequences of making such copies. Perhaps the old ones were good enough?

Some issues which still need to be addressed before this is merged:
- [ ] The new docs assert that `drop_in_place` is equivalent to calling `read` and discarding the value. Is this correct?
- [ ] Do `write_bytes` and `swap_nonoverlapping` require properly aligned pointers?
- [ ] The new example for `drop_in_place` is a lackluster.
- [ ] Should these docs rigorously define what `valid` memory is? Or should is that the job of the reference? Should we link to the reference?
- [ ] Is it correct to require that pointers that will be read from refer to "valid values of type `T`"?
- [x] I can't imagine ever using `{read,write}_volatile` with non-`Copy` types.  Should I just link to {read,write} and say that the same issues with non-`Copy` types apply?
- [x] `write_volatile` doesn't link back to `read_volatile`.
- [ ] Update docs for the unstable [`swap_nonoverlapping`](https://github.com/rust-lang/rust/issues/42818)
- [ ] Update docs for the unstable [unsafe pointer methods RFC](https://github.com/rust-lang/rfcs/pull/1966)

Looking forward to your feedback.

r? @steveklabnik

6 years agoUpdate existing tests for trivial bounds changes
Matthew Jasper [Sun, 6 May 2018 21:57:49 +0000 (22:57 +0100)]
Update existing tests for trivial bounds changes

6 years agoAdd tests for trivial bounds
Matthew Jasper [Sun, 6 May 2018 21:54:00 +0000 (22:54 +0100)]
Add tests for trivial bounds

6 years agoAdd trivial bounds lint
Matthew Jasper [Sun, 6 May 2018 21:52:58 +0000 (22:52 +0100)]
Add trivial bounds lint

6 years agoFeature gate trivial bounds
Matthew Jasper [Sun, 6 May 2018 21:50:35 +0000 (22:50 +0100)]
Feature gate trivial bounds

6 years agoImplement RFC 2056 - trivial constraints
Matthew Jasper [Sun, 6 May 2018 21:48:56 +0000 (22:48 +0100)]
Implement RFC 2056 - trivial constraints

6 years agoAuto merge of #50351 - varkor:vestigial-never-conversion, r=nikomatsakis
bors [Tue, 15 May 2018 10:34:45 +0000 (10:34 +0000)]
Auto merge of #50351 - varkor:vestigial-never-conversion, r=nikomatsakis

Remove vestigial diverging !-coercion

Such conversions are no longer permitted. Fixes #50350.

r? @nikomatsakis

6 years agoDon't inject clippy into the rls anymore
Oliver Schneider [Tue, 15 May 2018 09:34:24 +0000 (11:34 +0200)]
Don't inject clippy into the rls anymore

6 years agosave-analysis: handle aliasing imports a bit more nicely
Nick Cameron [Tue, 15 May 2018 08:34:17 +0000 (20:34 +1200)]
save-analysis: handle aliasing imports a bit more nicely

6 years agoAuto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
bors [Tue, 15 May 2018 08:19:06 +0000 (08:19 +0000)]
Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton

Update stdsimd module

to include https://github.com/rust-lang-nursery/stdsimd/commit/a19ca1cd91cf97777af8268a6136bd2e4648e189

6 years agoAuto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27
bors [Tue, 15 May 2018 05:39:35 +0000 (05:39 +0000)]
Auto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27

Rustdoc improvements

Fixes #50658. (last commit)

A lot of small improvements.

r? @QuietMisdreavus

6 years agoAuto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth
bors [Tue, 15 May 2018 03:14:46 +0000 (03:14 +0000)]
Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth

Ensure derive(PartialOrd) is no longer accidentally exponential

Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572.

Closes #49505.

r? @Manishearth (sorry for changing it again so soon!)

Close #50755

6 years agoAuto merge of #50705 - oli-obk:clippy, r=kennytm
bors [Tue, 15 May 2018 00:35:47 +0000 (00:35 +0000)]
Auto merge of #50705 - oli-obk:clippy, r=kennytm

Update clippy

r? @Manishearth

@bors p=1

6 years agoci: Add Dockerfile for dist-sparc64-linux
John Paul Adrian Glaubitz [Sat, 12 May 2018 12:34:41 +0000 (14:34 +0200)]
ci: Add Dockerfile for dist-sparc64-linux

6 years agoAuto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov
bors [Mon, 14 May 2018 20:46:09 +0000 (20:46 +0000)]
Auto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov

typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

Fixes: #50493
6 years agoAuto merge of #50735 - eddyb:issue-50731, r=nikomatsakis
bors [Mon, 14 May 2018 18:04:11 +0000 (18:04 +0000)]
Auto merge of #50735 - eddyb:issue-50731, r=nikomatsakis

rustc: don't trip an assertion for enums with present but uninhabited variants.

Fixes #50731.

r? @nikomatsakis