about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2017-11-05Relax #[deny(warnings)] in some crate for cargotestLukas Kalbertodt-0/+2
Otherwise changes to the compiler are unable to introduce new warnings: some crates tested by cargotest deny all warnings and thus, the CI build fails. Thanks SimonSapin for the patch!
2017-11-04Remove import of now unused AsciiExtLukas Kalbertodt-3/+1
I also replaced a wildcard import with a specific one, while I was at it.
2017-11-03Mark several ascii methods as unstable againLukas Kalbertodt-40/+88
We don't want to stabilize them now already. The goal of this set of commits is just to add inherent methods to the four types. Stabilizing all of those methods can be done later.
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-21/+10
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-11-03Copy `AsciiExt` methods to `str` directlyLukas Kalbertodt-5/+290
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature this commit depends on: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-03Copy `AsciiExt` methods to `[u8]` directlyLukas Kalbertodt-0/+219
This is done in order to deprecate AsciiExt eventually. Note that this commit contains a bunch of `cfg(stage0)` statements. This is due to a new compiler feature I am using: the `slice_u8` lang item. Once this lang item is available in the stage0 compiler, all those cfg flags (and more) can be removed.
2017-11-03Add a lang item to allow `impl [u8] {…}` in the standard librarySimon Sapin-0/+11
2017-11-03Fix lists in doc comments for ascii methods of u8 and charLukas Kalbertodt-4/+8
2017-11-03Add missing space in match armLukas Kalbertodt-2/+2
2017-11-03Tweak documentation for `u8::eq_ignore_ascii_case()`Lukas Kalbertodt-2/+1
2017-11-03Remove examples in doc-comments of `AsciiExt` methodsLukas Kalbertodt-319/+48
The doc comments were incorrect before: since the inherent ascii methods shadow the `AsciiExt` methods, the examples didn't use the `AsciiExt` at all. Since the trait will be deprecated soon anyway, the easiest solution was to remove the examples and already mention that the methods will be deprecated in the near future.
2017-11-03Use direct implementation on u8/char to implement AsciiExtLukas Kalbertodt-280/+41
The methods were copied to u8/char, so we can just use it in AsciiExt impls to avoid duplicate code.
2017-11-03Copy `AsciiExt` methods to `char` directlyLukas Kalbertodt-3/+501
This is done in order to deprecate AsciiExt eventually.
2017-11-03Revert signature of eq_ignore_ascii_case() to originalLukas Kalbertodt-3/+3
Since the methods on u8 directly will shadow the AsciiExt methods, we cannot change the signature without breaking everything. It would have been nice to take `u8` as argument instead of `&u8`, but we cannot break stuff! So this commit reverts it to the original `&u8` version.
2017-11-03Make ascii methods on u8 insta-stableLukas Kalbertodt-48/+16
Those methods will shadow the methods of `AsciiExt`, so if we don't make them insta-stable, everyone will hitting stability errors. It is fine adding those as stable, because they are just being moved around [according to sfackler][1]. OPEN QUESTION: this commit also stabilizes the `AsciiExt` methods that were previously feature gated by the `ascii_ctype` feature. Maybe we don't want to stablilize those yet. [1]: https://github.com/rust-lang/rust/pull/44042#issuecomment-329939279
2017-11-03Add all methods of AsciiExt to u8 directlyLukas Kalbertodt-1/+656
This is the first step in order to deprecate AsciiExt. Since this is a WIP commit, there is still some code duplication (notably the static arrays) that will be removed later.
2017-11-03Fix broken link in `build-powerpc64le-toolchain.sh`kennytm-3/+3
2017-11-03Auto merge of #45484 - oli-obk:lint_names, r=nikomatsakisbors-68/+145
Report lint names in json diagnostics This allows tools like `rustfix` to have whitelists for what to automatically apply and what not.
2017-11-02Auto merge of #45409 - tamird:suggest-match-default-bindings, r=nikomatsakisbors-21/+74
typeck: suggest use of match_default_bindings feature Fixes #45383. Updates #42640. r? @nikomatsakis cc @tschottdorf This needs a UI test, but thought I'd get some early feedback.
2017-11-02Auto merge of #45647 - nrc:rls-bugs, r=eddybbors-2/+14
save-analysis: support unions r? @eddyb
2017-11-02Make the difference between lint codes and error codes explicitOliver Schneider-69/+143
2017-11-02Report lint names in json diagnosticsOliver Schneider-2/+5
2017-11-02Auto merge of #45630 - joshleeb:iss35241, r=estebankbors-13/+70
Improve display of error E0308 Ref. Forgetting to call a variant constructor causes a confusing error message #35241. This PR modifies [`note_type_err`](https://github.com/rust-lang/rust/blob/b7041bfab3a83702a8026fb7a18d8ea7d54cc648/src/librustc/infer/error_reporting/mod.rs#L669-L674) to display a `help` message when a `TyFnPtr` or `TyFnDef` are found and the return type, of the function or function pointer, is the same as the type that is expected. The output of compiling ```rust struct Foo(u32); fn test() -> Foo { Foo } fn main() {} ``` is now ```bash $ rustc src/test/ui/issue-35241.rs error[E0308]: mismatched types --> src/test/ui/issue-35241.rs:13:20 | 13 | fn test() -> Foo { Foo } | --- ^^^ expected struct `Foo`, found fn item | | | expected `Foo` because of return type | = help: did you mean `Foo { /* fields */ }`? = note: expected type `Foo` found type `fn(u32) -> Foo {Foo::{{constructor}}}` error: aborting due to previous error ```
2017-11-02Auto merge of #45468 - Xanewok:crate-source, r=nrcbors-42/+35
Emit crate disambiguators in save-analysis data Needed for https://github.com/nrc/rls-analysis/issues/93. Blocked by https://github.com/nrc/rls-data/pull/11. (For now, this pulls my branch [rls-data/crate-source](https://github.com/Xanewok/rls-data/tree/crate-source)) This will allow to disambiguate different crates types/versions when indexing resulting save-analysis data (most importantly allow to support bin+lib and different crate versions). r? @nrc
2017-11-02Auto merge of #45306 - whitequark:ref_slice, r=alexcrichtonbors-0/+19
Bring back slice::ref_slice as slice::from_ref. These functions were deprecated and removed in 1.5, but such simple functionality shouldn't require using unsafe code, and it isn't cluttering libstd too much. The original removal was quite contentious (see #27774), since then we've had precedent for including such nuggets of functionality (see rust-lang/rfcs#1789), and @nikomatsakis has provided a lot of use cases in https://github.com/rust-lang/rfcs/pull/1789#issuecomment-314640034. Hence this PR. I'm not too sure what to do with stability, feel free to correct me. It seems pointless to go through stabilization for these functions though. cc @aturon
2017-11-01De-stabilize core::slice::{from_ref, from_ref_mut}.whitequark-3/+4
2017-11-01Auto merge of #45538 - nikomatsakis:nll-liveness, r=pnkfelixbors-622/+2102
enable non-lexical lifetimes in the MIR borrow checker This PR, joint work with @spastorino, fills out the NLL infrastructure and integrates it with the borrow checker. **Don't get too excited:** it includes still a number of hacks (the subtyping code is particularly hacky). However, it *does* kinda' work. =) The final commit demonstrates this by including a test that -- with both the AST borrowck and MIR borrowck -- reports an error by default. But if you pass `-Znll`, you only get an error from the AST borrowck, demonstrating that the integration succeeds: ``` struct MyStruct { field: String } fn main() { let mut my_struct = MyStruct { field: format!("Hello") }; let value = &my_struct.field; if value.is_empty() { my_struct.field.push_str("Hello, world!"); //~^ ERROR cannot borrow (Ast) } } ```
2017-11-01Auto merge of #45472 - michaelwoerister:incr-comp-caching-base, r=nikomatsakisbors-150/+707
incr.comp.: Implement compiler diagnostic persistence. This PR implements storing and loading diagnostics that the compiler generates and thus allows for emitting warnings during incremental compilation without actually re-evaluating the thing the warning originally came from. It also lays some groundwork for storing and loading type information and MIR in the incr. comp. cache. ~~It is still work in progress:~~ - ~~There's still some documentation to be added.~~ - ~~The way anonymous queries are handled might lead to duplicated emissions of warnings. Not sure if there is a better way or how frequent such duplication would be in practice.~~ Diagnostic message duplication is addressed separately in #45519. r? @nikomatsakis
2017-11-01Auto merge of #45435 - eddyb:binop-subtype-lhs, r=nikomatsakisbors-74/+156
rustc_typeck: use subtyping on the LHS of binops. Fixes #45425. r? @nikomatsakis
2017-11-01Auto merge of #45674 - kennytm:rollup, r=kennytmbors-60/+220
Rollup of 14 pull requests - Successful merges: #45450, #45579, #45602, #45619, #45624, #45644, #45646, #45648, #45649, #45650, #45652, #45660, #45664, #45671 - Failed merges:
2017-11-01Rollup merge of #45671 - est31:master, r=alexcrichtonkennytm-0/+20
Tidy: track rustc_const_unstable feature gates as well This is important for the unstable book stub generation.
2017-11-01Rollup merge of #45664 - mbrubeck:docs, r=estebankkennytm-4/+5
Fix incorrect error type in Read::byte docs None
2017-11-01Rollup merge of #45660 - Cldfire:suggest-rename-import, r=estebankkennytm-3/+61
Suggest renaming import if names clash Closes https://github.com/rust-lang/rust/issues/32354. The output for the example in the issue looks like this: ``` ~/p/local-rust-dev-testing ❯❯❯ cargo +local-s1 build Compiling local-rust-dev-testing v0.1.0 (file:///home/cldfire/programming_projects/local-rust-dev-testing) error[E0252]: the name `ConstructorExtension` is defined multiple times --> src/main.rs:49:5 | 48 | use extension1::ConstructorExtension; | -------------------------------- previous import of the trait `ConstructorExtension` here 49 | use extension2::ConstructorExtension; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ConstructorExtension` reimported here | = note: `ConstructorExtension` must be defined only once in the type namespace of this module help: You can use `as` to change the binding name of the import | 49 | use extension2::ConstructorExtension as OtherConstructorExtension; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... ``` This is my first PR that touches the compiler in any way, so if there's something else I need to do here (e.g. add a test), please let me know :).
2017-11-01Rollup merge of #45652 - malbarbo:x32-2, r=alexcrichtonkennytm-1/+3
More fixes for x86_64-unknown-linux-gnux32 This update libc (all libc testing are passing) and fixes NR_GETRANDOM. Fix all but one run-pass test (lto-unwind.rs, see https://github.com/rust-lang/rust/issues/45416)
2017-11-01Rollup merge of #45650 - michaelwoerister:per-crate-type-symbol-threshold, ↵kennytm-3/+13
r=alexcrichton Take crate-type into account when generating symbol export lists (linker version scripts) r? @alexcrichton cc https://github.com/rust-lang/rust/issues/45613
2017-11-01Rollup merge of #45649 - tbu-:pr_doc_bufread_eof, r=estebankkennytm-0/+4
Add a hint what `BufRead` functions do on EOF
2017-11-01Rollup merge of #45648 - tbu-:pr_doc_unix_ext, r=estebankkennytm-2/+8
Update doc comment for the Unix extension module It was a bit outdated, claimed to be able to do less than it actually could.
2017-11-01Rollup merge of #45646 - sinkuu:dead-code-alias-in-pat, r=arielb1kennytm-6/+24
Count type aliases used in patterns as usage by dead_code lint Fixes #45614.
2017-11-01Rollup merge of #45644 - zackmdavis:edit_disallowed_inner_attr_note, r=estebankkennytm-7/+5
edit and fix bad spacing of inner-attribute-not-allowed note This multiline string literal was missing a backslash, leaving an awkward newline and 35 spaces in the middle of the message. But while we're here, the existing message seems kind of long in comparison to similar notes: to cut it down, we excise the mentions of doc comments, which seems sensible because we know that this erroneous attribute is not a doc comment (notice the `is_sugared_doc: false` at the end of the function; if it had been a doc comment, that error would get set in the `token::DocComment` match branch of `parse_outer_attributes`).
2017-11-01Rollup merge of #45624 - glaubitz:bootstrap-sparc64, r=kennytmkennytm-1/+1
bootstrap: Add missing cputype matching for sparc64 Trying to configure rust natively on sparc64-unknown-linux-gnu currently fails with: ``` root@deb4g:/local_scratch/glaubitz/rust/rust# ./configure --host=sparc64-unknown-linux-gnu --enable-local-rust --local-rust-root=/usr/local configure: processing command line configure: configure: build.host := ['sparc64-unknown-linux-gnu'] configure: build.rustc := /usr/local/bin/rustc configure: build.cargo := /usr/local/bin/cargo configure: build.rustc := /usr/local/bin/rustc configure: build.cargo := /usr/local/bin/cargo configure: build.configure-args := ['--host=sparc64-unknown-linux-gnu', '--enable ... unknown cpu type: sparc64 root@deb4g:/local_scratch/glaubitz/rust/rust# ``` This is trivially fixed by defining sparc64 as a valid cputype.
2017-11-01Rollup merge of #45619 - mneumann:fix-bootstrap-dragonfly, r=alexcrichtonkennytm-0/+1
Support Dragonfly when building Openssl
2017-11-01Rollup merge of #45602 - petrochenkov:ospan, r=michaelwoeristerkennytm-30/+58
Optimize some span operations Do not decode span data twice/thrice/etc unnecessarily. Applied to stable hashing and all methods in `impl Span`. Follow up to https://github.com/rust-lang/rust/pull/44646 r? @michaelwoerister
2017-11-01Rollup merge of #45579 - ↵kennytm-2/+6
leodasvacas:document-that-call-can-be-adt-constructor, r=estebank Document that call expressions also represent ADT constructors. This is a rather obscure part of the language.
2017-11-01Rollup merge of #45450 - GuillaumeGomez:overlap-link, r=QuietMisdreavuskennytm-1/+11
Fix title heading overlap in rust doc Fixes #45158. To be noted that this margin only appears when a title is the first element. <img width="1440" alt="screen shot 2017-10-22 at 16 08 44" src="https://user-images.githubusercontent.com/3050060/31862746-6411070e-b743-11e7-9a75-4159e1f7f1d6.png"> r? @rust-lang/docs
2017-11-01Auto merge of #45267 - oconnor663:rwlock_send, r=alexcrichtonbors-1/+1
remove the `T: Sync` requirement for `RwLock<T>: Send` That requirement makes sense for containers like `Arc` that don't uniquely own their contents, but `RwLock` is not one of those. This restriction was added in https://github.com/rust-lang/rust/commit/380d23b5d4b9fb8f5f0ebf178590f61528b2483e, but it's not clear why. @hniksic and I [were discussing this on reddit](https://www.reddit.com/r/rust/comments/763o7r/blog_posts_introducing_lockfree_rust_comparing/dobcvbm/). I might be totally wrong about this change being sound, but I'm super curious to find out :)
2017-11-01Auto merge of #45187 - GuillaumeGomez:doc-ui-improvement, r=QuietMisdreavusbors-48/+142
Improve sidebar rendering and add methods list I suppose it can be reviewed as is, but this is just the first step of a more global plan. cc @rust-lang/docs @nical And a screenshot of course: <img width="1440" alt="screen shot 2017-10-10 at 23 38 45" src="https://user-images.githubusercontent.com/3050060/31412170-657beaf6-ae14-11e7-9f01-1e562a034595.png">
2017-11-01Update rls so it compiles with #45468Igor Matuszewski-37/+11
2017-10-31Add UI testCldfire-0/+38
2017-11-01Improve display of error E0308 for structsJosh Leeb-du Toit-13/+70
Improve the display of error E0308 for structs by adding a "did you mean" span label.
2017-10-31Auto merge of #44764 - nvzqz:master, r=alexcrichtonbors-0/+86
Implement TryFrom<&[T]> for &[T; N] There are many cases where a buffer with a static compile-time size is preferred over a slice with a dynamic size. This allows for performing a checked conversion from `&[T]` to `&[T; N]`. This may also lead to compile-time optimizations involving `[T; N]` such as loop unrolling. This is my first PR to Rust, so I'm not sure if discussion of this change should happen here or does it need its own RFC? I figured these changes would be a subset of #33417.