Commit Graph

53626 Commits

Author SHA1 Message Date
Andrea Canciani
4ec1f8de41 Fix asm! blocks
The `volatile` modifier was incorrectly written outside of the `asm!`
blocks.
2016-05-16 15:41:45 +02:00
Andrea Canciani
88afeb9cba Cleanup documentation
Remove irrelevant information (and instead provide pointer to
reference documentation), replace ASCII-art table with the
corresponding MarkDown one, and minor fixes.
2016-05-16 15:37:14 +02:00
bors
89430be0c1 Auto merge of #33331 - uasi:diag-e0038-typo, r=GuillaumeGomez
diagnostics: Fix minor typo in E0038
2016-05-16 05:05:55 -07:00
Felix S. Klock II
ee44f7ed27 DefinitelyInitializedLvals dataflow op (goal: move away from MaybeUninitializedLvals) 2016-05-16 13:34:33 +02:00
Felix S. Klock II
8956789c35 Little unit tests for MIR dataflow analysis.
These use new `rustc_peek` (whose semantics is driven by attribute
attached to fn).
2016-05-16 13:34:33 +02:00
Felix S. Klock II
5839e6bb10 Add ability to unit-test dataflow results via rustc_peek intrinsic.
(The static semantics of `rustc_peek` is derived from attributes
attached to the function being compiled; in this case,
`rustc_peek(&expr)` observes the dataflow state for the l-value
`expr`.)
2016-05-16 13:34:33 +02:00
Felix S. Klock II
3bb598429a Adding magic rustc_peek intrinsic that other code can repurpose to
its own needs based on attributes attached to the function where it
appears.
2016-05-16 13:34:33 +02:00
Felix S. Klock II
c73f3517a2 Revised mir-dataflow.
Incorporates many fixes contributed by arielb1.

----

revise borrowck::mir::dataflow code to allow varying domain for bitvectors.

This particular code implements the `BitDenotation` trait for three
analyses:

 * `MovingOutStatements`, which, like `borrowck::move_data`, maps each
   bit-index to a move instruction, and a 1 means "the effect of this
   move reaches this point" (and the assigned l-value, if a scoped
   declaration, is still in scope).

 * `MaybeInitializedLvals`, which maps each bit-index to an l-value.
   A 1 means "there exists a control flow path to this point that
   initializes the associated l-value."

 * `MaybeUninitializedLvals`, which maps each bit-index to an l-value
   A 1 means "there exists a control flow path to this point that
   de-initializes the associated l-value."

----

Revised `graphviz` dataflow-rendering support in `borrowck::mir`.

One big difference is that this code is now parameterized over the
`BitDenotation`, so that it can be used to render dataflow results
independent of how the dataflow bitvectors are interpreted; see where
reference to `MoveOut` is replaced by the type parameter `D`.

----

Factor out routine to query subattributes in `#[rustc_mir(..)]`.

(Later commits build upon this for some unit testing and instrumentation.)

----

thread through a tcx so that I can query types of lvalues as part of analysis.

----

Revised `BitDenotation::Ctxt`, allowing variation beyond `MoveData`.

The main motivation is to ease threading through a `TyCtxt`.

(In hindsight it might have been better to instead attach the `TyCtxt`
to each of the different dataflow implementations, but that would
require e.g. switching away from having a `Default` impl, so I am
leaving that experiment for another time.)
2016-05-16 13:34:25 +02:00
bors
32f8366b7c Auto merge of #33640 - lucab:to-upstream/tcp-stress, r=alexcrichton
test: explicitely check the number of spawned threads in tcp-stress

