]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agomoving nodejs detection logic to configure and adding
Jake Goldsborough [Wed, 7 Sep 2016 20:13:37 +0000 (13:13 -0700)]
moving nodejs detection logic to configure and adding
a nodejs cmd sanity check

7 years agoAdd a test for CString drop
Aleksey Kladov [Wed, 7 Sep 2016 07:13:49 +0000 (10:13 +0300)]
Add a test for CString drop

7 years agoAuto merge of #36266 - Sawyer47:issue-35169, r=alexcrichton
bors [Wed, 7 Sep 2016 19:30:03 +0000 (12:30 -0700)]
Auto merge of #36266 - Sawyer47:issue-35169, r=alexcrichton

rustdoc: Filter more incorrect methods inherited through Deref

Old code filtered out only static methods. This code also excludes &mut self methods if there is no DerefMut implementation.

Fixes #35169

7 years agoZero first byte of CString on drop
Aleksey Kladov [Sun, 4 Sep 2016 15:37:30 +0000 (18:37 +0300)]
Zero first byte of CString on drop

This should prevent code like

```
let ptr = CString::new("hello").unwrap().as_ptr();
```

from working by accident.

7 years agoUse layout_of to detect C enums
Ulrich Weigand [Wed, 7 Sep 2016 19:03:21 +0000 (21:03 +0200)]
Use layout_of to detect C enums

7 years agosave-analysis: strip /// or whatever from doc comments
Nick Cameron [Wed, 7 Sep 2016 16:27:56 +0000 (09:27 -0700)]
save-analysis: strip /// or whatever from doc comments

7 years agosave-analysis: only emit type in the value for variables
Nick Cameron [Wed, 7 Sep 2016 15:31:11 +0000 (08:31 -0700)]
save-analysis: only emit type in the value for variables

7 years agosave-analysis: tweak the type value for functions
Nick Cameron [Wed, 7 Sep 2016 00:37:16 +0000 (12:37 +1200)]
save-analysis: tweak the type value for functions

7 years agoAuto merge of #36304 - TimNN:fix-36299, r=eddyb
bors [Wed, 7 Sep 2016 16:15:30 +0000 (09:15 -0700)]
Auto merge of #36304 - TimNN:fix-36299, r=eddyb

re-add accidentally removed line in wfcheck

Fixes #36299, introduced in #36119.

r? @eddyb

7 years agoFix argument to FIONBIO ioctl
Ulrich Weigand [Wed, 7 Sep 2016 15:21:10 +0000 (17:21 +0200)]
Fix argument to FIONBIO ioctl

The FIONBIO ioctl takes as argument a pointer to an integer, which
should be either 0 or 1 to indicate whether nonblocking mode is to
be switched off or on.  The type of the pointed-to variable is "int".

However, the set_nonblocking routine in libstd/sys/unix/net.rs passes
a pointer to a libc::c_ulong variable.  This doesn't matter on all
32-bit platforms and on all litte-endian platforms, but it will
break on big-endian 64-bit platforms.

Found while porting Rust to s390x (a big-endian 64-bit platform).

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
7 years agoFollow target ABI sign-/zero-extension rules for enum types
Ulrich Weigand [Wed, 7 Sep 2016 15:09:24 +0000 (17:09 +0200)]
Follow target ABI sign-/zero-extension rules for enum types

While attempting to port Rust to s390x, I ran into an ABI violation
(that caused rust_eh_personality to be miscompiled, breaking unwinding).
The problem is that this function returns an enum type, which is
supposed to be sign-extended according to the s390x ABI.  However,
common code would ignore target sign-/zero-extension rules for any
types that do not satisfy is_integral(), which includes enums.

For the general case of Rust enum types, which map to structure types
with a discriminant, that seems correct.  However, in the special case
of simple enums that map directly to C enum types (i.e. LLVM integers),
this is incorrect; we must follow the target extension rules for those.

Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
7 years agoAdd doc example for `std::time::Instant::elapsed`.
Corey Farwell [Wed, 7 Sep 2016 01:10:15 +0000 (21:10 -0400)]
Add doc example for `std::time::Instant::elapsed`.

7 years agoAuto merge of #36289 - euclio:self-suggestion, r=jseyfried
bors [Wed, 7 Sep 2016 12:59:50 +0000 (05:59 -0700)]
Auto merge of #36289 - euclio:self-suggestion, r=jseyfried

