Commit Graph

72977 Commits

Author SHA1 Message Date
bors
957dc8de63 Auto merge of #46531 - cramertj:no-mo-modrs, r=nikomatsakis
Implement non-mod.rs mod statements

Fixes https://github.com/rust-lang/rust/issues/45385, cc https://github.com/rust-lang/rust/issues/44660

This will fail tidy right now because it doesn't recognize my UI tests as feature-gate tests. However, I'm not sure if compile-fail will work out either because compile-fail usually requires there to be error patterns in the top-level file, which isn't possible with this feature. What's the recommended way to handle this?
2017-12-21 05:24:45 +00:00
David Henningsson
f536143ab6 Mir: Abort on nounwind ABIs
Generate Abort instead of Resume terminators on nounwind ABIs.

https://github.com/rust-lang/rust/issues/18510

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-21 04:43:35 +01:00
David Henningsson
dd6127e4af Mir: Add Terminatorkind::Abort
The Abort Terminatorkind will cause an llvm.trap function call to be
emitted.

Signed-off-by: David Henningsson <diwic@ubuntu.com>
2017-12-21 04:43:27 +01:00
bors
a12706ca71 Auto merge of #46083 - petrochenkov:morepriv, r=nikomatsakis
Type privacy polishing

Various preparations before implementing https://github.com/rust-lang/rfcs/pull/2145 containing final minor breaking changes (mostly for unstable code or code using `allow(private_in_public)`).
(Continuation of https://github.com/rust-lang/rust/pull/42125, https://github.com/rust-lang/rust/pull/44633 and https://github.com/rust-lang/rust/pull/41332.)

It would be good to run crater on this.
r? @eddyb
2017-12-21 02:48:17 +00:00
Trevor Spiteri
9d6bd0536a docs: do not call integer overflows as underflows 2017-12-21 02:39:01 +01:00
Jonathan S
cbcf2ffe80 Never mark unions as uninhabited. Although I think this is wrong, it is certainly sound, and the general consensus seems to value not having footguns over some sort of aesthetic consistency. 2017-12-20 19:36:41 -06:00
Vadim Petrochenkov
c6209a36bb Always report private-in-public in associated types as hard errors
according to RFC 2145.

Fix a silly label message.
2017-12-21 03:19:05 +03:00
Vadim Petrochenkov
020961d880 Prohibit access to private statics from other crates through macros 2.0 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
190adc0e19 Properly check traits in type privacy 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
53779ed5ec Check associated type bindings for privacy and stability 2017-12-21 03:17:19 +03:00
Vadim Petrochenkov
8dcd26a6df Add tests for associated item privacy 2017-12-21 03:17:19 +03:00
bors
fdfb007109 Auto merge of #46862 - nikomatsakis:nll-master, r=arielb1
NLL feature complete (adds `feature(nll)`)!

This is the final PR for the nll-master branch; it brings over all remaining content.

The contents of the branch include:

- track causal information and use it to report extended errors
- handle `impl Trait` in NLL code
- improve printing of outlives errors
- add `#![feature(nll)]` and some more sample tests

The commits should for the most part build independently.

r? @pnkfelix (and/or @arielb1)
2017-12-20 23:26:20 +00:00
Wilco Kusee
d5b1119b16 Const-eval TyArray trait implementors 2017-12-20 23:13:15 +01:00
Niko Matsakis
d925f4d1dd fix truncated comment 2017-12-20 16:51:33 -05:00
Niko Matsakis
4f549fe4fe improve comment about instantiating anon types 2017-12-20 16:48:41 -05:00
Ariel Ben-Yehuda
f68e11b440 A few small improvements to the contributing docs 2017-12-20 22:18:13 +02:00
Vadim Petrochenkov
d333752f5c Fix parsing of paths with fn-like generic arguments 2017-12-20 22:55:57 +03:00
Vadim Petrochenkov
eef85cf0ff Add tests checking taht "priority" of qpath recovery is higher than unary and binary operators 2017-12-20 22:43:47 +03:00
Vadim Petrochenkov
9a68098e87 Move impls for qpath recovery trait from ast.rs 2017-12-20 22:43:47 +03:00
Niko Matsakis
3f490ca4bd convert region-liveness-drop{-,-no-}may-dangle.rs into ui tests
The "match exact bits of CFG" approach was fragile and uninformative.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cba82561cf add some run-pass tests for NLL showing that things work as expected 2017-12-20 14:38:13 -05:00
Niko Matsakis
80c510e353 when using feature(nll), don't warn about AST-based region errors
Also, keep reporting AST-based region errors that are not occuring in
a fn body.
2017-12-20 14:38:13 -05:00
Niko Matsakis
cfa4ffa374 document and tweak the nll, use_mir, etc helpers
In particular, -Znll might as well imply -Zborrowck=mir by default,
just like `#![feature(nll)]` does.

Also, if NLL is in use, no reason to emit end regions. The NLL pass
just strips them out anyway.
2017-12-20 14:38:13 -05:00
Santiago Pastorino
e980fb8bef feature nll implies borrowck=mir 2017-12-20 14:38:13 -05:00
Santiago Pastorino
2019d69f61 feature nll implies two-phase-borrows 2017-12-20 14:38:13 -05:00
Santiago Pastorino
0b2db1e616 Add nll feature and make nll imply nll_dump_cause 2017-12-20 14:38:12 -05:00
Santiago Pastorino
95b6148e31 Add nll_dump_cause helper to Session 2017-12-20 14:38:12 -05:00
Niko Matsakis
508a831dca use report_generic_bound_failure when we can in the compiler 2017-12-20 14:38:12 -05:00
Niko Matsakis
3788f4207d refactor report_generic_bound_failure to be usable by NLL code 2017-12-20 14:38:12 -05:00
Niko Matsakis
6b39781df6 connect NLL machinery to the NiceRegionError code 2017-12-20 14:38:12 -05:00
Niko Matsakis
94e7072d0b give precedence to try_report_named_anon_conflict method 2017-12-20 14:38:12 -05:00
Niko Matsakis
de563082c8 use Option<ErrorReported> instead of bool
Also allows us to replace `or_false` with `?`.

No functional change
2017-12-20 14:38:11 -05:00
Niko Matsakis
cba4732b65 introduce a NiceRegionError type and define methods on that
This is more convenient, and allows us to be more independent from
infcx, particularly with respect to `in_progress_tables` field.

No functional change.
2017-12-20 14:38:11 -05:00
Niko Matsakis
a28ab84025 nice_region_error: rustfmt 2017-12-20 14:38:11 -05:00
Niko Matsakis
3720242c75 extract find_anon_type into its own module 2017-12-20 14:38:11 -05:00
Niko Matsakis
93498e0c22 make util fns private to nice_region_error 2017-12-20 14:38:11 -05:00
Niko Matsakis
4089d140e0 move nice-region-error reporting into its own module 2017-12-20 14:38:11 -05:00
Niko Matsakis
e28d03f38b only dump causes if we have nothing better 2017-12-20 14:38:11 -05:00
Santiago Pastorino
3a185a510d Add three point error handling to borrowck
Closes #45988
2017-12-20 14:38:10 -05:00
Niko Matsakis
6d2987ca03 Move categorize logic out of visit_local function 2017-12-20 14:38:10 -05:00
Santiago Pastorino
58b0506d65 Move MirVisitable to visit.rs 2017-12-20 14:38:10 -05:00
Niko Matsakis
93afb1affc connect NLL type checker to the impl trait code
We now add the suitable `impl Trait` constraints.
2017-12-20 14:04:52 -05:00
Niko Matsakis
da63aaa7ab extract input_output code into its own module
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
a66c6512aa pass UniversalRegions to MIR type-checker instead of fields
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
7f50e7ca85 extract the writeback code for anon types into InferCtxt
No functional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
8e64ba83be extract constrain_anon_types to the InferCtxt
No funtional change.
2017-12-20 14:04:52 -05:00
Niko Matsakis
e96f4be03d extract instantiate_anon_types to the InferCtxt
No functional change.
2017-12-20 14:04:51 -05:00
Niko Matsakis
4a967c9df7 propagate region_bound_pairs into MIR type-check 2017-12-20 14:04:51 -05:00
Niko Matsakis
fe89f4ba86 get the DefiningTy from the body_owner_kind not type
The type isn't a good idea because we want to treat constants
uniformly, regardless of what type of value they produce.
2017-12-20 14:04:51 -05:00
Niko Matsakis
0e64a756f8 integrate -Znll-dump-cause into borrowck 2017-12-20 14:04:51 -05:00