System limits may restrict the number of threads effectively spawned by this test (eg. systemd recently introduced a 512 tasks per unit maximum default).
Now this test explicitly asserts on the expected number of threads, making failures due to system limits easier to spot.
More details at https://bugs.debian.org/822325
2016-05-16 02:47:12 -07:00
Wang Xuerui
2ea6c70a1a syntax_ext: format: remove reference to methods in comment 2016-05-16 17:16:32 +08:00
Wang Xuerui
067284b291 syntax_ext: format: nest_level's are no more
`nest_level` is long dead since cac7a2053a
(PR #14831), so is `check_positional_ok()`. Let's bid them farewell.
2016-05-16 16:59:27 +08:00
Felix S. Klock II
6c72c5fa88 borrowck::mir::gather_moves: create MovePaths for lvalues even if unreferenced.
includes misc bug fixes and removal of useless code.
2016-05-16 10:00:35 +02:00
Felix S. Klock II
d03b341e6b Unit struct defns for 3 dataflow analyses for borrowck::mir::dataflow. 2016-05-16 09:13:42 +02:00
Felix S. Klock II
79ab85544b Remove &self parameter from DataflowOperator::initial_value. 2016-05-16 09:13:42 +02:00
Felix S. Klock II
b4972b00c9 Add helper method for getting the dataflow results at exit from a basic block. 2016-05-16 09:13:42 +02:00
Felix S. Klock II
129b371cae One-line doc clarification for representation of unit type (). 2016-05-16 09:13:42 +02:00
Felix S. Klock II
4446e793da Expose pretty print routines that accept just mir (no need for a NodeId). 2016-05-16 09:13:42 +02:00
Felix S. Klock II
90b7a86268 rustc_mir::pretty refactoring: break fn write_fn_intro into two routines.
(The crucial thing these changes are working toward (but are not yet
in this commit) is a way to pretty-print MIR without having the
`NodeId` for that MIR in hand.)
2016-05-16 09:13:42 +02:00
Felix S. Klock II
306ca4ca4f rustc_mir::pretty: factor out scope entry/exit annotation computation. 2016-05-16 09:13:42 +02:00
Felix S. Klock II
bfe789c044 fixes to librustc_borrowck::bitslice::bits_to_string, used for graphviz printing. 2016-05-16 09:13:42 +02:00
Felix S. Klock II
cd81b60a4a fix bug in debug! output from rustc::middle::dataflow
(bug was cut/pasted into `rustc_borrowck::bitslice`, so I fixed it
there as well.)
2016-05-16 09:13:42 +02:00
bors
e87cd7e380 Auto merge of #33505 - petrochenkov:self, r=nrc
Remove ExplicitSelf from HIR

`self` argument is already kept in the argument list and can be retrieved from there if necessary, so there's no need for the duplication.
The same changes can be applied to AST, I'll make them in the next breaking batch.
The first commit also improves parsing of method declarations and fixes https://github.com/rust-lang/rust/issues/33413.

r? @eddyb
2016-05-15 23:14:52 -07:00
Pyry Kontio
20b9129617 Added a big-picture explanation for thread::park() & co. 2016-05-16 14:01:21 +09:00
Robert Habermeier
81f479f5bd rename a few occurrences of RecoverSafe in docs 2016-05-16 00:04:01 -04:00
bors
e90307d2a2 Auto merge of #33251 - Kintaro:fix-typo-in-fs, r=GuillaumeGomez
Fix a typo in error messages in std::fs tests

Just a small correction to fix a typo in an error message in std::fs tests
2016-05-15 20:47:15 -07:00
bors
bb39c4925a Auto merge of #33643 - eddyb:rollup, r=eddyb
Rollup of 27 pull requests

- Successful merges: #33342, #33393, #33415, #33475, #33517, #33533, #33534, #33565, #33580, #33584, #33585, #33588, #33590, #33591, #33593, #33598, #33600, #33602, #33603, #33604, #33605, #33607, #33612, #33620, #33633, #33634, #33635
- Failed merges: #33578
2016-05-15 18:22:51 -07:00
Eduard-Mihai Burtescu
ffbfbe452c Rollup merge of #33660 - fbergr:doc, r=steveklabnik
Update link to license

Permanent redirect (301). The link should be updated.
2016-05-16 02:00:20 +03:00
Eduard-Mihai Burtescu
b4da51a0a3 Rollup merge of #33635 - tshepang:capitalise, r=steveklabnik
doc: 'tis the lang, not the reptile
2016-05-16 02:00:20 +03:00
Eduard-Mihai Burtescu
b0c897279e Rollup merge of #33634 - tshepang:nicer-output, r=steveklabnik
doc: improve output
2016-05-16 02:00:19 +03:00
Eduard-Mihai Burtescu
76d50e657b Rollup merge of #33633 - tshepang:no-effect, r=steveklabnik
doc: this statement does not have an effect
2016-05-16 02:00:19 +03:00
Eduard-Mihai Burtescu
1155a34ab9 Rollup merge of #33631 - solson:ignore-rustbuild-config, r=alexcrichton
rustbuild: Ignore user config.toml file.

r? @eddyb
2016-05-16 02:00:19 +03:00
Eduard-Mihai Burtescu
9cd83eb15c Rollup merge of #33605 - tshepang:less-awkward, r=steveklabnik
doc: use less awkward and less confusing language
2016-05-16 02:00:19 +03:00
Eduard-Mihai Burtescu
9c745e7feb Rollup merge of #33604 - tshepang:line-em-up, r=GuillaumeGomez
doc: line these comments up

Looks more nice, and same is done with prior examples
2016-05-16 02:00:18 +03:00
Eduard-Mihai Burtescu
752137f9cb Rollup merge of #33603 - tshepang:no-need, r=apasel422
doc: to_string not needed since we gots coercion
2016-05-16 02:00:18 +03:00
bors
5ebe41835f Auto merge of #33619 - jonathandturner:improve_structured_errors, r=nikomatsakis
Batch of improvements to errors for new error format

This is a batch of improvements to existing errors to help get the most out of the new error format.

* Added labels to primary spans (^^^) for a set of errors that didn't currently have them
* Highlight the source blue under the secondary notes for better readability
* Move some of the "Note:" into secondary spans+labels
* Fix span_label to take &mut instead, which makes it work the same as other methods in that set
2016-05-15 15:08:46 -07:00
Jonathan Turner
65cb5f7378 Add space after equals 2016-05-15 11:57:50 -07:00
bors
e7420fbbae Auto merge of #33620 - eddyb:oops-static-is-not-fn, r=dotdash
mir: always allow &mut [...] in static mut regardless of the array length.
2016-05-15 11:01:03 -07:00
Florian Berger
92abda02c4 Update link to license 2016-05-15 19:59:45 +03:00
bors
9f58fb776a Auto merge of #33658 - Manishearth:rollup, r=Manishearth
Rollup of 14 pull requests

- Successful merges: #33342, #33393, #33415, #33475, #33517, #33533, #33534, #33565, #33580, #33584, #33585, #33590, #33591, #33598
- Failed merges: #33578
2016-05-15 08:37:09 -07:00
Manish Goregaokar
95ace6be43 Rollup merge of #33598 - haikoschol:master, r=alexcrichton
doc: Fix comment in std::string::String example code
2016-05-15 20:13:43 +05:30
Manish Goregaokar
762e5b1c0f Rollup merge of #33591 - dns2utf8:systemtime_wording, r=GuillaumeGomez
Use the correct word in the explanation

r? @steveklabnik
2016-05-15 20:13:43 +05:30
Manish Goregaokar
9f336f6368 Rollup merge of #33590 - durka:patch-22, r=aturon
update "reason" for fnbox feature gate

It isn't "newly introduced" anymore.
2016-05-15 20:13:43 +05:30
Manish Goregaokar
e82596b9d8 Rollup merge of #33585 - GuillaumeGomez:error_code_test, r=steveklabnik
Add compile-fail tests for error codes

r? @steveklabnik

cc @jonathandturner
2016-05-15 20:13:42 +05:30
Manish Goregaokar
65814df26b Rollup merge of #33584 - GuillaumeGomez:error_code_improvements, r=steveklabnik
Add more details and examples in error codes

r? @steveklabnik
2016-05-15 20:13:42 +05:30
Manish Goregaokar
3bc7fc1b54 Rollup merge of #33580 - frewsxcv:temp-dir, r=alexcrichton
Cleanup formatting and wording for `std::env::temp_dir` docs.

None
2016-05-15 20:13:42 +05:30
Manish Goregaokar
0238e29652 Rollup merge of #33565 - Amanieu:once_doc, r=GuillaumeGomez
Fix typo in std::sync::Once documentation
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0ceb073038 Rollup merge of #33534 - dns2utf8:atomic_docs, r=GuillaumeGomez
Simplify text

This way it should be clear: Any number of other threads have this guaranty not just one other thread.
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0f4f51b173 Rollup merge of #33533 - GuillaumeGomez:add_E0500, r=steveklabnik
Add E0500 error explanation

r? @Manishearth

Part of #32777.
2016-05-15 20:13:41 +05:30
Manish Goregaokar
0e5f385b96 Rollup merge of #33517 - sanxiyn:tight-span, r=nagisa
Tighten span for E0063
2016-05-15 20:13:40 +05:30
Manish Goregaokar
7003253b34 Rollup merge of #33475 - billyevans:master, r=guillaumegomez
Add detailed error explanation for E0505

Part of #32777
2016-05-15 20:13:40 +05:30