]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agorustdoc: Add stability notices to impl items
Oliver Middleton [Wed, 15 Jun 2016 22:55:11 +0000 (23:55 +0100)]
rustdoc: Add stability notices to impl items

Also fixes missing stability notices on methods with no docs.

8 years agoAuto merge of #34232 - ollie27:rustdoc_inline, r=alexcrichton
bors [Tue, 14 Jun 2016 12:04:38 +0000 (05:04 -0700)]
Auto merge of #34232 - ollie27:rustdoc_inline, r=alexcrichton

rustdoc: Don't inline #[doc(hidden)] pub use

Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.

An example in `std` is [`__OsLocalKeyInner`](https://doc.rust-lang.org/nightly/std/thread/struct.__OsLocalKeyInner.html) which clearly should not be documented.

8 years agoAuto merge of #34266 - liigo:patch-8, r=Manishearth
bors [Tue, 14 Jun 2016 07:24:33 +0000 (00:24 -0700)]
Auto merge of #34266 - liigo:patch-8, r=Manishearth

reference: link to proper ffi attributes

8 years agoAuto merge of #33749 - jseyfried:fix_call_site_span, r=nrc
bors [Tue, 14 Jun 2016 04:07:30 +0000 (21:07 -0700)]
Auto merge of #33749 - jseyfried:fix_call_site_span, r=nrc

Fix macro call site spans

Fix macro call site spans.
r? @nrc

8 years agoreference: link to proper ffi attributes
Liigo Zhuang [Tue, 14 Jun 2016 02:50:48 +0000 (10:50 +0800)]
reference: link to proper ffi attributes

8 years agoAuto merge of #34262 - dsprenkels:enum_pattern_resolve_ice, r=eddyb
bors [Tue, 14 Jun 2016 01:26:30 +0000 (18:26 -0700)]
Auto merge of #34262 - dsprenkels:enum_pattern_resolve_ice, r=eddyb

Add regression test for #33293

This PR adds a regression test for #33293.

Closes #33293.
r? @eddyb

8 years agoReplace `println!("");` invocations with calls to a dummy function in debuginfo test
Jeffrey Seyfried [Sat, 28 May 2016 08:30:08 +0000 (01:30 -0700)]
Replace `println!("");` invocations with calls to a dummy function in debuginfo test

8 years agoAuto merge of #34243 - c3st7n:add_test_issue_issue_23477, r=nagisa
bors [Mon, 13 Jun 2016 22:44:17 +0000 (15:44 -0700)]
Auto merge of #34243 - c3st7n:add_test_issue_issue_23477, r=nagisa

Add test case for issue #23477

My first pull request, any feedback welcome.

Fixes #23477

8 years agoCorrect broken test
Chris Tomlinson [Mon, 13 Jun 2016 21:27:13 +0000 (22:27 +0100)]
Correct broken test

8 years agoAdd regression test for #33293
Daan Sprenkels [Mon, 13 Jun 2016 20:59:36 +0000 (22:59 +0200)]
Add regression test for #33293

8 years agoAuto merge of #34259 - fbergr:master, r=GuillaumeGomez
bors [Mon, 13 Jun 2016 19:51:42 +0000 (12:51 -0700)]
Auto merge of #34259 - fbergr:master, r=GuillaumeGomez

doc: Fix typo

8 years agodoc: Fix typo
Florian Berger [Mon, 13 Jun 2016 18:35:37 +0000 (21:35 +0300)]
doc: Fix typo

8 years agoAuto merge of #34242 - zackmdavis:explain_E0453, r=GuillaumeGomez
bors [Mon, 13 Jun 2016 14:38:40 +0000 (07:38 -0700)]
Auto merge of #34242 - zackmdavis:explain_E0453, r=GuillaumeGomez

add long explanation for E0453, lint attribute overruled by outer forbid

This is a subtask of #32777.

-----

r? @GuillaumeGomez

8 years agoAuto merge of #34252 - dsprenkels:issue-32364-test, r=eddyb
bors [Mon, 13 Jun 2016 09:31:29 +0000 (02:31 -0700)]
Auto merge of #34252 - dsprenkels:issue-32364-test, r=eddyb

Add regression test for #32364

This PR adds a regression test for #32364.

r? @eddyb

8 years agoAuto merge of #34247 - petevine:patch-1, r=steveklabnik
bors [Mon, 13 Jun 2016 06:37:07 +0000 (23:37 -0700)]
Auto merge of #34247 - petevine:patch-1, r=steveklabnik

Remove stray word

Another `with` is redundant here.

8 years agoedit E0453 long explanation for style, clarity, and citizenship
Zack M. Davis [Mon, 13 Jun 2016 03:55:36 +0000 (20:55 -0700)]
edit E0453 long explanation for style, clarity, and citizenship

It turns out that the subsequent lines of the error message comment
should be aligned like this.

The "turns the corresponding compiler warning" language may not be
strictly the most accurate—a lint check isn't the same as a compiler
warning; it emits a compiler warning if it's set to the `warn` level—
but it may be worth glossing over such distinctions in favor of simple,
familar phrasings for the sake of pedagogy; thanks to Guillaume Gomez
for the wording suggestion.

Let's also fix up the introductory clauses of the sentences about how to
fix the error to put a little more emphasis on the fact that the
`forbid` setting was probably there for a reason.

8 years agoAuto merge of #34226 - srinivasreddy:tuple_slice_cleanup, r=alexcrichton
bors [Mon, 13 Jun 2016 03:49:37 +0000 (20:49 -0700)]
Auto merge of #34226 - srinivasreddy:tuple_slice_cleanup, r=alexcrichton

Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers

8 years agoRemove stray word
petevine [Sun, 12 Jun 2016 23:05:32 +0000 (01:05 +0200)]
Remove stray word

8 years agoAdd regression test for #32364
Daan Sprenkels [Sun, 12 Jun 2016 18:59:49 +0000 (20:59 +0200)]
Add regression test for #32364

8 years agoAuto merge of #34133 - m-decoster:master, r=GuillaumeGomez
bors [Sun, 12 Jun 2016 22:35:32 +0000 (15:35 -0700)]
Auto merge of #34133 - m-decoster:master, r=GuillaumeGomez

Add explanations for E0503 and E0508.

(cannot use `..` because it was mutably borrowed, cannot move out of type `..`, a non-copy fixed-size array)

Part of #32777.

8 years agoAdd test case for issue 23477
Chris Tomlinson [Sun, 12 Jun 2016 20:45:48 +0000 (21:45 +0100)]
Add test case for issue 23477

8 years agoadd long explanation for E0453, lint attribute overruled by outer forbid
Zack M. Davis [Sun, 12 Jun 2016 19:57:05 +0000 (12:57 -0700)]
add long explanation for E0453, lint attribute overruled by outer forbid

This is a subtask of #32777.

8 years agoAuto merge of #34241 - dsprenkels:issue-32031-test, r=eddyb
bors [Sun, 12 Jun 2016 19:48:57 +0000 (12:48 -0700)]
Auto merge of #34241 - dsprenkels:issue-32031-test, r=eddyb

add a test case for issue #32031

I propose a test case to finish the fix for issue #32031. Please review this commit thoroughly, as I have never written a codegen test before.

r? @eddyb

8 years agoadd a test case for issue #32031
Daan Sprenkels [Sun, 12 Jun 2016 15:34:35 +0000 (17:34 +0200)]
add a test case for issue #32031

8 years agoAuto merge of #34045 - ollie27:rustdoc_stripped, r=brson
bors [Sun, 12 Jun 2016 13:05:55 +0000 (06:05 -0700)]
Auto merge of #34045 - ollie27:rustdoc_stripped, r=brson

rustdoc: Don't generate empty files for stripped items

We need to traverse stripped modules to generate redirect pages, but we shouldn't generate
anything else for them.

This now renders the file contents to a Vec before writing it to a file in one go. I think
that's probably a better strategy anyway.

Fixes: #34025
8 years agoAuto merge of #34161 - kennytm:fix-E0277-format, r=GuillaumeGomez
bors [Sun, 12 Jun 2016 10:11:36 +0000 (03:11 -0700)]
Auto merge of #34161 - kennytm:fix-E0277-format, r=GuillaumeGomez

Fix markdown formatting error of E0277, E0310 and E0502.

Fix bad format we see in https://doc.rust-lang.org/nightly/error-index.html#E0277.

8 years agoAdd explanation for E0503
Mathieu De Coster [Sun, 12 Jun 2016 08:32:55 +0000 (10:32 +0200)]
Add explanation for E0503

8 years agoAdd explanation for E0508
Mathieu De Coster [Sun, 12 Jun 2016 08:31:54 +0000 (10:31 +0200)]
Add explanation for E0508

8 years agoFix markdown formatting error of E0277, E0284, E0310, E0502.
kennytm [Sun, 12 Jun 2016 08:09:07 +0000 (16:09 +0800)]
Fix markdown formatting error of E0277, E0284, E0310, E0502.

8 years agoAuto merge of #34238 - jpreiss:master, r=steveklabnik
bors [Sun, 12 Jun 2016 07:05:47 +0000 (00:05 -0700)]
Auto merge of #34238 - jpreiss:master, r=steveklabnik

fix typo in primitive-types section on slices

8 years agotypo fix in loops.md
James Alan Preiss [Sun, 12 Jun 2016 03:46:23 +0000 (20:46 -0700)]
typo fix in loops.md

8 years agofix typo in primitive-types section on slices
James Alan Preiss [Sun, 12 Jun 2016 03:31:01 +0000 (20:31 -0700)]
fix typo in primitive-types section on slices

8 years agoAuto merge of #34132 - AtheMathmo:no-stdlib, r=steveklabnik
bors [Sun, 12 Jun 2016 02:57:47 +0000 (19:57 -0700)]
Auto merge of #34132 - AtheMathmo:no-stdlib, r=steveklabnik

Note warning of default features on libc

The default features of libc include libstd. This should be noted on this page.

8 years agorustdoc: Don't inline #[doc(hidden)] pub use
Oliver Middleton [Tue, 7 Jun 2016 00:20:12 +0000 (01:20 +0100)]
rustdoc: Don't inline #[doc(hidden)] pub use

Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.

8 years agoAuto merge of #34201 - sanxiyn:check-error-index, r=nagisa
bors [Sat, 11 Jun 2016 20:17:44 +0000 (13:17 -0700)]
Auto merge of #34201 - sanxiyn:check-error-index, r=nagisa

Check error index in `make check`

This was checked in rustbuild but not in `make check`, causing passed-Travis-but-failed-Buildbot.

8 years agoAdd additional test cases to test all arities of tuple; And remove type suffix -...
Srinivas Reddy Thatiparthy [Sat, 11 Jun 2016 16:58:17 +0000 (22:28 +0530)]
Add additional test cases to test all arities of tuple; And remove type suffix - i32 on integers

8 years agoAuto merge of #34153 - apasel422:btree, r=alexcrichton
bors [Sat, 11 Jun 2016 15:52:22 +0000 (08:52 -0700)]
Auto merge of #34153 - apasel422:btree, r=alexcrichton

Update tracking issue for `{BTreeMap, BTreeSet}::{append, split_off}`

r? @alexcrichton

8 years agoAuto merge of #34211 - srinivasreddy:rf_libstd_coll, r=brson
bors [Sat, 11 Jun 2016 11:23:49 +0000 (04:23 -0700)]
Auto merge of #34211 - srinivasreddy:rf_libstd_coll, r=brson

run rustfmt on libstd/collections/hash folder

8 years agoAuto merge of #34208 - shepmaster:llvm-3.7-linking-intrinsics, r=alexcrichton
bors [Sat, 11 Jun 2016 08:32:44 +0000 (01:32 -0700)]
Auto merge of #34208 - shepmaster:llvm-3.7-linking-intrinsics, r=alexcrichton

Remove linking and intrinsics code made dead by only supporting LLVM 3.7 and up

This is mostly based on Alex's throwaway comment:

> probably reject those that LLVM just doesn't support...

So I'm more than happy to adjust the PR based on how you thought this should look. Also happy to split it into two PRs, one for linking and one for intrinsics.

r? @alexcrichton

/cc @nagisa @brson

8 years agoAuto merge of #34002 - jseyfried:strip_tests_in_cfg, r=nrc
bors [Sat, 11 Jun 2016 05:41:24 +0000 (22:41 -0700)]
Auto merge of #34002 - jseyfried:strip_tests_in_cfg, r=nrc

Treat `#[test]` like `#[cfg(test)]` in non-test builds

This PR treats `#[test]` like `#[cfg(test)]` in non-test builds. In particular, like `#[cfg(test)]`,
 - `#[test]` nodes are stripped during `cfg` processing, and
 - `#[test]` is disallowed on non-optional expressions.

Closes #33946.
r? @nrc

8 years agoRefactor away the `CfgFolder` trait.
Jeffrey Seyfried [Wed, 1 Jun 2016 02:13:45 +0000 (02:13 +0000)]
Refactor away the `CfgFolder` trait.

8 years agoForbid `#[test]` attributes on non-optional expressions.
Jeffrey Seyfried [Wed, 1 Jun 2016 02:13:11 +0000 (02:13 +0000)]
Forbid `#[test]` attributes on non-optional expressions.

8 years agoStrip `#[test]` nodes during `cfg` processing on non-test builds.
Jeffrey Seyfried [Wed, 1 Jun 2016 01:27:12 +0000 (01:27 +0000)]
Strip `#[test]` nodes during `cfg` processing on non-test builds.

8 years agoAuto merge of #34174 - shepmaster:16-bit-mir, r=Aatch
bors [Sat, 11 Jun 2016 02:50:42 +0000 (19:50 -0700)]
Auto merge of #34174 - shepmaster:16-bit-mir, r=Aatch

Support 16-bit pointers in MIR

8 years agoAuto merge of #34172 - jseyfried:avoid_configuring_interpolated_ast, r=alexcrichton
bors [Fri, 10 Jun 2016 23:55:30 +0000 (16:55 -0700)]
Auto merge of #34172 - jseyfried:avoid_configuring_interpolated_ast, r=alexcrichton

Fix ICE regression caused by configuring interpolated AST

Fixes #34171.
r? @nrc

8 years agorun rustfmt on libstd/collections/hash folder
Srinivas Reddy Thatiparthy [Fri, 10 Jun 2016 23:42:14 +0000 (05:12 +0530)]
run rustfmt on libstd/collections/hash folder

8 years agoAll intrinsics are available in all supported LLVM versions
Jake Goulding [Fri, 10 Jun 2016 21:37:46 +0000 (17:37 -0400)]
All intrinsics are available in all supported LLVM versions

8 years agoRemove linking with AR
Jake Goulding [Fri, 10 Jun 2016 21:27:19 +0000 (17:27 -0400)]
Remove linking with AR

Since we only support LLVM 3.7 and above, we will never need to use the
AR linker. Remove the possibility of calling it and all the now-dead
code.

8 years agoUpdate tracking issue for `{BTreeMap, BTreeSet}::{append, split_off}`
Andrew Paseltiner [Tue, 7 Jun 2016 21:36:04 +0000 (17:36 -0400)]
Update tracking issue for `{BTreeMap, BTreeSet}::{append, split_off}`

8 years agoAuto merge of #34199 - jseyfried:visit_all_attrs, r=nrc
bors [Fri, 10 Jun 2016 17:37:35 +0000 (10:37 -0700)]
Auto merge of #34199 - jseyfried:visit_all_attrs, r=nrc

Visit statement and expression attributes in the AST visitor

Currently, these attributes are not visited, so they are not gated feature checked in the post expansion visitor. This only affects crates using `#![feature(stmt_expr_attributes)]`.
r? @nrc

8 years agoAllow truncating constants to 16-bit u/isize
Jake Goulding [Thu, 9 Jun 2016 21:01:05 +0000 (17:01 -0400)]
Allow truncating constants to 16-bit u/isize

8 years agoAuto merge of #34200 - sanxiyn:rollup, r=sanxiyn
bors [Fri, 10 Jun 2016 14:43:52 +0000 (07:43 -0700)]
Auto merge of #34200 - sanxiyn:rollup, r=sanxiyn

Rollup of 12 pull requests

- Successful merges: #34088, #34129, #34136, #34145, #34146, #34148, #34159, #34160, #34165, #34175, #34184, #34185
- Failed merges:

8 years agoCheck error index in `make check`
Seo Sanghyeon [Fri, 10 Jun 2016 13:06:40 +0000 (22:06 +0900)]
Check error index in `make check`

8 years agoRollup merge of #34185 - tshepang:shorten-paragraph, r=steveklabnik
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:46 +0000 (21:16 +0900)]
Rollup merge of #34185 - tshepang:shorten-paragraph, r=steveklabnik