resolve: Suggest `use self` when import resolves

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.

Fixes #34191.

Thank you for the help @jseyfried!

7 years agoAuto merge of #36296 - nagisa:pass-timing, r=eddyb
bors [Wed, 7 Sep 2016 09:47:35 +0000 (02:47 -0700)]
Auto merge of #36296 - nagisa:pass-timing, r=eddyb

Count and report time taken by MIR passes

There’s some desire for deeper introspectability into what MIR passes cost us.

-Z time-passes after this PR:

```
   Compiling test_shim v0.1.0 (file:///home/nagisa/Documents/rust/rust/src/rustc/test_shim)
time: 0.000; rss: 29MB parsing
time: 0.000; rss: 29MB configuration
time: 0.000; rss: 29MB recursion limit
time: 0.000; rss: 29MB crate injection
time: 0.000; rss: 29MB plugin loading
time: 0.000; rss: 29MB plugin registration
time: 0.032; rss: 54MB expansion
time: 0.000; rss: 54MB maybe building test harness
time: 0.000; rss: 54MB assigning node ids
time: 0.000; rss: 54MB checking for inline asm in case the target doesn't support it
time: 0.000; rss: 54MB complete gated feature checking
time: 0.000; rss: 54MB collecting defs
time: 0.004; rss: 54MB external crate/lib resolution
time: 0.000; rss: 54MB early lint checks
time: 0.000; rss: 54MB AST validation
time: 0.001; rss: 54MB name resolution
time: 0.000; rss: 54MB lowering ast -> hir
time: 0.000; rss: 56MB indexing hir
time: 0.000; rss: 56MB attribute checking
time: 0.000; rss: 56MB language item collection
time: 0.000; rss: 56MB lifetime resolution
time: 0.000; rss: 56MB looking for entry point
time: 0.000; rss: 56MB looking for plugin registrar
time: 0.000; rss: 56MB region resolution
time: 0.000; rss: 56MB loop checking
time: 0.000; rss: 56MB static item recursion checking
time: 0.000; rss: 56MB compute_incremental_hashes_map
time: 0.000; rss: 56MB load_dep_graph
time: 0.000; rss: 56MB type collecting
time: 0.000; rss: 56MB variance inference
time: 0.011; rss: 59MB coherence checking
time: 0.000; rss: 59MB wf checking
time: 0.000; rss: 59MB item-types checking
time: 0.000; rss: 59MB item-bodies checking
time: 0.000; rss: 59MB drop-impl checking
time: 0.000; rss: 59MB const checking
time: 0.000; rss: 59MB privacy checking
time: 0.000; rss: 59MB stability index
time: 0.000; rss: 59MB intrinsic checking
time: 0.000; rss: 59MB effect checking
time: 0.000; rss: 59MB match checking
time: 0.000; rss: 59MB liveness checking
time: 0.000; rss: 59MB rvalue checking
time: 0.000; rss: 59MB MIR dump
  time: 0.000; rss: 59MB SimplifyCfg
  time: 0.000; rss: 59MB QualifyAndPromoteConstants
  time: 0.000; rss: 59MB TypeckMir
  time: 0.000; rss: 59MB SimplifyBranches
  time: 0.000; rss: 59MB SimplifyCfg
time: 0.000; rss: 59MB MIR passes
time: 0.000; rss: 59MB borrow checking
time: 0.000; rss: 59MB reachability checking
time: 0.000; rss: 59MB death checking
time: 0.000; rss: 59MB stability checking
time: 0.000; rss: 59MB unused lib feature checking
time: 0.000; rss: 59MB lint checking
time: 0.000; rss: 59MB resolving dependency formats
  time: 0.000; rss: 59MB NoLandingPads
  time: 0.000; rss: 59MB SimplifyCfg
  time: 0.000; rss: 59MB EraseRegions
  time: 0.000; rss: 59MB AddCallGuards
  time: 0.000; rss: 59MB ElaborateDrops
  time: 0.000; rss: 59MB NoLandingPads
  time: 0.000; rss: 59MB SimplifyCfg
  time: 0.000; rss: 59MB Deaggregator
  time: 0.000; rss: 59MB AddCallGuards
  time: 0.000; rss: 59MB PreTrans
time: 0.000; rss: 59MB Prepare MIR codegen passes
  time: 0.000; rss: 59MB write metadata
  time: 0.000; rss: 61MB translation item collection
  time: 0.000; rss: 61MB codegen unit partitioning
  time: 0.000; rss: 61MB internalize symbols
time: 0.007; rss: 61MB translation
time: 0.000; rss: 61MB assert dep graph
time: 0.000; rss: 61MB serialize dep graph
time: 0.000; rss: 61MB llvm function passes [2]
time: 0.000; rss: 61MB llvm function passes [3]
time: 0.000; rss: 61MB llvm function passes [1]
time: 0.000; rss: 61MB llvm function passes [0]
time: 0.000; rss: 61MB llvm module passes [2]
time: 0.000; rss: 61MB llvm module passes [1]
time: 0.000; rss: 61MB llvm module passes [0]
time: 0.000; rss: 61MB llvm module passes [3]
time: 0.001; rss: 62MB codegen passes [1]
time: 0.001; rss: 62MB codegen passes [2]
time: 0.001; rss: 62MB codegen passes [0]
time: 0.001; rss: 62MB codegen passes [3]
time: 0.001; rss: 63MB codegen passes [1]
time: 0.005; rss: 63MB LLVM passes
time: 0.000; rss: 63MB serialize work products
time: 0.001; rss: 63MB linking
```

