Commit Graph

7876 Commits

Author SHA1 Message Date
Jorge Aparicio 358fc5b621 stabilize #[panic_handler] 2018-09-07 13:27:30 +02:00
Oliver Schneider d125e904b5 Restrict most uses of const_fn to min_const_fn 2018-08-31 08:40:00 +02:00
Jorge Aparicio a774c81f98 add #[panic_handler]; deprecate #[panic_implementation] 2018-08-23 20:58:55 +02:00
Masaki Hara e2b95cb70e Lift some Sized checks. 2018-08-19 08:07:33 +09:00
David Wood 7b026568f7 Moved problematic tests on x86_64-gnu-nopt back to compile-fail. 2018-08-14 11:12:13 +02:00
David Wood d775e6132c Moved problematic tests on x86_64-pc-windows-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood 67ec37b608 Moved problematic tests on armhf-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood 4b2464592c Moved problematic tests on wasm32-unknown back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood f7f7c1eef3 Moved problematic tests on dist-x86_64-musl back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood b8b7a3c30e Moved problematic tests on i586-unknown-linux-gnu back to compile-fail. 2018-08-14 11:12:12 +02:00
David Wood 768998a8de Normalize tests for i686 Windows. 2018-08-14 11:12:11 +02:00
David Wood 0cfc17358a Moved problematic tests on Windows back to compile-fail. 2018-08-14 11:12:11 +02:00
David Wood a922642455 Moved tests back to compile-test if they don't work on ui. 2018-08-14 11:12:11 +02:00
David Wood b16a30677f Moved compile-fail tests to ui tests. 2018-08-14 10:38:00 +02:00
Eduard-Mihai Burtescu f9b1176eef rustc_resolve: fix special-case for one-segment import paths. 2018-08-14 07:06:50 +03:00
Vadim Petrochenkov d2f56378da Feature gate arbitrary tokens in non-macro attributes with a separate gate
Feature gate `rustc_` and `derive_` with their own gates again instead of `custom_attribute`
2018-08-11 16:41:17 +03:00
bors a77dfcc79f Auto merge of #53131 - davidtwco:issue-52663-thread-local-static, r=nikomatsakis
NLL says something "does not live long enough" when talking about a (thread-local) static

Part of #52663.

r? @nikomatsakis
2018-08-10 06:54:11 +00:00
bors ffb09dfb3a Auto merge of #53053 - petrochenkov:custattr, r=alexcrichton
resolve:  Support custom attributes when macro modularization is enabled

Basically, if resolution of a single-segment attribute is a determined error, then we interpret it as a custom attribute.

Since custom attributes are integrated into general macro resolution, `feature(custom_attribute)` now requires and implicitly enables macro modularization (`feature(use_extern_macros)`).
Actually, a few other "advanced" macro features now implicitly enable macro modularization too (and one bug was found and fixed in process of enabling it).

The first two commits are preliminary cleanups/refactorings.
2018-08-08 08:37:56 +00:00
Oliver Schneider fee07534bb Add feature gate checks 2018-08-07 14:41:33 +02:00
Oliver Schneider 3ef863bfdf Place unions, pointer casts and pointer derefs behind extra feature gates 2018-08-07 14:41:33 +02:00
David Wood 43850e0bee Special case error message for thread-local statics. 2018-08-07 12:08:52 +02:00
Vadim Petrochenkov 50886115d7 Address review comments
Adjust a few fulldeps and pretty-printing tests
Fix rebase
2018-08-06 23:55:53 +03:00
Vadim Petrochenkov cb64672e0c Enable macro modularization implicitly if one of "advanced" macro features is enabled
Do not mark all builtin attributes as used when macro modularization is enabled
2018-08-06 23:22:31 +03:00
Vadim Petrochenkov f60d96a477 Support custom attributes when macro modularization is enabled 2018-08-06 23:21:18 +03:00
bors cf84056149 Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis
Disable some nice region errors in NLL mode.

Fixes #52739. cc #52742.