doc: intro should be 1 sentence

Also, do not repeat name of type

8 years agoRollup merge of #34184 - euclio:patch-1, r=steveklabnik
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:46 +0000 (21:16 +0900)]
Rollup merge of #34184 - euclio:patch-1, r=steveklabnik

fix indentation in README

8 years agoRollup merge of #34175 - rwz:patch-2, r=alexcrichton
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:46 +0000 (21:16 +0900)]
Rollup merge of #34175 - rwz:patch-2, r=alexcrichton

Fix BTreeMap example typo

The whole example is made around movies reviews, but that one line says "review some books".

8 years agoRollup merge of #34165 - ollie27:docs_char_case, r=steveklabnik
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:46 +0000 (21:16 +0900)]
Rollup merge of #34165 - ollie27:docs_char_case, r=steveklabnik

docs: Improve char::to_{lower,upper}case examples

Collect the results to a String to make it clear that it will not always
return only one char and add examples showing that.

r? @steveklabnik

8 years agoRollup merge of #34160 - hoodie:bug/GoT_References, r=GuillaumeGomez
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:45 +0000 (21:16 +0900)]
Rollup merge of #34160 - hoodie:bug/GoT_References, r=GuillaumeGomez

Fixed two little Game Of Thrones References

Fixed: conflicting spelling of "Jon Snow"
Fixed: It's call "Night's Watch"

