- 07 12月, 2017 1 次提交
-
-
由 Jonathan Strong 提交于
the use of lazily evaluated alternatives when appropriate. These comments are intended to echo a clippy lint on the same topic (see https://rust-lang-nursery.github.io/rust-clippy/master/index.html#or_fun_call)
-
- 03 11月, 2017 2 次提交
-
-
由 bors 提交于
Report lint names in json diagnostics This allows tools like `rustfix` to have whitelists for what to automatically apply and what not.
-
由 bors 提交于
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.
-
- 02 11月, 2017 8 次提交
-
-
由 Oliver Schneider 提交于
-
由 Oliver Schneider 提交于
-
由 bors 提交于
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 ```
-
由 bors 提交于
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
-
由 bors 提交于
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
-
由 whitequark 提交于
-
由 bors 提交于
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) } } ```
- 01 11月, 2017 29 次提交
-
-
由 bors 提交于
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
-
由 bors 提交于
rustc_typeck: use subtyping on the LHS of binops. Fixes #45425. r? @nikomatsakis
-
由 bors 提交于
Rollup of 14 pull requests - Successful merges: #45450, #45579, #45602, #45619, #45624, #45644, #45646, #45648, #45649, #45650, #45652, #45660, #45664, #45671 - Failed merges:
-
由 kennytm 提交于
Tidy: track rustc_const_unstable feature gates as well This is important for the unstable book stub generation.
-
由 kennytm 提交于
Fix incorrect error type in Read::byte docs None
-
由 kennytm 提交于
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 :).
-
由 kennytm 提交于
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)
-
由 kennytm 提交于
Take crate-type into account when generating symbol export lists (linker version scripts) r? @alexcrichton cc https://github.com/rust-lang/rust/issues/45613
-
由 kennytm 提交于
Add a hint what `BufRead` functions do on EOF
-
由 kennytm 提交于
Update doc comment for the Unix extension module It was a bit outdated, claimed to be able to do less than it actually could.
-
由 kennytm 提交于
Count type aliases used in patterns as usage by dead_code lint Fixes #45614.
-
由 kennytm 提交于
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`).
-
由 kennytm 提交于
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.
-
由 kennytm 提交于
Support Dragonfly when building Openssl
-
由 kennytm 提交于
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
-
由 kennytm 提交于
Document that call expressions also represent ADT constructors. This is a rather obscure part of the language.
-
由 kennytm 提交于
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
-
由 bors 提交于
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 :)
-
由 bors 提交于
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">
-
由 Igor Matuszewski 提交于
-
由 Cldfire 提交于
-
由 Josh Leeb-du Toit 提交于
Improve the display of error E0308 for structs by adding a "did you mean" span label.
-
由 bors 提交于
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.
-
由 est31 提交于
This is kind of a hack but it works...
-
由 est31 提交于
This is important for the unstable book stub generation.
-
由 Matt Brubeck 提交于
-
-
由 Niko Matsakis 提交于
-
由 Cldfire 提交于
-