about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-05-02lint: deny incoherent_fundamental_impls by defaultHoàng Đức Hiếu-38/+0
Warn the ecosystem of the pending intent-to-disallow in #49799.
2018-05-01Auto merge of #49982 - petrochenkov:noreex, r=alexcrichtonbors-548/+237
Remove unstable `macro_reexport` It's subsumed by `feature(use_extern_macros)` and `pub use` cc https://github.com/rust-lang/rust/issues/35896 closes https://github.com/rust-lang/rust/issues/29638 closes https://github.com/rust-lang/rust/issues/38951
2018-05-01Auto merge of #49789 - petrochenkov:prelext, r=nikomatsakisbors-0/+171
Module experiments: Add one more prelude layer for extern crate names passed with `--extern` Implements one item from https://internals.rust-lang.org/t/the-great-module-adventure-continues/6678/183 When some name is looked up in lexical scope (`name`, i.e. not module-relative scope `some_mod::name` or `::name`), it's searched roughly in the next order: - local variables - items in unnamed blocks - items in the current module - :sparkles: NEW! :sparkles: crate names passed with `--extern` ("extern prelude") - standard library prelude (`Vec`, `drop`) - language prelude (built-in types like `u8`, `str`, etc) The last two layers contain a limited set of names controlled by us and not arbitrary user-defined names like upper layers. We want to be able to add new names into these two layers without breaking user code, so "extern prelude" names have higher priority than std prelude and built-in types. This is a one-time breaking change, that's why it would be nice to run this through crater. Practical impact is expected to be minimal though due to stylistic reasons (there are not many `Uppercase` crates) and due to the way how primitive types are resolved (https://github.com/rust-lang/rust/pull/32131).
2018-05-01Fix an error from "unused" lint + Fix rebaseVadim Petrochenkov-82/+74
2018-05-01Give removal reasons to removed featuresVadim Petrochenkov-0/+6
2018-05-01Remove `macro_reexport`Vadim Petrochenkov-547/+238
It's subsumed by `feature(use_extern_macros)` and `pub use`
2018-05-01Auto merge of #50198 - oli-obk:const_prop, r=eddybbors-9/+8
Remove some unused code
2018-05-01Auto merge of #48786 - nagisa:fp, r=nikomatsakisbors-0/+17
Add force-frame-pointer flag to allow control of frame pointer ommision Rebase of #47152 plus some changes suggested by https://github.com/rust-lang/rust/issues/48785. Fixes #11906 r? @nikomatsakis
2018-05-01Force frame pointers for the backtrace testSimonas Kazlauskas-0/+1
2018-05-01Rework force-frame-pointerSimonas Kazlauskas-1/+1
This reworks the force-frame-pointer PR to explicitly only consider the value of the flag if it is provided, and use a target default otherwise. Something that was tried but not kept was renaming the flag to `frame-pointer`, because for flag `frame-pointer=no`, there is no guarante, that LLVM will elide *all* the frame pointers; oposite of what the literal reading of the flag would suggest.
2018-05-01Don't force-enable frame pointers when generating debug infoBjörn Steinbrink-0/+16
We apparently used to generate bad/incomplete debug info causing debuggers not to find symbols of stack allocated variables. This was somehow worked around by having frame pointers. With the current codegen, this seems no longer necessary, so we can remove the code that force-enables frame pointers whenever debug info is requested. Since certain situations, like profiling code profit from having frame pointers, we add a -Cforce-frame-pointers flag to always enable frame pointers. Fixes #11906
2018-05-01Auto merge of #50304 - nox:uninhabited-output, r=eddybbors-6/+16
Mark functions returning uninhabited types as noreturn
2018-04-30Auto merge of #48925 - zackmdavis:fn_must_stabilize, r=nikomatsakisbors-239/+104
stabilize `#[must_use]` for functions and must-use comparison operators (RFC 1940) r? @nikomatsakis
2018-05-01Rollup merge of #50330 - japaric:used, r=nagisakennytm-0/+28
check that #[used] is used only on statics this attribute has no effect on other items. This makes the implementation match what's described in the RFC. cc #40289 r? @nagisa
2018-05-01Rollup merge of #50327 - varkor:match-unused-struct-field, r=estebankkennytm-6/+85
Display correct unused field suggestion for nested struct patterns Extends https://github.com/rust-lang/rust/pull/47922 by checking more sophisticated patterns (e.g. references, slices, etc.). Before: ``` warning: unused variable: `bar` --> src/main.rs:37:21 | 37 | &Foo::Bar { bar } => true, | ^^^ help: consider using `_bar` instead | = note: #[warn(unused_variables)] on by default ``` After: ``` warning: unused variable: `bar` --> src/main.rs:37:21 | 37 | &Foo::Bar { bar } => true, | ^^^ help: try ignoring the field: `bar: _` | = note: #[warn(unused_variables)] on by default ``` Fixes #50303. r? @estebank
2018-05-01Rollup merge of #50325 - petrochenkov:pmgate, r=alexcrichtonkennytm-13/+42
Add a few more tests for proc macro feature gating
2018-05-01Rollup merge of #50233 - mark-i-m:const_vec, r=kennytmkennytm-0/+17
Make `Vec::new` a `const fn` `RawVec::empty/_in` are a hack. They're there because `if size_of::<T> == 0 { !0 } else { 0 }` is not allowed in `const` yet. However, because `RawVec` is unstable, the `empty/empty_in` constructors can be removed when #49146 is done...
2018-04-30Improve div by zero const eval errorsOliver Schneider-6/+5
2018-04-30Update ui test outputOliver Schneider-7/+7
2018-04-30Auto merge of #50326 - ollie27:rustdoc_cross_crate_const_link, r=GuillaumeGomezbors-0/+103
rustdoc: Fix links to constants in external crates r? @GuillaumeGomez
2018-04-30Auto merge of #50272 - scottmcm:termination-test-error, r=nikomatsakisbors-0/+34
Add a ui test for an incorrect Result success type in a #[test] cc https://github.com/rust-lang/rust/issues/48854#issuecomment-384730601 r? @nikomatsakis
2018-04-30check that #[used] is used only on staticsJorge Aparicio-0/+28
2018-04-30Correct unused field warning on struct match container patternsvarkor-6/+55
2018-04-30Auto merge of #50092 - abonander:issue-49934, r=petrochenkovbors-0/+102
Warn on pointless #[derive] in more places This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly. closes #49934
2018-04-30Correct unused field warning on box struct matchvarkor-9/+21
2018-04-30Correct unused field warning on &struct matchvarkor-4/+22
2018-04-29Warn on pointless `#[derive]` in more placesAustin Bonander-0/+102
This fixes the regression in #49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes #49934
2018-04-29rustdoc: Fix links to constants in external cratesOliver Middleton-0/+103
2018-04-30Add a few more tests for proc macro feature gatingVadim Petrochenkov-13/+42
2018-04-29Auto merge of #50317 - varkor:repr-align-assign, r=nagisabors-0/+32
Improve error message for #[repr(align=x)] Before: ``` error[E0552]: unrecognized representation hint --> src/main.rs:1:8 | 1 | #[repr(align="8")] | ^^^^^^^^^ ``` After: ``` error[E0693]: incorrect `repr(align)` attribute format --> src/main.rs:1:8 | 2 | #[repr(align="8")] | ^^^^^^^^^ help: use parentheses instead: `align(8)` ``` Fixes #50314.
2018-04-29Add test for repr(align=x)varkor-0/+32
2018-04-29Auto merge of #48605 - KiChjang:unused-mut-warning, r=nikomatsakisbors-18/+99
Allow MIR borrowck to catch unused mutable locals Fixes #47279. r? @nikomatsakis
2018-04-28stabilize `#[must_use]` for functions and must-use operatorsZack M. Davis-239/+104
This is in the matter of RFC 1940 and tracking issue #43302.
2018-04-29Auto merge of #50271 - sinkuu:fix_ice, r=eddybbors-0/+33
Fix ICE #48984 * ~~fbf6423 The tail type was not normalized.~~ * https://github.com/rust-lang/rust/commit/d0839d5680d2a51785eeb0811cf3e2beba90eacb The method had a wrong assumption that something whose parent is a trait is an associated item. Fixes #48984.
2018-04-28feature on testMark Mansi-0/+2
2018-04-28Add `-C target-feature` to all functionsAlex Crichton-0/+19
Previously the features specified to LLVM via `-C target-feature` were only reflected in the `TargetMachine` but this change *also* reflects these and the base features inside each function itself. This change matches clang and... Closes rust-lang-nursery/stdsimd#427
2018-04-28Mark functions returning uninhabited types as noreturnAnthony Ramine-6/+16
2018-04-28Auto merge of #50164 - nox:rval-range-metadata, r=eddybbors-0/+29
Emit range metadata on calls returning scalars (fixes #50157)
2018-04-28Auto merge of #50295 - SergioBenitez:master, r=alexcrichtonbors-24/+18
Don't feature gate bang macros on 'proc_macro_path_invoc'. Fixes oversight from #50120.
2018-04-28Auto merge of #50155 - est31:label_expressions, r=petrochenkovbors-0/+37
'label can start expressions ```Rust let foo = 'label: loop { break 'label 42; }; ``` is valid Rust code.
2018-04-28Track unused mutable variables across closuresKeith Yeung-18/+99
2018-04-27Don't feature gate bang macros on 'proc_macro_path_invoc'.Sergio Benitez-24/+18
2018-04-28Auto merge of #50149 - aaronaaeng:master, r=estebankbors-0/+184
Added warning for unused arithmetic expressions The compiler now displays a warning when a binary arithmetic operation is evaluated but not used. This resolves #50124 by following the instructions outlined in the issue. The changes are as follows: - Added new pattern matching for unused arithmetic expressions in `src/librustc_lint/unused.rs` - Added `#[must_use]` attributes to the binary operation methods in `src/libcore/internal_macros.rs` - Added `#[must_use]` attributes to the non-assigning binary operators in `src/libcore/ops/arith.rs`
2018-04-28Make `trait_of_item` return None for non associated itemsShotaro Yamada-0/+33
It have returned `Some` for constants in a trait definition, and `Instance::resolve` called `tcx.associated_item` for them, causing ICE.
2018-04-27Auto merge of #49822 - matthewjasper:dropck-closures, r=nikomatsakisbors-30/+72
Access individual fields of tuples, closures and generators on drop. Fixes #48623, by extending the change in #47917 to closures. Also does this for tuples and generators for consistency. Enums are unchanged because there is now way to borrow `*enum.field` without borrowing `enum.field` at the moment, so any error would be reported when the enum goes out of scope. Unions aren't changed because unions they don't automatically drop their fields. r? @nikomatsakis
2018-04-28Rollup merge of #50257 - estebank:fix-49560, r=nikomatsakiskennytm-1/+22
Don't ICE on tuple struct ctor with incorrect arg count Fix #49560.
2018-04-27Access individual fields of tuples, closures and generators on drop.Matthew Jasper-30/+72
2018-04-28Rollup merge of #50273 - Amanieu:issue-49532, r=alexcrichtonkennytm-27/+44
Allow #[inline] on closures Fixes #49632
2018-04-28Rollup merge of #49968 - christianpoveda:stabilize_dyn, r=nikomatsakiskennytm-194/+140
Stabilize dyn trait This PR stabilizes RFC 2113. I followed the [stabilization guide](https://forge.rust-lang.org/stabilization-guide.html). Related issue: https://github.com/rust-lang/rust/issues/49218
2018-04-27fixed testsChristian Poveda-18/+12