8 years agoRollup merge of #34159 - seventh-chord:master, r=alexcrichton
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:45 +0000 (21:16 +0900)]
Rollup merge of #34159 - seventh-chord:master, r=alexcrichton

Updated README to account for changes in MSYS2

One of the newest versions of MSYS2 now only has one .cmd file which replaces the old bat files. It has to be used to launch the mingw32/64 shell.

8 years agoRollup merge of #34148 - srinivasreddy:bitflags_rustfmt, r=nagisa
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:45 +0000 (21:16 +0900)]
Rollup merge of #34148 - srinivasreddy:bitflags_rustfmt, r=nagisa

run rustfmt on librustc_bitflags folder

8 years agoRollup merge of #34146 - srinivasreddy:libflate_rustfmt, r=nagisa
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:45 +0000 (21:16 +0900)]
Rollup merge of #34146 - srinivasreddy:libflate_rustfmt, r=nagisa

run rustfmt on libflate folder

8 years agoRollup merge of #34145 - matklad:any-docs, r=steveklabnik
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:45 +0000 (21:16 +0900)]
Rollup merge of #34145 - matklad:any-docs, r=steveklabnik

docs: simplify wording

It took me more then a moment to decipher "with no non-`'static`" thing :)

"`'static` type" should say the same thing more clearly.