r? @nikomatsakis
2018-08-06 19:15:05 +00:00
David Wood 37ba9ca334 Disable some nice region errors in NLL mode. 2018-08-06 20:43:16 +02:00
bors b239743753 Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.
2018-08-06 16:58:27 +00:00
bors 7c98d2e63f Auto merge of #52332 - zackmdavis:dead_code_lint_should_say_2_electric_boogaloo, r=pnkfelix
dead-code lint: say "constructed" for structs

Respectively.

This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than once—at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never "constructed"
specifically for enum variants. More recently, the same issue was raised
for structs (#52325). It seems consistent to say "constructed" here,
too, for the same reasons.

~~While we're here, we can also use more specific word "called" for unused
functions and methods. (We declined to do this in #46103, but the
rationale given in the commit message doesn't actually make sense.)~~

This resolves #52325.
2018-08-06 07:02:11 +00:00
varkor c157ec87ed Fix 2018 edition tests 2018-08-05 15:54:49 +01:00
varkor f22ccbe315 Fix run-pass-fulldeps tests 2018-08-05 15:54:49 +01:00
varkor 120989195f Convert unknown_features lint into an error 2018-08-05 15:54:49 +01:00
varkor 895fcec3b4 Fix test/compile-fail 2018-08-05 15:54:49 +01:00
bors 59fa6bd6c1 Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJung
Reintroduce `Undef` and properly check constant value sizes

r? @RalfJung

cc @eddyb

basically all kinds of silent failures that never occurred are assertions now
2018-08-03 14:28:12 +00:00
bors 40e4b6ee3d Auto merge of #52841 - petrochenkov:premacro, r=alexcrichton
resolve: Implement prelude search for macro paths, implement tool attributes

When identifier is macro path is resolved in scopes (i.e. the first path segment - `foo` in `foo::mac!()` or `foo!()`), scopes are searched in the same order as for non-macro paths - items in modules, extern prelude, tool prelude (see later), standard library prelude, language prelude, but with some extra shadowing restrictions (names from globs and macro expansions cannot shadow names from outer scopes). See the comment in `fn resolve_lexical_macro_path_segment` for more details.

"Tool prelude" currently contains two "tool modules" `rustfmt` and `clippy`, and is searched immediately after extern prelude.
This makes the [possible long-term solution](https://github.com/rust-lang/rfcs/blob/master/text/2103-tool-attributes.md#long-term-solution) for tool attributes exactly equivalent to the existing extern prelude scheme, except that `--extern=my_crate` making crate names available in scope is replaced with something like `--tool=my_tool` making tool names available in scope.

The `tool_attributes` feature is still unstable and `#![feature(tool_attributes)]` now implicitly enables `#![feature(use_extern_macros)]`. `use_extern_macros` is a prerequisite for `tool_attributes`, so their stabilization will happen in the same order.
If `use_extern_macros` is not enabled, then tool attributes are treated as custom attributes (this is temporary, anyway).

Fixes https://github.com/rust-lang/rust/issues/52576
Fixes https://github.com/rust-lang/rust/issues/52512
Fixes https://github.com/rust-lang/rust/issues/51277
cc https://github.com/rust-lang/rust/issues/52269
2018-08-02 21:39:14 +00:00
Oliver Schneider 37e18e7a30 Second field of ScalarPair can be undef in some cases 2018-08-02 13:16:53 +02:00
Pietro Albini 2893bd0e0c Rollup merge of #52930 - eddyb:issue-52489, r=cramertj
rustc_resolve: record single-segment extern crate import resolutions.

Fixes #52489 by recording special-cased single-segment imports for later (e.g. stability) checks.

cc @alexcrichton @Mark-Simulacrum @petrochenkov

Does this need to be backported?
2018-08-01 21:46:35 +02:00
Vadim Petrochenkov c3e54217e8 resolve: Implement prelude search for macro paths
resolve/expansion: Implement tool attributes
2018-08-01 12:08:41 +03:00
Eduard-Mihai Burtescu dbc0cd94b9 rustc_resolve: record single-segment extern crate import resolutions. 2018-08-01 04:31:34 +03:00
Alex Crichton f0bceba669 rustc: Handle linker diagnostic from LLVM
Previously linker diagnostic were being hidden when two modules were linked
together but failed to link. This commit fixes the situation by ensuring that we
have a diagnostic handler installed and also adds support for handling linker
diagnostics.
2018-07-31 10:47:27 -07:00
Brad Gibson 56016cb1e0 resolved upstream merge conflicts 2018-07-29 22:13:12 -07:00
Oliver Schneider 3e8337eb3d Move a test that depends on the arch bitwidth to compile-fail 2018-07-29 20:24:26 +02:00
Oliver Schneider 9377041de9 Sanity-check all constants 2018-07-29 20:22:15 +02:00
bors 4234adf0d4 Auto merge of #52546 - nikomatsakis:issue-52050, r=pnkfelix
do not overwrite child def-id in place but rather remove/insert

When inserting a node N into the tree of impls, we sometimes find than an existing node C should be replaced with N. We used to overwrite C in place with the new def-id N -- but since the lists of def-ids are separated by simplified type, that could lead to N being inserted in the wrong place. This meant we might miss conflicts. We are now not trying to be so smart -- we remove C and then add N later.

Fixes #52050

r? @aturon -- do you still remember this code at all? :)
2018-07-28 18:41:40 +00:00
bors 45b48b9b6d Auto merge of #52735 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 16 pull requests

Successful merges:

 - #52558 (Add tests for ICEs which no longer repro)
 - #52610 (Clarify what a task is)
 - #52617 (Don't match on region kinds when reporting NLL errors)
 - #52635 (Fix #[linkage] propagation though generic functions)
 - #52647 (Suggest to take and ignore args while closure args count mismatching)
 - #52649 (Point spans to inner elements of format strings)
 - #52654 (Format linker args in a way that works for gcc and ld)
 - #52667 (update the stdsimd submodule)
 - #52674 (Impl Executor for Box<E: Executor>)
 - #52690 (ARM: expose `rclass` and `dsp` target features)
 - #52692 (Improve readability in a few sorts)
 - #52695 (Hide some lints which are not quite right the way they are reported to the user)
 - #52718 (State default capacity for BufReader/BufWriter)
 - #52721 (std::ops::Try impl for std::task::Poll)
 - #52723 (rustc: Register crates under their real names)
 - #52734 (sparc ABI issue - structure returning from function is returned in 64bit registers (with tests))

Failed merges:

 - #52678 ([NLL] Use better spans in some errors)

r? @ghost
2018-07-26 17:42:59 +00:00
Niko Matsakis 687f2526fb move mir_check_* to ui tests, add adjusted references 2018-07-26 08:21:35 +03:00
Esteban Küber 38abca8c2d Point at internal span in format string 2018-07-22 23:09:00 -07:00
Zack M. Davis 6c50ee5abc dead-code lint: say "constructed" for structs
This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than once—at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never
"constructed" specifically for enum variants. More recently, the same
issue was raised for structs (#52325). It seems consistent to say
"constructed" here, too, for the same reasons.

We considered using more specific word "called" for unused functions
and methods (while we declined to do this in #46103, the rationale
given in the commit message doesn't actually make sense), but it turns
out that Cargo's test suite expects the "never used" message, and
maybe we don't care enough even to make a Cargo PR over such a petty
and subjective wording change.

This resolves #52325.
2018-07-21 18:30:33 -07:00
Niko Matsakis 4fd5aed551 do not overwrite child def-id in place but rather remove/insert
When inserting a node N into the tree of impls, we sometimes find than
an existing node C should be replaced with N. We used to overwrite C
in place with the new def-id N -- but since the lists of def-ids are
separated by simplified type, that could lead to N being inserted in
the wrong place. This meant we might miss conflicts. We are now not
trying to be so smart -- we remove C and then add N later.
2018-07-21 19:07:47 +03:00
Matthew Jasper a06b2433fc Update tests for new NLL mutability errors 2018-07-20 20:01:15 +01:00
bors 9d6f4e5eea Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
Move some `compile-fail` tests to `ui`

Re: #44844.
2018-07-17 06:52:20 +00:00