r? @eddyb or @nikomatsakis

cc @nrc, @Mark-Simulacrum

7 years agoAdd regression test.
Jeffrey Seyfried [Wed, 7 Sep 2016 03:09:09 +0000 (03:09 +0000)]
Add regression test.

7 years agoAvoid instaiblity errors in code generated by `syntax_ext::deriving::call_intrinsic()`.
Jeffrey Seyfried [Tue, 6 Sep 2016 09:47:35 +0000 (09:47 +0000)]
Avoid instaiblity errors in code generated by `syntax_ext::deriving::call_intrinsic()`.

7 years agoAuto merge of #36252 - joshtriplett:union-field-never-used, r=sanxiyn
bors [Wed, 7 Sep 2016 03:06:34 +0000 (20:06 -0700)]
Auto merge of #36252 - joshtriplett:union-field-never-used, r=sanxiyn

Fix "field is never used" warning to take unions into account

When compiling code containing a union with an unused field, rustc says
"struct field is never used".

Rather than saying "struct or union", or adding logic to determine the
type of the item, just change the message to "field is never used",
dropping the "struct".

Update tests accordingly.

7 years agoadd utility musl_root method, update config.toml.example
Jorge Aparicio [Wed, 7 Sep 2016 02:49:02 +0000 (21:49 -0500)]
add utility musl_root method, update config.toml.example

7 years agodoc: we got coercion going on here, so no need to be this explicit
Tshepang Lekhonkhobe [Wed, 7 Sep 2016 02:15:56 +0000 (04:15 +0200)]
doc: we got coercion going on here, so no need to be this explicit

7 years agodetecting nodejs in configure
Jake Goldsborough [Wed, 7 Sep 2016 01:31:00 +0000 (18:31 -0700)]
detecting nodejs in configure

7 years agoremove the extraneous not_equal implementation for slices.
Justin LeFebvre [Tue, 6 Sep 2016 05:04:07 +0000 (01:04 -0400)]
remove the extraneous not_equal implementation for slices.

7 years agoAuto merge of #36303 - jonathandturner:rollup, r=jonathandturner
bors [Tue, 6 Sep 2016 23:45:41 +0000 (16:45 -0700)]
Auto merge of #36303 - jonathandturner:rollup, r=jonathandturner

Rollup of 8 pull requests

- Successful merges: #36121, #36128, #36241, #36243, #36263, #36267, #36273, #36298
- Failed merges:

7 years agosave-analysis: add a `kind` tag to JSON dumps
Nick Cameron [Tue, 6 Sep 2016 23:28:13 +0000 (11:28 +1200)]
save-analysis: add a `kind` tag to JSON dumps

7 years agosave-analysis: add docs data
Nick Cameron [Tue, 6 Sep 2016 23:23:49 +0000 (11:23 +1200)]
save-analysis: add docs data

7 years agoPoint macros 1.1 errors to the input item
David Tolnay [Fri, 2 Sep 2016 19:01:03 +0000 (12:01 -0700)]
Point macros 1.1 errors to the input item

Before:

```rust
error[E0106]: missing lifetime specifier
  --> src/main.rs:10:10
   |
10 | #[derive(Serialize, Deserialize)]
   |          ^ expected lifetime parameter

error[E0038]: the trait `T` cannot be made into an object
  --> src/main.rs:15:15
   |
15 | #[derive(Serialize, Deserialize)]
   |          ^^^^^^^^^^ the trait `T` cannot be made into an object
```

After:

```rust
error[E0106]: missing lifetime specifier
  --> src/main.rs:11:1
   |
11 | struct A {
   | ^ expected lifetime parameter

error[E0038]: the trait `T` cannot be made into an object
  --> src/main.rs:16:1
   |
16 | struct B<'a> {
   | ^ the trait `T` cannot be made into an object
```

7 years agoAuto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakis
bors [Tue, 6 Sep 2016 20:22:35 +0000 (13:22 -0700)]
Auto merge of #36025 - michaelwoerister:incr-comp-hash-spans, r=nikomatsakis

incr. comp.: Take spans into account for ICH

This PR makes the ICH (incr. comp. hash) take spans into account when debuginfo is enabled.

A side-effect of this is that the SVH (which is based on the ICHs of all items in the crate) becomes sensitive to the tiniest change in a code base if debuginfo is enabled. Since we are not trying to model ABI compatibility via the SVH anymore (this is done via the crate disambiguator now), this should be not be a problem.

Fixes #33888.
Fixes #32753.

7 years agore-add accidentally removed line
Tim Neumann [Tue, 6 Sep 2016 16:53:43 +0000 (18:53 +0200)]
re-add accidentally removed line

7 years agoRollup merge of #36298 - GuillaumeGomez:hashmap_doc, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:04 +0000 (09:38 -0700)]
Rollup merge of #36298 - GuillaumeGomez:hashmap_doc, r=steveklabnik

Add missing urls

r? @steveklabnik

7 years agoRollup merge of #36273 - apasel422:unsafe_no_drop_flag, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:03 +0000 (09:38 -0700)]
Rollup merge of #36273 - apasel422:unsafe_no_drop_flag, r=steveklabnik

Remove mention of `unsafe_no_drop_flag` from Reference and Nomicon

7 years agoRollup merge of #36267 - Cobrand:E0559, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:03 +0000 (09:38 -0700)]
Rollup merge of #36267 - Cobrand:E0559, r=jonathandturner

Updated E0559 to new format

Refactored a method that printed one suggested field name,
into a method that returns an `Option` of a suggestion

(Updated test cases accordingly)

r? @jonathandturner

Closes #36197

7 years agoRollup merge of #36263 - apasel422:scoped, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36263 - apasel422:scoped, r=steveklabnik

Clean up thread-local storage docs

`std` no longer contains an implementation of scoped TLS.

r? @steveklabnik

7 years agoRollup merge of #36243 - GuillaumeGomez:hash_map_links, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36243 - GuillaumeGomez:hash_map_links, r=steveklabnik

Add missing urls

r? @steveklabnik

7 years agoRollup merge of #36241 - Cobrand:contributing-md, r=steveklabnik
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36241 - Cobrand:contributing-md, r=steveklabnik

doc: Contributing.md: Added mention of `make tidy`

r? @steveklabnik

7 years agoRollup merge of #36128 - gavinb:error_msgs_p2, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:02 +0000 (09:38 -0700)]
Rollup merge of #36128 - gavinb:error_msgs_p2, r=jonathandturner

Update Error format for E0516, E0517, E0518

- E0518 Update error format #36111
- E0517 Update error format #36109
- E0516 Update error format #36108
- Part of #35233

r? @jonathandturner

7 years agoRollup merge of #36121 - Cobrand:master, r=jonathandturner
Jonathan Turner [Tue, 6 Sep 2016 16:38:01 +0000 (09:38 -0700)]
Rollup merge of #36121 - Cobrand:master, r=jonathandturner

Updated E0527 to new error format

* Closes #36113

7 years agoICH: Make CachingCodemapView robustly handle invalid spans.
Michael Woerister [Tue, 6 Sep 2016 16:14:43 +0000 (12:14 -0400)]
ICH: Make CachingCodemapView robustly handle invalid spans.

7 years agopacify the mercilous tidy
Niko Matsakis [Sun, 4 Sep 2016 10:48:17 +0000 (06:48 -0400)]
pacify the mercilous tidy

add licenses to shadow.rs

7 years agoalways print def-path in Debug impl for DefId
Niko Matsakis [Fri, 2 Sep 2016 22:38:54 +0000 (18:38 -0400)]
always print def-path in Debug impl for DefId