r? @steveklabnik

8 years agoRollup merge of #34136 - imjacobclark:ice-test-case-25579, r=nikomatsakis
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:44 +0000 (21:16 +0900)]
Rollup merge of #34136 - imjacobclark:ice-test-case-25579, r=nikomatsakis

Test case for borrowk ICE #25579

r? @nikomatsakis

Fixes #25579

8 years agoRollup merge of #34129 - jviide:from-string-box-error, r=steveklabnik
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:44 +0000 (21:16 +0900)]
Rollup merge of #34129 - jviide:from-string-box-error, r=steveklabnik

Remove a gotcha from book/error-handling.md

The book's "Error handling with `Box<Error>`" section talks about `Box<Error>`. In the actual example `Box<Error + Send + Sync>` is used instead so that the corresponding From impls could be used to convert a plain string to an error type. Rust 1.7 added support for conversion from `&str`/`String` to
`Box<Error>`, so this gotcha and later references to it can now be removed.

r? @steveklabnik

8 years agoRollup merge of #34088 - srinivasreddy:rustfmt_map.rs, r=nrc
Seo Sanghyeon [Fri, 10 Jun 2016 12:16:44 +0000 (21:16 +0900)]
Rollup merge of #34088 - srinivasreddy:rustfmt_map.rs, r=nrc

run rustfmt on map.rs in libcollections/btree folder

8 years agoAuto merge of #34178 - shepmaster:llvm-3.7-and-up, r=alexcrichton
bors [Fri, 10 Jun 2016 11:50:46 +0000 (04:50 -0700)]
Auto merge of #34178 - shepmaster:llvm-3.7-and-up, r=alexcrichton

Reflect supporting only LLVM 3.7+ in the LLVM wrappers

Based on 12abddb06b681f5c1cb389074b5a35d3e260698f, it appears we can drop support for these older LLVM versions. Hopefully, this will make it slightly easier to support the changes needed for LLVM 3.9.

r? @nagisa

/cc @brson

8 years agoCheck that custom attributes are disallowed on statements and expressions
Jeffrey Seyfried [Fri, 10 Jun 2016 10:36:21 +0000 (10:36 +0000)]
Check that custom attributes are disallowed on statements and expressions

8 years agoVisit statement and expression attributes
Jeffrey Seyfried [Fri, 10 Jun 2016 10:31:45 +0000 (10:31 +0000)]
Visit statement and expression attributes

8 years agoAuto merge of #34086 - srinivasreddy:rustfmt_liballoc_jemalloc, r=nagisa
bors [Fri, 10 Jun 2016 07:19:09 +0000 (00:19 -0700)]
Auto merge of #34086 - srinivasreddy:rustfmt_liballoc_jemalloc, r=nagisa