I also added an `opt_def_path` so that we can deal with DefIds that are
missing a `DefPath` entry.

7 years agokill extra `use`
Niko Matsakis [Fri, 2 Sep 2016 18:26:16 +0000 (14:26 -0400)]
kill extra `use`

7 years agokill the forbidden code
Niko Matsakis [Fri, 2 Sep 2016 15:55:32 +0000 (11:55 -0400)]
kill the forbidden code

supplanted by RUST_FORBID_DEP_GRAPH_EDGE

7 years agoexpanding a def-id is not a read
Niko Matsakis [Fri, 2 Sep 2016 12:26:36 +0000 (08:26 -0400)]
expanding a def-id is not a read

Across crates only, converting a def-id into its def-key or def-path was
considered a read. This caused spurious reads when computing the symbol
name for some item.

7 years agoimplement a debugging "shadow graph"
Niko Matsakis [Fri, 2 Sep 2016 11:50:18 +0000 (07:50 -0400)]
implement a debugging "shadow graph"

The shadow graph supercedes the existing code that checked for
reads/writes without an active task and now adds the ability
to filter for specific edges.

7 years agoremove the "misc-items" from meta-data
Niko Matsakis [Wed, 24 Aug 2016 15:01:12 +0000 (11:01 -0400)]
remove the "misc-items" from meta-data

It was duplicating information available elsewhere.

7 years agoallow testing DepNode::Krate edges directly
Niko Matsakis [Wed, 24 Aug 2016 15:00:55 +0000 (11:00 -0400)]
allow testing DepNode::Krate edges directly

7 years agoadd a debugging mechanism to forbid edges
Niko Matsakis [Wed, 24 Aug 2016 11:36:54 +0000 (07:36 -0400)]
add a debugging mechanism to forbid edges

It is useful to track down an errant edge that is being added.  This is
not a perfect mechanism, since it doesn't consider (e.g.) if we are
in an ignored task, but it's helpful enough for now.

7 years agoignore dep-graph when loading inlined HIR
Niko Matsakis [Wed, 24 Aug 2016 11:35:49 +0000 (07:35 -0400)]
ignore dep-graph when loading inlined HIR

We touch the krate to adjust the maps, but we don't expose that data
widely.

7 years agowrite to inherent_impls during the visitor
Niko Matsakis [Wed, 24 Aug 2016 10:49:44 +0000 (06:49 -0400)]
write to inherent_impls during the visitor

The goal here is to avoid writing to the `inherent_impls` map from
within the general `Coherence` task, and instead write to it as we
visit. Writing to it from the Coherence task is actually an information
leak; it happened to be safe because Coherence read from
`DepNode::Krate`, but that was very coarse.

I removed the `Rc` here because, upon manual inspection, nobody clones
the data in this table, and it meant that we can accumulate the data in
place. That said, the pattern that is used for the inherent impls map
is *generally* an anti-pattern (that is, holding the borrow lock for the
duration of using the contents), so it'd probably be better to
clone (and I doubt that would be expensive -- how many inherent impls
does a typical type have?).

7 years agoAuto merge of #36288 - nrc:save-var-value, r=eddyb
bors [Tue, 6 Sep 2016 14:46:06 +0000 (07:46 -0700)]
Auto merge of #36288 - nrc:save-var-value, r=eddyb

save-analysis: some refinement to the value string for variables

7 years agoadding a check to sanity to look for the nodejs command
Jake Goldsborough [Tue, 6 Sep 2016 14:41:20 +0000 (07:41 -0700)]
adding a check to sanity to look for the nodejs command

7 years agoAdd missing urls
ggomez [Tue, 6 Sep 2016 14:31:18 +0000 (16:31 +0200)]
Add missing urls

7 years agoCount and report time taken by MIR passes
Simonas Kazlauskas [Sun, 7 Aug 2016 22:04:51 +0000 (01:04 +0300)]
Count and report time taken by MIR passes

7 years agoAuto merge of #36276 - jseyfried:fix_unused, r=nrc
bors [Tue, 6 Sep 2016 08:44:13 +0000 (01:44 -0700)]
Auto merge of #36276 - jseyfried:fix_unused, r=nrc

resolve: Fix unused import false positive with `item_like_imports`

Fixes #36249.
r? @nrc