run rustfmt on liballoc_jemalloc folder

8 years agoAuto merge of #34046 - Vtec234:fix-atomic-doc, r=steveklabnik
bors [Fri, 10 Jun 2016 04:29:26 +0000 (21:29 -0700)]
Auto merge of #34046 - Vtec234:fix-atomic-doc, r=steveklabnik

Fix wrong statement in compare_exchange doc

The documentation for `core::sync::atomic::AtomicSomething::compare_exchange` contains a wrong, or imprecise, statement about the return value. It goes:

The return value is a result indicating whether the new value was written and containing
the previous value. On success this value is guaranteed to be equal to `new`.

In the second sentence, `this value` is gramatically understood as referring to `return value` from the first sentence. Due to how CAS works, the returned value is always what was in the atomic variable _before_ the operation occurred, not what was written into it during the operation. Hence, the fixed doc should say:

The return value is a result indicating whether the new value was written and containing
the previous value. On success this value is guaranteed to be equal to `current`.

This version is confirmed by the runnable examples in variants of `AtomicSomething`, e.g.

    assert_eq!(some_bool.compare_exchange(true, false, Ordering::Acquire, Ordering::Relaxed),
    Ok(true));

where the returned value is `Ok(current)`. This PR fixes all occurrences of this bug I could find.

An alternative solution would be to modify the second sentence so that it refers to the value _written_ into the Atomic rather than what was there before, in which case it would be correct. Example alternative formulation:

On success the value written into the `bool`/`usize`/`whatever` is guaranteed to be equal to `new`.

r? @steveklabnik

8 years agoAuto merge of #34173 - srinivasreddy:rm_redundant, r=alexcrichton
bors [Fri, 10 Jun 2016 01:38:46 +0000 (18:38 -0700)]
Auto merge of #34173 - srinivasreddy:rm_redundant, r=alexcrichton

remove redundant  assert statements

8 years agoAuto merge of #34095 - petrochenkov:pathir2, r=jseyfried
bors [Thu, 9 Jun 2016 22:48:37 +0000 (15:48 -0700)]
Auto merge of #34095 - petrochenkov:pathir2, r=jseyfried

Improvements to pattern resolution + some refactoring

Continuation of https://github.com/rust-lang/rust/pull/33929
First commit is a careful rewrite of `resolve_pattern`, pattern path resolution and new binding creation logic is factored out in separate functions, some minor bugs are fixed. Also, `resolve_possibly_assoc_item` doesn't swallow modules now.
Later commits are refactorings, see the comment descriptions.

I intend to continue this work later with better support for `Def::Err` in patterns in post-resolve stages and cleanup of pattern resolution code in type checker.