7 years agorustbuild: per target musl-root
Jorge Aparicio [Tue, 6 Sep 2016 06:04:41 +0000 (01:04 -0500)]
rustbuild: per target musl-root

config.toml now accepts a target.$TARGET.musl-root key that lets you
override the "build" musl-root value, which is set via the --musl-root
flag or via the build.musl-root key.

With this change, it's now possible to compile std for several musl
targets at once. Here's are the sample commands to do such thing:

```
$ configure \
    --enable-rustbuild \
    --target=x86_64-unknown-linux-musl,arm-unknown-linux-musleabi \
    --musl-root=/musl/x86_64-unknown-linux-musl/

$ edit config.toml && tail config.toml
[target.arm-unknown-linux-musleabi]
musl-root = "/x-tools/arm-unknown-linux-musleabi/arm-unknown-linux-musleabi/sysroot/usr"

$ make
```

7 years agoAuto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton
bors [Tue, 6 Sep 2016 05:32:36 +0000 (22:32 -0700)]
Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichton

rustdoc: Fix associated consts in search results

Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.

Fixes #36031

7 years agoAdd struct `AmbiguityError`.
Jeffrey Seyfried [Tue, 6 Sep 2016 03:47:11 +0000 (03:47 +0000)]
Add struct `AmbiguityError`.

7 years agoAdd field `used: Cell<bool>` to variant `NameBindingKind::Import`.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:27:58 +0000 (05:27 +0000)]
Add field `used: Cell<bool>` to variant `NameBindingKind::Import`.

7 years agoAdd regression test.
Jeffrey Seyfried [Mon, 5 Sep 2016 05:10:50 +0000 (05:10 +0000)]
Add regression test.

7 years agoAvoid false positive unused import warnings.
Jeffrey Seyfried [Mon, 5 Sep 2016 04:55:12 +0000 (04:55 +0000)]
Avoid false positive unused import warnings.

7 years agoshow `self` suggestion when items are in the block
Andy Russell [Tue, 6 Sep 2016 03:08:21 +0000 (23:08 -0400)]
show `self` suggestion when items are in the block

7 years agoresolve: Suggest `use self` when import resolves
Andy Russell [Tue, 6 Sep 2016 01:48:02 +0000 (21:48 -0400)]
resolve: Suggest `use self` when import resolves

Improves errors messages by replacing "Maybe a missing `extern crate`" messages
with "Did you mean `self::...`" when the `self` import would succeed.

7 years agosave-analysis: some refinement to the value string for variables
Nick Cameron [Tue, 6 Sep 2016 00:44:26 +0000 (12:44 +1200)]
save-analysis: some refinement to the value string for variables

7 years agoAuto merge of #36274 - Manishearth:rollup, r=Manishearth
bors [Tue, 6 Sep 2016 00:55:45 +0000 (17:55 -0700)]
Auto merge of #36274 - Manishearth:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #35845, #35983, #36065, #36102, #36242, #36245
- Failed merges:

7 years agoAuto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
bors [Mon, 5 Sep 2016 21:41:16 +0000 (14:41 -0700)]
Auto merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb
bors [Mon, 5 Sep 2016 18:28:36 +0000 (11:28 -0700)]
Auto merge of #36281 - pnkfelix:fix-issue-36036, r=eddyb

Fix issue #36036.

Fix #36036.

We were treating an associated type as unsized even when the concrete instantiation was actually sized. Fix is to normalize before checking if it is sized.

7 years agorustdoc: Filter more incorrect methods inherited through Deref
Piotr Jawniak [Sun, 4 Sep 2016 16:35:35 +0000 (18:35 +0200)]
rustdoc: Filter more incorrect methods inherited through Deref

Old code filtered out only static methods. This code also excludes
&mut self methods if there is no DerefMut implementation

7 years agoUpdated E0527 to new error format
Cobrand [Mon, 29 Aug 2016 22:33:29 +0000 (00:33 +0200)]
Updated E0527 to new error format

* Closes #36113

7 years agoAdd test for unused field in union
Josh Triplett [Mon, 5 Sep 2016 17:19:00 +0000 (10:19 -0700)]
Add test for unused field in union

7 years agoAuto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1
bors [Mon, 5 Sep 2016 15:13:32 +0000 (08:13 -0700)]
Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1

Fix incorrect LLVM Linkage enum

Followup of #33994 to actually work.

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the `#[linkage=""]` attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Possible remaining concerns:

1. There could be a codegen test to make sure that the attributes are applied correctly (I don't know how to do this).
2. ~~The test does not exercise the `appending` linkage. I can't figure out how to make a global static raw pointer to an array. This might not even be possible? If not we should probably remove appending linkage as its unusable in rust.~~ Appending linkage is not 'emittable' anyway.
3. The test only runs on Linux.

Fixes #33992

r? @alexcrichton

7 years agoE0518 Update error format #36111
Gavin Baker [Tue, 30 Aug 2016 01:44:25 +0000 (11:44 +1000)]
E0518 Update error format #36111

- Fixes #36111
- Part of #35233

7 years agoE0517 Update error format #36109
Gavin Baker [Tue, 30 Aug 2016 01:30:46 +0000 (11:30 +1000)]
E0517 Update error format #36109

- Fixes #36109
- Part of #35233

7 years agoE0516 Update error format #36108
Gavin Baker [Tue, 30 Aug 2016 01:04:55 +0000 (11:04 +1000)]
E0516 Update error format #36108
- fixes #36108
- part of #35233

7 years agoAuto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb
bors [Mon, 5 Sep 2016 11:29:47 +0000 (04:29 -0700)]
Auto merge of #35787 - canndrew:bang_type_refactor_check, r=eddyb

Typecheck refactor for `!`

Ping @nikomatsakis @eddyb. This is the PR for the typeck refactor for `!`. Is this what you guys had in mind? Is there anything else that needs doing on it?

7 years agoFix issue #36036.
Felix S. Klock II [Mon, 5 Sep 2016 10:56:29 +0000 (12:56 +0200)]
Fix issue #36036.

We were treating an associated type as unsized even when the concrete
instantiation was actually sized. Fix is to normalize before checking
if it is sized.

7 years agoRollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36245 - alexcrichton:add-back-accident, r=arielb1

Add back feature accidentally removed

This feature was accidentally removed in
https://github.com/rust-lang/rust/pull/35957.

7 years agoRollup merge of #36242 - semarie:local-rebuild, r=alexcrichton
Manish Goregaokar [Mon, 5 Sep 2016 03:02:04 +0000 (11:02 +0800)]
Rollup merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoRollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #36065 - acrrd:new_format_E0496, r=GuillaumeGomez

Update E0496 to new format

Fixes #36000.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35983 - GuillaumeGomez:e0060_bonus, r=jonathandturner

E0060 and E0061 improvement

Fixes #35290.

r? @jonathandturner

7 years agoRollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez
Manish Goregaokar [Mon, 5 Sep 2016 03:02:03 +0000 (11:02 +0800)]
Rollup merge of #35845 - frewsxcv:result-into-iter, r=GuillaumeGomez

Indicate where `core::result::IntoIter` is created.

None

7 years agoAuto merge of #36242 - semarie:local-rebuild, r=alexcrichton
bors [Mon, 5 Sep 2016 06:50:04 +0000 (23:50 -0700)]
Auto merge of #36242 - semarie:local-rebuild, r=alexcrichton

Use libraries from local-rust-root directory in configure when using …

…--enable-local-rebuild

When using --enable-local-rebuild configure options, the configure
script will test rustc version. But when running it, it will not use the
libraries in the local-rust-root directory.

So use `LD_LIBRARY_PATH` environment variable to correct it.

Under OpenBSD, we use `--enable-local-rebuild` for rebuilding rustc-1.11.0 using rustc-1.11.0. But as it is in use in -current (the developpment branch of OpenBSD), system libraries could easily have ABI/API changes. The (unofficial) bootstrap (rustc-1.11.0 used for building rustc-1.11.0) include several system libraries to permit it to run. The build system use libraries in stage0/lib directory. But the configure script doesn't.

Due to my special use of `--enable-local-rebuild`, I dunno if this PR is suitable for inclusion. But it corrects a difference between build and configure use of the binary.

r? @alexcrichton

7 years agoLoad macros from `extern crate`s in the `InvocationCollector` fold.
Jeffrey Seyfried [Fri, 2 Sep 2016 02:20:03 +0000 (02:20 +0000)]
Load macros from `extern crate`s in the `InvocationCollector` fold.

7 years agoImplement stackless expansion.
Jeffrey Seyfried [Fri, 2 Sep 2016 09:12:47 +0000 (09:12 +0000)]
Implement stackless expansion.

7 years agoAdd module `ext::placeholders` with `placeholder()` and `PlaceholderExpander`.
Jeffrey Seyfried [Mon, 29 Aug 2016 05:32:41 +0000 (05:32 +0000)]
Add module `ext::placeholders` with  `placeholder()` and `PlaceholderExpander`.

7 years agoRefactor `expand_invoc(.., fld)` -> `self.expand_invoc(..)`.
Jeffrey Seyfried [Thu, 1 Sep 2016 07:01:45 +0000 (07:01 +0000)]
Refactor `expand_invoc(.., fld)` -> `self.expand_invoc(..)`.

7 years agoRefactor `SyntaxEnv`.
Jeffrey Seyfried [Thu, 1 Sep 2016 06:44:54 +0000 (06:44 +0000)]
Refactor `SyntaxEnv`.

7 years agoRefactor `expand_*` into `expander.fold_*`.
Jeffrey Seyfried [Tue, 30 Aug 2016 23:03:52 +0000 (23:03 +0000)]
Refactor `expand_*` into `expander.fold_*`.

7 years agoClean up module processing.
Jeffrey Seyfried [Sun, 28 Aug 2016 03:49:56 +0000 (03:49 +0000)]
Clean up module processing.

7 years agoRefactor out `expand_item` (with better semantics than before).
Jeffrey Seyfried [Sun, 28 Aug 2016 03:16:03 +0000 (03:16 +0000)]
Refactor out `expand_item` (with better semantics than before).

7 years agoRefactor away `expand_item`.
Jeffrey Seyfried [Sun, 28 Aug 2016 03:11:33 +0000 (03:11 +0000)]
Refactor away `expand_item`.

7 years agoGeneralize `Invocation` to include modifiers/decorators.
Jeffrey Seyfried [Fri, 2 Sep 2016 06:14:38 +0000 (06:14 +0000)]
Generalize `Invocation` to include modifiers/decorators.

7 years agoRefactor `with_exts_frame` from a macro to a function.
Jeffrey Seyfried [Sat, 27 Aug 2016 06:27:35 +0000 (06:27 +0000)]
Refactor `with_exts_frame` from a macro to a function.

7 years agoAdd `Invocation` and `Expansion`, remove `MacroGenerable`.
Jeffrey Seyfried [Sat, 27 Aug 2016 05:27:59 +0000 (05:27 +0000)]
Add `Invocation` and `Expansion`, remove `MacroGenerable`.

7 years agoRemove `syntax::config::strip_unconfigured`, add `syntax::config::features`.
Jeffrey Seyfried [Wed, 31 Aug 2016 23:39:16 +0000 (23:39 +0000)]
Remove `syntax::config::strip_unconfigured`, add `syntax::config::features`.

7 years agoImprove `expand_type`.
Jeffrey Seyfried [Tue, 30 Aug 2016 07:05:25 +0000 (07:05 +0000)]
Improve `expand_type`.

7 years agoIn `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`
Jeffrey Seyfried [Wed, 31 Aug 2016 09:02:45 +0000 (09:02 +0000)]
In `Parser` and `ExtCtxt`, replace fields `filename` and `mod_path_stack`
with a single field `directory: PathBuf`.

7 years agoRemove expr_ty method completely
Andrew Cann [Sun, 28 Aug 2016 11:37:57 +0000 (19:37 +0800)]
Remove expr_ty method completely

7 years agoUndo unnecessary bookkeeping from last commit
Andrew Cann [Sun, 28 Aug 2016 09:29:54 +0000 (17:29 +0800)]
Undo unnecessary bookkeeping from last commit

7 years agoRemove use of expr_ty from coercions code
Andrew Cann [Sun, 28 Aug 2016 08:17:52 +0000 (16:17 +0800)]
Remove use of expr_ty from coercions code

7 years agoMove write_ty to the bottom of check_pat
Andrew Cann [Sat, 27 Aug 2016 12:38:06 +0000 (20:38 +0800)]
Move write_ty to the bottom of check_pat

7 years agoFactor write_ty out of more pattern-checking functions
Andrew Cann [Sat, 27 Aug 2016 12:34:37 +0000 (20:34 +0800)]
Factor write_ty out of more pattern-checking functions

7 years agoFactor write_ty out of pattern-matching functions
Andrew Cann [Sat, 27 Aug 2016 12:06:47 +0000 (20:06 +0800)]
Factor write_ty out of pattern-matching functions