Fixes https://github.com/rust-lang/rust/issues/32086
Fixes https://github.com/rust-lang/rust/issues/34047 ([breaking-change])
Fixes https://github.com/rust-lang/rust/issues/34074

cc @jseyfried
r? @eddyb

8 years agoAddress review comments + fix rebase
Vadim Petrochenkov [Fri, 3 Jun 2016 20:15:00 +0000 (23:15 +0300)]
Address review comments + fix rebase

8 years agomake all pattern bindings with the same name resolve to the first one
Ariel Ben-Yehuda [Tue, 17 May 2016 13:45:02 +0000 (16:45 +0300)]
make all pattern bindings with the same name resolve to the first one

This simplifies the code considerably, removing one of the
last uses of hygienic matching out of resolution.

8 years agoAdd tests
Vadim Petrochenkov [Fri, 3 Jun 2016 20:15:00 +0000 (23:15 +0300)]
Add tests

8 years agoIntroduce TyCtxt::expect_def/expect_resolution helpers and use them where possible
Vadim Petrochenkov [Fri, 3 Jun 2016 20:15:00 +0000 (23:15 +0300)]
Introduce TyCtxt::expect_def/expect_resolution helpers and use them where possible

8 years agoMove the hack with fake partial resolution for <A>::B from typeck to resolve
Vadim Petrochenkov [Fri, 3 Jun 2016 20:15:00 +0000 (23:15 +0300)]
Move the hack with fake partial resolution for <A>::B from typeck to resolve

8 years agoresolve: Rewrite resolve_pattern
Vadim Petrochenkov [Fri, 3 Jun 2016 20:15:00 +0000 (23:15 +0300)]
resolve: Rewrite resolve_pattern

8 years agodoc: intro should be 1 sentence
Tshepang Lekhonkhobe [Thu, 9 Jun 2016 21:23:08 +0000 (23:23 +0200)]
doc: intro should be 1 sentence

Also, do not repeat name of type

8 years agoSupport getting the minimum 16-bit isize value
Jake Goulding [Thu, 9 Jun 2016 00:19:41 +0000 (20:19 -0400)]
Support getting the minimum 16-bit isize value

8 years agofix indentation in README
Andy Russell [Thu, 9 Jun 2016 19:05:46 +0000 (15:05 -0400)]
fix indentation in README

8 years agoRemove unneeded indirection of GET_ARCHIVE
Jake Goulding [Thu, 9 Jun 2016 13:57:22 +0000 (09:57 -0400)]
Remove unneeded indirection of GET_ARCHIVE

8 years agoReflect supporting only LLVM 3.7+ in the LLVM wrappers
Jake Goulding [Thu, 9 Jun 2016 13:41:17 +0000 (09:41 -0400)]
Reflect supporting only LLVM 3.7+ in the LLVM wrappers

8 years agoAuto merge of #34149 - arielb1:remove-remove-dead-blocks, r=nikomatsakis
bors [Thu, 9 Jun 2016 19:07:38 +0000 (12:07 -0700)]
Auto merge of #34149 - arielb1:remove-remove-dead-blocks, r=nikomatsakis

MIR cleanups and predecessor cache

This PR cleans up a few things in MIR and adds a predecessor cache to allow graph algorithms to be run easily.

r? @nikomatsakis

8 years agofix issues
Ariel Ben-Yehuda [Thu, 9 Jun 2016 14:23:23 +0000 (17:23 +0300)]
fix issues

8 years agoAuto merge of #33895 - AndrewBrinker:master, r=steveklabnik
bors [Thu, 9 Jun 2016 14:13:34 +0000 (07:13 -0700)]
Auto merge of #33895 - AndrewBrinker:master, r=steveklabnik

Rewrote "How Safe and Unsafe Interact" Nomicon chapter.

The previous version of the chapter covered a lot of ground, but was a little meandering and hard to follow at times. This draft is intended to be clearer and more direct, while still providing the same information as the previous version.

r? @steveklabnik

8 years agouse the type name as the pass name
Ariel Ben-Yehuda [Wed, 8 Jun 2016 21:16:35 +0000 (00:16 +0300)]
use the type name as the pass name

8 years agorefactor simplify_cfg and split off simplify_branches
Ariel Ben-Yehuda [Wed, 8 Jun 2016 21:10:15 +0000 (00:10 +0300)]
refactor simplify_cfg and split off simplify_branches

8 years agoadd hook infrastructure for automatically dumping MIR on every pass
Ariel Ben-Yehuda [Wed, 8 Jun 2016 18:03:06 +0000 (21:03 +0300)]
add hook infrastructure for automatically dumping MIR on every pass

8 years agointroduce an `unreachable` terminator
Ariel Ben-Yehuda [Wed, 8 Jun 2016 16:26:19 +0000 (19:26 +0300)]
introduce an `unreachable` terminator

Use it instead of a `panic` for inexhaustive matches and correct the
comment. I think we trust our match-generation algorithm enough to
generate these blocks, and not generating an `unreachable` means that
LLVM won't optimize `match void() {}` to an `unreachable`.

8 years agoadd a cache for MIR predecessors
Ariel Ben-Yehuda [Tue, 7 Jun 2016 19:02:08 +0000 (22:02 +0300)]
add a cache for MIR predecessors

8 years agomake the basic_blocks field private
Ariel Ben-Yehuda [Tue, 7 Jun 2016 18:20:50 +0000 (21:20 +0300)]
make the basic_blocks field private

8 years agointroduce the type-safe IdxVec and use it instead of loose indexes
Ariel Ben-Yehuda [Tue, 7 Jun 2016 14:28:36 +0000 (17:28 +0300)]
introduce the type-safe IdxVec and use it instead of loose indexes

8 years agoAuto merge of #34109 - pnkfelix:fix-issue-34101, r=arielb1
bors [Thu, 9 Jun 2016 11:24:50 +0000 (04:24 -0700)]
Auto merge of #34109 - pnkfelix:fix-issue-34101, r=arielb1

Fix issue #34101

Fix issue #34101: do not track subcontent of type with dtor nor gather flags for untracked content.

(Includes a regression test, which needed to go into `compile-fail/`
due to weaknesses when combining `#[deny(warnings)]` with
`tcx.sess.span_warn(..)`)

8 years agomerge the RemoveDeadBlocks pass into the SimplifyCfg pass
Ariel Ben-Yehuda [Mon, 6 Jun 2016 19:58:28 +0000 (22:58 +0300)]
merge the RemoveDeadBlocks pass into the SimplifyCfg pass

8 years agoAuto merge of #34108 - jseyfried:refactor_prelude_injection, r=nrc
bors [Thu, 9 Jun 2016 08:35:26 +0000 (01:35 -0700)]
Auto merge of #34108 - jseyfried:refactor_prelude_injection, r=nrc

Refactor away the prelude injection fold

Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`.

r? @nrc

8 years agoAuto merge of #34032 - jseyfried:load_macros_in_expansion, r=nrc
bors [Thu, 9 Jun 2016 05:45:35 +0000 (22:45 -0700)]
Auto merge of #34032 - jseyfried:load_macros_in_expansion, r=nrc

Support `#[macro_use]` on macro-expanded crates

This PR loads macros from `#[macro_use]` crates during expansion so that
 - macro-expanded `#[macro_use]` crates work (fixes #33936, fixes #28071), and
 - macros imported from crates have the same scope as macros imported from modules.

This is a [breaking-change]. For example, this will break:
```rust
macro_rules! m {
    () => { #[macro_use(foo)] extern crate core; } //~ ERROR imported macro not found
}
m!();
```
Also, this will break:
```rust
macro_rules! try { () => {} }
// #[macro_use] mod bar { macro_rules! try { ... } } //< ... just like this would ...
fn main() { try!(); } //< ... making this an error
```

r? @nrc

8 years agoFix BTreeMap example typo
Pavel Pravosud [Thu, 9 Jun 2016 03:32:24 +0000 (20:32 -0700)]
Fix BTreeMap example typo

The whole example is made around movies reviews, but that one line says "review some books".

8 years agoclean up for test cases
Srinivas Reddy Thatiparthy [Thu, 9 Jun 2016 02:50:08 +0000 (08:20 +0530)]
clean up for test cases

8 years agoremove redundant assert statements
Srinivas Reddy Thatiparthy [Thu, 9 Jun 2016 02:42:31 +0000 (08:12 +0530)]
remove redundant  assert statements