Read rust-lang rfcs everyday.
The Rust package manager
cargo, make me a project
Cranelift code generator
Memory Efficient Serialization Library
Rust bindings to MaskedVByte
Common configurations for Neovim Language Servers
Defines the Rust borrow checker.
push eventcsmoe/rust
commit sha 00d537dcd03f9ff5ebdf8b86e039dbdb0a7f850c
deny(unsafe_op_in_unsafe_fn) in libstd/path.rs
commit sha 73ada2d40429488aaaacf37b608bababc137b910
Explicitly document the size guarantees that Option makes. Triggered by a discussion on wg-unsafe-code-guidelines about which layouts of `Option<T>` one can guarantee are optimised to a single pointer.
commit sha f5118a525fcf9db4102d903650331039158eff11
Clarify and add guarantee about `transmute`.
commit sha 83f47aa11bd664ed8a15ef9833063833b7b3e71c
Be clear about the reverse `transmute` guarantees.
commit sha f3d7196caec3f54e572c7389b1cef9fd9e62c1ed
Be clearer about Some/None transmute.
commit sha 8cb8955d570c76631840bfc98825ca49c0dd8eea
Change notation. Co-authored-by: Ralf Jung <[email protected]>
commit sha 55802e3bf3bf6d1db5c76aea581a7912bd752890
Add Rust function pointers. Co-authored-by: Ralf Jung <[email protected]>
commit sha 68209c3fe4e0f5c3758f18e98efc175af31c2e51
Rename the types for clarity.
commit sha 9bac5774d7b452b2227c9fb77a4c6de3f432ee55
Grammar tweak.
commit sha c5975e9b6c5781b3b7300b7921c14b060086e1c1
Reduce duplicate in liballoc reserve error handling
commit sha 459969f88ff95c94b7b34043a7f0e13de91de4f8
added restriction lint that prohibits the usage of unimplemented, unreachable or panic in a function of type result or option
commit sha ceab1a9167655eba9f9556f8766f8702e49dfef3
removed unnecessary comment
commit sha 8462cce96081b87eba7a5bc89130a1a09fe1f6d0
edited documentation
commit sha b2d8ca9a766703469178ea37d4d46067bb6fa926
ran cargo dev update lints
commit sha b006522393a3c3c2656e1ccdfbb0076ff1bd7e99
added lint for todo and removed option
commit sha a424a2c1676a29c147252873037e8943d54941d3
changed check_impl_item to check_fn and added a few more test cases
commit sha 73a3288282e733bfc5893e9920d29f1de5a21591
uncommented fn
commit sha 27c90b881df93b53fd3f24dcbfed116379c2fc69
initial implementation of OpenOptions to c_int
commit sha eb3906be4ad375cc6b83cd6a6e0116817db22575
Fix typo get openoptions function name Co-authored-by: Ivan Tham <[email protected]>
commit sha 0f2bd56b29857453835e47abbe96a80b175632d1
lint/ty: move fns to avoid abstraction violation This commit moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types. Signed-off-by: David Wood <[email protected]>
push time in 19 hours
PR closed rust-lang/cargo
r? @ehuss
pr closed time in 11 days
pull request commentrust-lang/cargo
add build time to buildfinished summary
I agree, it's easy to get the build time with time::Instant
comment created time in 11 days
push eventcsmoe/rust
commit sha fd985e29dd97f053f31a2e282fb59363f6b6db3f
cannot have divergence -> cannot diverge
commit sha 0d9a2abe698e84c8b3c473659db321606d7d5c02
It's only an issue without an `impl Trait for !`
commit sha 26eab6a0d51b9a023471210e35fdec969c662363
Specify `0` of type `u32`
commit sha 80dcad9e5b060ba6f9e06499c799423037ce7733
Be more specific about polymorphic return types I no longer say "polymorphic" since it's a bit ambiguous here.
commit sha bd3196282ba61ba284f4e176db3537f61b11892c
other branch -> `else` branch
commit sha 1663bfba02b7c1545a3c241b6b08cc9d9b97c475
Fix matching on field.abi instead of self.layout.abi
commit sha b3d7b7bdcbea782d15a34861acfb8c4bdb1b96c1
update fixmes
commit sha 1d017eb6a4602d18ccae9e8dfcc209fb8382982e
Fix env doc vars_os broken link
commit sha e885f00f24aab657b3a9835818fc96e638e7fb21
Comment out test for generated docs until rustdoc changes its behavior around documenting re-exports
commit sha e0822ecdbc43a6128136661bb73fb6f3c3db2b4a
rustdoc: do not use plain summary for trait impls Fixes #38386. Fixes #48332. Fixes #49430. Fixes #62741. Fixes #73474.
commit sha 98232ece14bdd68aeac3d761039d9a7c88c30b3f
fix broken trait method links
commit sha d7150154fa5c35c0b570570f156ba3a5cc6dfb1d
Improve tests Now this actually tests the links are generated correctly
commit sha a97dcfa3755990062fd7905370cddd3843541db0
Run cfg-stripping on generic parameters before invoking derive macros Fixes #75930 This changes the tokens seen by a proc-macro. However, ising a `#[cfg]` attribute on a generic paramter is unusual, and combining it with a proc-macro derive is probably even more unusual. I don't expect this to cause any breakage.
commit sha 149307efb742bf25fc1c8da85f1e6560691ba3dd
Improve `BitSet` APIs A few small cleanups to `BitSet` and friends: - Overload `clone_from` for `BitSet`. - Improve `Debug` represenation of `HybridBitSet`. - Make `HybridBitSet::domain_size` public. - Don't require `T: Idx` at the type level. The `Idx` bound is still on most `BitSet` methods, but like `HashMap`, it doesn't need to be satisfied for the type to exist.
commit sha a88dc37c54fa7ed2d1758d06508223677b65d387
Add `regex` dependency to `librustc_mir`
commit sha 9e45e90596faf6e741665d1c4ff6b94ad3885dbe
Allow access to the underlying `Results` from a `ResultsCursor`
commit sha 3233fb18a891363a2da36ce69ca16fbb219c96be
Extend dataflow framework to support arbitrary lattices
commit sha b19b8ea6113a6e912d508c11a25567b05d7db54c
Update dataflow analyses to use new interface
commit sha c03eba2d0833a21205b00e4b71e920df709a2658
Add `FIXME` for faster cached block transfer functions I've tried a few ways of implementing this, but each fell short. Adding an auxiliary `_Idx` associated type to `Analysis` that defaults to `!` but is overridden in the blanket impl of `Analysis` for `A: GenKillAnalysis` to `A::Idx` seems promising, but the trait solver is unable to prove equivalence between `A::Idx` and `A::_Idx` within the overridden version of `into_engine`. Without full-featured specialization, removing `into_engine` or splitting it into a different trait would have a significant ergonomic penalty. Alternatively, we could erase the index type and store a `GenKillSet<u32>` as well as a function pointer for transmuting between `&mut A::Domain` and `&mut BitSet<u32>` in the hopes that LLVM can devirtualize a simple function pointer better than the boxed closure. However, this is brittle, requires `unsafe` code, and doesn't work for index types that aren't the same size as a `u32` (e.g. `usize`) since `GenKillSet` stores a `HybridBitSet`, which may be a `Vec<I>`. Perhaps safe transmute could help here?
commit sha 1c5b0fbe53f842cd5871ea02e4e48571615d5679
Update dataflow analyses to use new interface
push time in 12 days
PR opened rust-lang/cargo
r? @ehuss
pr created time in 15 days
push eventcsmoe/cargo
commit sha 8132e2a9573e1e155644c42e9838a15605d9f019
add build time to buildfinished summary
push time in 15 days
push eventcsmoe/cargo
commit sha 02460eac5415f103f1bceb08b5ff156efaedfa07
Add `rustless.org` to documented blocklist. Sibling PR to rust-lang/crates.io#2202
commit sha a2cddeeb9fc74e0e4394e1f699a7246a73bebdd2
Ignore broken Cargo.toml in git sources Commit 3d6de4177489a5d450f35e92288512be85492678 (#3998) made cargo ignore Cargo.toml files that are invalid TOML in a git source. This change further ignores Cargo.toml files that are valid TOML but cannot really be loaded. This is potentially an alternative fix for #6822.
commit sha 298b7703ee6b1b992c921e7528ea37a508b96676
Add more fingerprint mtime debug logging.
commit sha b786f85fa40aa708d34ef587d18f43baa0bd6b88
Fix plugin tests for latest nightly.
commit sha cc5a5e5b775f1863b89610c7284b25f605c528d9
Auto merge of #7955 - ehuss:fix-plugin-syntax-rename, r=alexcrichton Fix plugin tests for latest nightly. Crate was renamed in https://github.com/rust-lang/rust/pull/69592.
commit sha 860d299732dd20af1c48c854961feb2d1e72579a
Auto merge of #7952 - ehuss:fingerprint-mtime-debug-extra, r=alexcrichton Add more fingerprint mtime debug logging. Adding some more debug logging on top of #7888. There was a mistake in the original PR, where `dep.pkg_id` should have been `dep.name`.
commit sha ac2eb69346e9ae4adedb90ce03b5f23d2a837e28
Auto merge of #7947 - quark-zju:ignore-broken-git, r=ehuss Ignore broken Cargo.toml in git sources Commit 3d6de4177489a5d450f35e92288512be85492678 (#3998) made cargo ignore Cargo.toml files that are invalid TOML in a git source. This change further ignores Cargo.toml files that are valid TOML but cannot really be loaded in a git source. This is potentially an alternative fix for #6822.
commit sha f2c8070df5a4703d5cb8da8f3dab21d8c612bd25
Fix rare failure in collision_export test.
commit sha bda50510d1daf6e9c53ad6ccf603da6e0fa8103f
Auto merge of #7956 - ehuss:fix-collision-test, r=alexcrichton Fix rare failure in collision_export test. Seen once on CI in #7952 (https://dev.azure.com/rust-lang/cargo/_build/results?buildId=22112&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=d4864165-4be3-5e34-b483-a6b05303aa68). I was able to reproduce it locally, though it is rare. There seems to be some kind of race issue on macOS with two processes trying to symlink the same directory at the same time. The solution is to serialize the build so they don't run at the same time.
commit sha 95008f91e50a05be1f0eecd06643506197cd29b8
Try to better handle restricted crate names.
commit sha 15ac82b677a7055c3e67fa06fd32e8446b2b377f
Warn on Windows about reserved target names.
commit sha 2a874aa522f228735da87353646c39981ff10fab
Warn when packaging files with Windows special names.
commit sha 887ee6cc70af53be1ecfc48a3436dff49c2d528e
Fix bug with new feature resolver and required-features.
commit sha 208e4997f38868155767fa47418134a9a7c3e203
Auto merge of #7962 - ehuss:features2-required-feature-inactive, r=alexcrichton Fix bug with new feature resolver and required-features. If required-features are used, then the code for checking those features would crash if a dependency was not activated. The solution here is to not be strict about only requesting activated packages. For context, the reason this can panic is to check for any bugs in the resolver or places that make bad assumptions. I missed this particular case, though.
commit sha 5fe8ab57e2a88ccaaab0821c306203eb19edf8fd
Auto merge of #7959 - ehuss:restricted-crate-names, r=alexcrichton Try to better handle restricted crate names. This attempts to improve handling of restricted crate names, particularly for `cargo new` and `cargo init`. Hopefully the code is straightforward to follow, but in summary the changes are: **General changes** * Add more details to the error messages about why a name is not allowed, and what is allowed. * Change the valid package name check to be restricted to Unicode XID. This brings it in line with non_ascii_idents support in rustc. For the most part, this is pretty much the same as before. Note: this is used for the package name, and registry names. The differences are: * Package names cannot start with numbers. Previously this was only rejected in `cargo new`. crates.io also rejects numbers. Numbers are also not valid crate names. * Package names cannot start with dash `-`. This is a somewhat arbitrary change, but seems like it would stem problems. crates.io also rejects this. * Package names cannot start with these characters that were previously allowed: https://gist.github.com/ehuss/804a797950001b5226e1264b6f65211f#file-not_start_but_alphanumeric-txt * Most of these are wacky numbers or other strange things. * Package names cannot contain these characters that were previously allowed: https://gist.github.com/ehuss/804a797950001b5226e1264b6f65211f#file-not_continue_but_alphanumeric-txt * These are mostly odd things that for whatever reason the Unicode people decided not to include. It seems unlikely to me that someone would want to use one of these. * Display a warning on Windows if a Cargo target is a special Windows filename. The build error tends to be hard to understand, so the hope is the warning will make it evident. * `cargo package/publish`: Warn if a special Windows name is in the package. **cargo new/init specific changes** * Update keyword list to 2018 edition. * Add warning if creating a library that has one of the conflicting names (deps/examples/build/incremental). * Warn about conflicting std names (core/std/alloc/proc-macro). * Windows reserved names: Rejected on windows, warned on other platforms. * Warn about non-ASCII package names. * Only print the `--name` suggestion for `cargo init`. I found the suggestion confusing, and I feel like it doesn't really make sense for `cargo new` (since it would only affect the directory name).
commit sha 9f07c83417f9c7bd2fec56b909dab1cafb8cc60a
Don't create hardlink for library test, integrations tests and benches, fixing #7960
commit sha 25b90e7990631cb792172c0c3904ac43b244b1e8
Revert "Disable preserving mtimes on archives" This reverts commit 8c92e88765817877f53a9cfb70c3e39853456868.
commit sha b8ab32ea31ba7b86c94aad041ead180ee0e63b73
Partially revert change to filter debug_assertions.
commit sha 94438758a3afee57f73dc0b48012b052c41edd87
Auto merge of #7970 - ehuss:revert-debug-assert-filter, r=alexcrichton Partially revert change to filter debug_assertions. This partially reverts the changes from #7943. It caused a regression with the rocket_contrib crate. I knew that was the only crate that had a `cfg(debug_assertions)` dependency, and I saw that it had been fixed, but I did not realize the fix hadn't been published (and will be in a semver incompatible release). This retains the old behavior for `cfg(debug_assertions)` of issuing a warning. I kept the filter for `CARGO_CFG_DEBUG_ASSERTIONS` for build scripts because that was the original intent for the change, and I don't see anyone using that. Closes #7966.
commit sha 43aafb416f027395b691d2cecb6445fa3452d73e
Auto merge of #7965 - jiegec:master, r=alexcrichton Don't create hardlink for library test and integrations tests, fixing #7960 Related issue: #7960 Problem: Tests are run under deps, but it is still copied to its parent directory. It leads to separation between the executable and its debug symbols (.dSYM directory). Solution: Set hardlink to None.
push time in 15 days
push eventcsmoe/polonius
commit sha 76849744384cdb89570d1d29a8b9e0881f6030e4
Remove `failure` from the `polonius` bin
commit sha 9f03e377f3f49eda431eb45e82cddfe11464249c
Remove unused `assert_cli` from the `polonius` bin dev-dependencies
commit sha 4b1829d8ea73f1f5cc06e6093d14110fb470de90
Switch from `clap` and `structopt` to `pico-args` in the `polonius` bin
commit sha 0aed05929c8c429c0517e479909c551757a3f6e6
Remove `env_logger` from the `polonius` bin
commit sha cca5db225f5584a015a9c032fbb0000e4a22511a
update `datafrog` dependency to avoid the rustdoc error
commit sha 1979ab07e4568bdc3b78f1a5b74a5b9ecba4d647
Improve `pico_args` error display
commit sha f51773b9a72d254d627f7c7ccc35a20f1d6770a3
`extern crate` is not necessary anymore
commit sha e27986211379b4555b1a7f4254544ccef291a3db
tweak unrecognized arguments error message
commit sha 8d6ecad416ea7bd2a3c132e3adb6c7d8c3a54d3b
Fix `--graphviz_file` naming for consistency
commit sha 8f4bfb854092aaa7d67681b7c20f9c1bfed642a6
oh rustfmt ignored the code in macros maybe we should remove this one
commit sha 86c96398b7615fbe9e8def943b15f1447aead260
Print an error when trying to load a fact file that is missing
commit sha 1b00de0ddf4f305bf8132b083337f7f7623cac03
introduce FactTypes trait
commit sha bd7c22533ea1a221ea3dd5865ab7a9a6cdddc2de
replace fact type parameters with FactTypes
commit sha 76896967c1719fefe0b0142ea9731e37c753af58
replace type parameters in polonius engine
commit sha 4cf4dbe6c6c8cf802ed1c9313ef1f94b803449aa
replace type parameters in polonius bin
commit sha 358b506a3899682a8167b54a495b6bc6d9103f05
Use the fx hasher when interning
commit sha b688fb571c6a228c4c6fd19a6c4232f4f5569824
Merge pull request #131 from lqd/EZ-winz easy win: use the fx hasher when interning
commit sha c9ecc9b99b224bfea88e85a9be7008f218aede31
Merge pull request #130 from csmoe/factypes replace fact type parameters with FactTypes
commit sha c78359a25f03756af9aa9c7197863a8b3c91b0b7
Merge pull request #128 from lqd/into_the_deps Dependencies cleanup
commit sha 1f31a28d86f4b2768a8c64d763344ff8838dd130
Merge pull request #129 from lqd/fix_clap Make clap usable, add warnings on missing fact files
push time in 24 days
push eventcsmoe/rust
commit sha c648e730786d1e5bda5b2c0eadc1be736ff235e3
replace function def_path with sym
push time in a month
push eventcsmoe/rust
commit sha 47c32ca7495a65e7c0d8d9c46c602c6c38cccc93
move stat to llvm codegen
push time in a month
issue commentrust-lang/rust
'Dropping temporaries' prevents borrow check to succeed in match arm without shared ownership
Not sure the scrutinee temporary case can be improved, but the error message should be more informative at least, reopen for better suggestion.
comment created time in a month
push eventcsmoe/rust
commit sha 6345f134b77022183df9ca5906939c018ef2b0b3
add testcase for issue-64552
push time in a month
issue closedrust-lang/rust
'Dropping temporaries' prevents borrow check to succeed in match arm without shared ownership
<!-- Thank you for filing a bug report! 🐛 Please provide a short summary of the bug, along with any information you feel relevant to replicating the bug. -->
I tried this code (playground link):
struct Owner {
to_be_shared: String,
}
impl Owner {
fn share(&mut self) -> Result<Box<dyn ToString + '_>, ()> {
Ok(Box::new(&self.to_be_shared) as Box<dyn ToString>)
}
fn do_something_else(&mut self) {}
}
fn use_owner(mut owner: Owner) {
let _v = match owner.share() {
Ok(v) => v,
Err(()) => {
owner.do_something_else();
return;
}
};
}
fn main() {
let owner = Owner {
to_be_shared: String::new(),
};
use_owner(owner);
}
I expected to see this happen:
The code compiles. Especially it's possible to call owner.do_something_else() in the match branch dealing with the error, which does not borrow from owner.
Instead, this happened:
rror[E0499]: cannot borrow `owner` as mutable more than once at a time
--> src/main.rs:16:13
|
13 | let _v = match owner.share() {
| -------------
| |
| first mutable borrow occurs here
| a temporary with access to the first borrow is created here ...
...
16 | owner.do_something_else();
| ^^^^^ second mutable borrow occurs here
...
19 | };
| - ... and the first borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<std::boxed::Box<dyn std::string::ToString>, ()>`
According to The Rust Reference:Destructors I believe the drop scope should be relative to each match arm, not according to the outer scope. It appears that Rust still wants to drop the Result<_, _> which is already dissolved in the match arm.
Also, if no destructor is involved, the code compiles as expected.
The issue first occurred in gitoxide, and here is theworkaround.
Meta
<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. -->
rustc --version --verbose:
rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-apple-darwin
release: 1.46.0
LLVM version: 10.0
rustc +nightly --version --verbose:
rustc 1.48.0-nightly (397b390cc 2020-08-27)
binary: rustc
commit-hash: 397b390cc76ba1d98f80b2a24a371f708dcc9169
commit-date: 2020-08-27
host: x86_64-apple-darwin
release: 1.48.0-nightly
LLVM version: 11.0
</p> </details>
closed time in a month
Byronissue commentrust-lang/rust
'Dropping temporaries' prevents borrow check to succeed in match arm without shared ownership
As you might notice in the reference, the scrutinee of match isn't a temporary scope, so temporary inside ower.share() will live until the end of match { ... }
comment created time in a month
issue closedrust-lang/rust
`Mismatched type` when trying to use async fns with feature(type_alias_impl_trait)
I've been playing around with this feature and found some surprising behavior. I'm not sure if it's by design or a bug, but it looks like very surprising/counterintuitive behavior for me, so I thought I'd share it here.
Given this:
type FutureType = impl Future<Output=u32>;
fn consume(_: FutureType) { }
async fn my_future() -> u32 { 123 }
why doesn't this compile? (playground)
//error: could not find defining uses
fn main() {
consume(my_future()); //error[E0308]: mismatched types
}
It seems to me that calling a function taking a FutureType with my_future() should count as a "defining use", allowing rust to infer that both types are equal. It certainly does for "normal" type inference (playground):
fn consume(_: impl Future<Output=u32>) { }
fn main() {
consume(my_future());
}
It does compile when telling the compiler the types are the same via a return type: (playground)
fn create() -> FutureType { my_future() }
fn main() {
consume(create());
}
Also quite surprisingly, after adding this "defining use", you still can't pass my_future() directly to consume. As I understand it, they should be the same the same type now, but for some reason the compiler is still considering them distinct types.(playground)
fn main() {
// ok
consume(create());
//error[E0308]: mismatched types
// note: expected opaque type `impl std::future::Future` (opaque type at <src/main.rs:4:19>)
// found opaque type `impl std::future::Future` (opaque type at <src/main.rs:6:25>)
// note: distinct uses of `impl Trait` result in different opaque types
consume(my_future());
}
closed time in a month
Dirbaioissue commentrust-lang/rust
`Mismatched type` when trying to use async fns with feature(type_alias_impl_trait)
They're distinct type indeed, the async function desugars to fn my_future() -> impl Future<Output=u32>, the compiler generates a hidden type for the return type(let's name it as AsyncFnReturn), AsyncFnReturn has nothing to do with the FutureType you defined.
for details, checkout https://github.com/rust-lang/rfcs/blob/master/text/2515-type_alias_impl_trait.md
comment created time in a month
PR opened rust-lang/rust
But I'm surprised that x.py test --stage 1 and CI didn't catch this.
r? @estebank
pr created time in a month
issue commentrust-lang/rust
ICE assertion failed: self.is_struct() || self.is_union()
sorry, my bad, and it's ./src/test/ui/async-await/issues/issue-61986.rs ?
comment created time in a month
issue commentrust-lang/rust
unexpected panic when trait not implemented
here is the unwrap to blame. https://github.com/rust-lang/rust/blob/6cc268e316d37d97fbdda6c1bf3e5a58dea470fe/src/librustc_mir/monomorphize/collector.rs#L722
comment created time in a month
pull request commentrust-lang/rust
Await on mismatched future types
@tmandry @estebank I query'fied the loop to finding Future::Output from predicates.
comment created time in a month
push eventcsmoe/rust
commit sha 7cfcefd1fbbbfefbdc88feb7359e6364d7c0bf8a
add projection_ty_from_predicates query
push time in a month
push eventcsmoe/rust
commit sha 8ee206a80dab320ee76a2aa9324c587368df3921
suggest await on unexpected types
push time in a month
issue commentrust-lang/rust
Index out of bounds in src/librustc_middle/ty/query/on_disk_cache.rs
@Thomasdezeeuw It'd be great with a minimal reproducible example.
comment created time in a month
push eventcsmoe/rust
commit sha 305c09f4913da8b388ed20bd9da5c0cc91060eac
suggest await on unexpected types
push time in a month
push eventcsmoe/rust
commit sha 230393993ffc255d3f20d98400c8a376bd51d1c0
Don't visit foreign function bodies when lowering ast to hir Previously the existence of bodies inside a foreign function block would cause a panic in the hir `NodeCollector` during its collection of crate bodies to compute a crate hash: https://github.com/rust-lang/rust/blob/e59b08e62ea691916d2f063cac5aab4634128022/src/librustc_middle/hir/map/collector.rs#L154-L158 The collector walks the hir tree and creates a map of hir nodes, then attaching bodies in the crate to their owner in the map. For a code like ```rust extern "C" { fn f() { fn g() {} } } ``` The crate bodies include the body of the function `g`. But foreign functions cannot have bodies, and while the parser AST permits a foreign function to have a body, the hir doesn't. This means that the body of `f` is not present in the hir, and so neither is `g`. So when the `NodeCollector` finishes the walking the hir, it has no record of `g`, cannot find an owner for the body of `g` it sees in the crate bodies, and blows up. Why do the crate bodies include the body of `g`? The AST walker has a need a for walking function bodies, and FFIs share the same AST node as functions in other contexts. There are at least two options to fix this: - Don't unwrap the map entry for an hir node in the `NodeCollector` - Modifier the ast->hir lowering visitor to ignore foreign function blocks I don't think the first is preferrable, since we want to know when we can't find a body for an hir node that we thought had one (dropping this information may lead to an invalid hash). So this commit implements the second option. Closes #74120
commit sha ab4275cddc3749caf9f20373eb812e6f09bd3309
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 68aca3baf6566cea3ad2f83a07726c9ee017b9fc
fixup! fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 0c64d32a4a439f373f388f7925048f6f349bd5b2
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha d442bf7162647743f941977a5154676322a5614b
fixup! Don't visit foreign function bodies when lowering ast to hir
commit sha 442c8ae23b90874485468b3becfc011f8c9d40bb
Fix FP for `suspicious_arithmetic_impl` from `suspicious_trait_impl` lint
commit sha 30659cd45ee01f5626aeef4bbe29c68536dc833d
older toolchains not valid any more with the change to llvm 10 the parameter LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN do not do any thing as min and soft error is the same. see https://github.com/rust-lang/llvm-project/blob/86b120e6f302d39cd6973b6391fb299d7bc22122/llvm/cmake/modules/CheckCompilerVersion.cmake
commit sha 51f2a6f8b6eea9ebefddff39e87a1ca16c59827c
Add documentation for basic Clippy hacking
commit sha 9b5a974bd5c398e5706e463045121b20f0f6abb9
Correctly parse `{} && false` in tail expression Fix #74233.
commit sha 17903f6d7107c6d31ee15f4c46af29d1f4aa363f
Mention lint naming guidelines earlier
commit sha 3a4cc9f7f085e73fbfe57e8c896b90a5fe61c4f4
Address review comments
commit sha b375f1dd20bf07175ec06d13e1e9dc8b20287cd3
Add suggestion for `iter_skip_next` lint
commit sha d164ab65f706540f0132268c8ad2237d2e53e08a
Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyup
commit sha f5d429cd762423901f946abd800dc2cd91366ccf
Auto merge of #5820 - ThibsG:FixSuspiciousArithmeticImpl, r=flip1995 Fix FP for `suspicious_arithmetic_impl` from `suspicious_trait_impl` … As discussed in #3215, the `suspicious_trait_impl` lint causes too many false positives, as it is complex to find out if binary operations are suspicious or not. This PR restricts the number of binary operations to at most one, otherwise we don't lint. This can be seen as very conservative, but at least FP can be reduced to bare minimum. Fixes: #3215 changelog: limit the `suspicious_arithmetic_impl` lint to one binop, to avoid many FPs
commit sha 8dc9d4d567dae3481a47ad677e263cb3bd57cdf5
[experiment] ty/layout: compute both niche-filling and tagged layouts for enums.
commit sha b34d3004914a1b6b2e7c91b2c41ac1af28745874
compare tagged/niche-filling layout and pick the best one
commit sha 144b1592e8186ab7c24212058bb2c897260897e3
document test changes
commit sha 5a644964fc05752a1283dab238b81de7583f7d03
run cargo dev new_lint specifically: cargo dev new_lint --name derive_ord_xor_partial_ord --category correctness --pass late
commit sha fc20ee63a105c0df78113126e8749f5958d7dc47
move derive_ord_xor_partial_ord into derive mod so we can reuse derive_hash_xor_partial_eq code later
commit sha 0722991b62fd6e4d7d7a51425274f3288bcc96bc
add test for derive_ord_xor_partial_ord based on test for derive_hash_xor_partial_eq
push time in a month
push eventcsmoe/rust
commit sha 829d69b9c6bfc535a92fc290ec9391a0d5af6c81
Auto merge of #74827 - ssomers:btree_cleanup_insert, r=Mark-Simulacrum Move bulk of BTreeMap::insert method down to new method on handle Adjust the boundary between the map and node layers for insertion: do more in the node layer, keep root manipulation and pointer dereferencing separate. No change in undefined behaviour or performance. r? @Mark-Simulacrum
commit sha 594f81a2b4dae23827271ea3a4bbb21c1a0004e1
Make rust.use-lld config option work with non MSVC targets
commit sha 0e44ed5ca9b1436c245a4660b04e76fd99be7420
Fix ui-cargo tests in CI
commit sha bbbc973a842fc515f9b22d10d103bbf2d7827697
Auto merge of #5864 - rust-lang:ci_debug, r=Manishearth Fix ui-cargo tests in CI r? @ebroto The `ui-toml` tests set the `CARGO_MANIFEST_DIR` var, but never reset it, so the `ui-cargo` tests used it also and then found a faulty `clippy.toml` file changelog: none
commit sha 25abd7ae76e2a708dda5487119c20af3be64edb7
Create stable_sort_primitive lint
commit sha e9677105bf85a2b0c57e8d67d2ed22a286333033
try_err: Consider Try impl for Poll when generating suggestions There are two different implementation of Try trait for Poll type; Poll<Result<T, E>> and Poll<Option<Result<T, E>>>. Take them into account when generating suggestions. For example, for Err(e)? suggest either return Poll::Ready(Err(e)) or return Poll::Ready(Some(Err(e))) as appropriate.
commit sha 92b1975eaaae0891cb8d5ed50fb7a17f37ce0b38
Added the missing SAFETY: comments
commit sha 0ccdf2913a335c4f0b34098f84baeeb3fc852255
Remove obsolete known problems unnecessary_fold
commit sha 6deda6a6a05e6e6ace8fb015d610c6355efb0fd7
Stabilize Ident::new_raw Tracking issue: #54723 This is a continuation of PR #59002
commit sha 0a88346be64d0c64771d72ada8583e5795416556
rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
commit sha 05f414b72a26b285c7a7f6c9632945ab567a9757
rustc_ast: More detailed docs for `Attribute::check_name`
commit sha 52a9c157d04808b61d245c251c223a81ae2dcb70
rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
commit sha d8cbd9caca648ecdb66ff4c945c060762aa6297f
Auto merge of #74526 - erikdesjardins:reftrack, r=Mark-Simulacrum Add track_caller to RefCell::{borrow, borrow_mut} So panic messages point at the offending borrow. Fixes #74472
commit sha 427634b5037ba1c00b72b70b561ff20767ea97e2
Avoid `unwrap_or_else` in str indexing This provides a small reduction of generated LLVM IR, and leads to a simpler assembly code.
commit sha 6395659168a760b31365e925dc5be5a201ac10ae
Apply suggestions from code review Co-authored-by: Amanieu d'Antras <[email protected]>
commit sha 1d601d6ff1879a20a25dda06b735cd44cd451f61
Auto merge of #74695 - alexcrichton:more-wasm-float-cast-fixes, r=nagisa rustc: Improving safe wasm float->int casts This commit improves code generation for WebAssembly targets when translating floating to integer casts. This improvement is only relevant when the `nontrapping-fptoint` feature is not enabled, but the feature is not enabled by default right now. Additionally this improvement only affects safe casts since unchecked casts were improved in #74659. Some more background for this issue is present on #73591, but the general gist of the issue is that in LLVM the `fptosi` and `fptoui` instructions are defined to return an `undef` value if they execute on out-of-bounds values; they notably do not trap. To implement these instructions for WebAssembly the LLVM backend must therefore generate quite a few instructions before executing `i32.trunc_f32_s` (for example) because this WebAssembly instruction traps on out-of-bounds values. This codegen into wasm instructions happens very late in the code generator, so what ends up happening is that rustc inserts its own codegen to implement Rust's saturating semantics, and then LLVM also inserts its own codegen to make sure that the `fptosi` instruction doesn't trap. Overall this means that a function like this: #[no_mangle] pub unsafe extern "C" fn cast(x: f64) -> u32 { x as u32 } will generate this WebAssembly today: (func $cast (type 0) (param f64) (result i32) (local i32 i32) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.gt local.set 1 block ;; label = @1 block ;; label = @2 local.get 0 f64.const 0x0p+0 (;=0;) local.get 0 f64.const 0x0p+0 (;=0;) f64.gt select local.tee 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@2;) local.get 0 i32.trunc_f64_u local.set 2 br 1 (;@1;) end i32.const 0 local.set 2 end i32.const -1 local.get 2 local.get 1 select) This PR improves the situation by updating the code generation for float-to-int conversions in rustc, specifically only for WebAssembly targets and only for some situations (float-to-u8 still has not great codegen). The fix here is to use basic blocks and control flow to avoid speculatively executing `fptosi`, and instead LLVM's raw intrinsic for the WebAssembly instruction is used instead. This effectively extends the support added in #74659 to checked casts. After this commit the codegen for the above Rust function looks like: (func $cast (type 0) (param f64) (result i32) (local i32) block ;; label = @1 local.get 0 f64.const 0x0p+0 (;=0;) f64.ge local.tee 1 i32.const 1 i32.xor br_if 0 (;@1;) local.get 0 f64.const 0x1.fffffffep+31 (;=4.29497e+09;) f64.le i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const -1 i32.const 0 local.get 1 select) For reference, in Rust 1.44, which did not have saturating float-to-integer casts, the codegen LLVM would emit is: (func $cast (type 0) (param f64) (result i32) block ;; label = @1 local.get 0 f64.const 0x1p+32 (;=4.29497e+09;) f64.lt local.get 0 f64.const 0x0p+0 (;=0;) f64.ge i32.and i32.eqz br_if 0 (;@1;) local.get 0 i32.trunc_f64_u return end i32.const 0) So we're relatively close to the original codegen, although it's slightly different because the semantics of the function changed where we're emulating the `i32.trunc_sat_f32_s` instruction rather than always replacing out-of-bounds values with zero. There is still work that could be done to improve casts such as `f32` to `u8`. That form of cast still uses the `fptosi` instruction which generates lots of branch-y code. This seems less important to tackle now though. In the meantime this should take care of most use cases of floating-point conversion and as a result I'm going to speculate that this... Closes #73591
commit sha cc0ac7eecebd57278974329d3610bb2512740ef8
Rollup merge of #74759 - carbotaniuman:uabs, r=shepmaster add `unsigned_abs` to signed integers Mentioned on rust-lang/rfcs#2914 This PR simply adds an `unsigned_abs` to signed integers function which returns the correct absolute value as a unsigned integer.
commit sha 262fce481dc60c348ba0436caabd4a824ecc412e
Rollup merge of #75043 - petrochenkov:hasname, r=nnethercote rustc_ast: `(Nested)MetaItem::check_name` -> `has_name` For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc, only rustc needs to mark attributes as used. cc https://github.com/rust-lang/rust/pull/74932 r? @nnethercote
commit sha 485bfa7a7581e05f08a42bef3878a392c461ddc5
Rollup merge of #75056 - Veykril:path_statements_lint, r=oli-obk Lint path statements to suggest using drop when the type needs drop Fixes #48852. With this change the current lint description doesn't really fit entirely anymore I think.
commit sha c2bc733d99b99a830239c553759ce7b59ffbc507
Rollup merge of #75081 - jyn514:fix-logging, r=Mark-Simulacrum Fix logging for rustdoc https://github.com/rust-lang/rust/pull/74726#issuecomment-667765557
push time in a month
push eventcsmoe/rust
commit sha a557dd334ad1c5ace30a6f200394305471683b83
suggest await on unexpected types
push time in a month
push eventcsmoe/rust
commit sha 70811bbcebf32aa1af63ec630d2faf74ad52bcd7
suggest await before method
push time in a month
push eventcsmoe/rust
commit sha 07a839308dbcd6d8dfa554c5bfdc805c56b6a42d
suggest await before method
push time in a month
push eventcsmoe/rust
commit sha 48c3c1141fa0d37d51d802e20c3cc36e72d1be17
suggest await on field access
push time in a month
push eventcsmoe/rust
commit sha 6685ad7d96528596e880b8e2e83f3ce5e2e3f746
suggest await on field access
push time in a month
push eventcsmoe/rust
commit sha defd11cc220d801eac94d9079ffb91f81a60caad
suggest await on field access
push time in a month
push eventcsmoe/rust
commit sha 117a60e1f5045e317d3f76ce60be28d18c694608
Erase regions in try_eval_bits
commit sha 90aee14eb95ac0b9ddb7cf5db6d003155e94800c
Skip computing param_env and size if not needed
commit sha 5e2e927e0107916b825b164c82be44877ac6ab54
Fix rebase fallout
commit sha 430bd39a0da2b17e5c7ca4842e25b7f523c51522
Do not ICE on assoc type with bad placeholder
commit sha d6cf128b45b4e7b370357b9497d68426719b0d5a
mark methods as constant since 1.47.0 instead of 1.46.0
commit sha e22b61bff0bdd08be7665607cb7be3748c8a35d2
Auto merge of #73270 - dylanmckay:avr-use-correct-addrspace, r=nagisa [AVR] Correctly set the pointer address space when constructing pointers to functions NOTE: Pull request iterations: * https://github.com/dylanmckay/rust/releases/tag/avr-use-correct-addrspace.0 * https://github.com/dylanmckay/rust/releases/tag/avr-use-correct-addrspace.1 * https://github.com/dylanmckay/rust/releases/tag/avr-use-correct-addrspace.2 This patch extends the existing `type_i8p` method so that it requires an explicit address space to be specified. Before this patch, the `type_i8p` method implcitily assumed the default address space, which is not a safe transformation on all targets, namely AVR. The Rust compiler already has support for tracking the "instruction address space" on a per-target basis. This patch extends the code generation routines so that an address space must always be specified. In my estimation, around 15% of the callers of `type_i8p` produced invalid code on AVR due to the loss of address space prior to LLVM final code generation. This would lead to unavoidable assertion errors relating to invalid bitcasts. With this patch, the address space is always either 1) explicitly preserved from the input type, or 2) explicitly set to the instruction address space because the logic is dealing with functions which must be placed there, or 3) explicitly set to the default address space 0 because the logic can only operate on data space pointers and thus we keep the existing semantics of assuming the default, "data" address space.
commit sha c74c6486023899e0e2a1669fa4e32b8f62e1f97f
const prop into operands
commit sha ffd112250e254a46255ebc7e94c7e9a9a7d9c905
ci: disable Azure Pipelines except for macOS
commit sha 711a6807a7979715d6b2940db56eaf1585d30a71
Optimize away BitAnd and BitOr when possible
commit sha d257bacfea8a046c41d6841f897d17944f2f0e64
note LLVM in fixme
commit sha 747bc8ec88b94ddfbd665d21bb87732411bcd1f7
Enable perf try builder This adds a dedicated branch for perf to use for CI, intended to allow perf to enqueue builds without needing to use bors. bors is great, but bors requires an open PR to work, and we want to invoke perf on closed PRs sometimes (in particular, rollups).
commit sha 744240678371b631b10d564201821f10d3baa72c
Revert "update backtrace-rs" This reverts commit 4cbd265c119cb1a5eb92e98d2bb93466f05efa46.
commit sha 3c6003c4c0505381544c03b9b9f0f697c002dd67
Revert "std: Fix compilation without backtrace feature" This reverts commit 028f8d7b85898683b99e05564cd2976c7e0d5b43.
commit sha cc4f547cf4a6bbeb7260077aca26be88644cb019
Revert "std: Switch from libbacktrace to gimli" This reverts commit 13db3cc1e8d2fd4b8e7c74d91002274d7b62801b.
commit sha b747a33abdf4c9d21b604853bc6dee105e622209
Revert "include backtrace folder in rust-src component" This reverts commit d7a36d8964c927863faef5d3b42da08f37e5896c.
commit sha 69d68f90964a46e479eec02a4d9c45aaaa45b411
Auto merge of #74620 - rust-lang:remove-most-azure, r=Mark-Simulacrum Disable Azure Pipelines except for macOS Following up on https://github.com/rust-lang/rust/pull/74565, this PR disables most of Azure Pipelines except for macOS auto builds, practically switching us to GitHub Actions :tada: r? @Mark-Simulacrum
commit sha 49b9a6486ab0814f4c7d57c22c75216fdc1ebf14
rustc_target: Add a target spec option for disabling `--eh-frame-hdr`
commit sha 90e941a974e3561efa18c148de24db1f401cd3c4
mir: improve polymorphic constant bug This commit changes the span and content of the "collection encountered polymorphic constant" bug in monomorphization collection to point to the use of the constant rather than the definition. Signed-off-by: David Wood <[email protected]>
commit sha f39ed207fe25a39fba59d120efcdb56e30d19183
sess: disable polymorphisation This commit disables polymorphisation to resolve regressions related to closures which inherit unused generic parameters and are then used in casts or reflection. Signed-off-by: David Wood <[email protected]>
commit sha 799d52eff7e96fc339327966b056ab89c061b255
tests: add regression test for #74614 This commit adds a regression test for #74614 so that it is fixed before polymorphisation is re-enabled. Signed-off-by: David Wood <[email protected]>
push time in 2 months
push eventcsmoe/rust
commit sha 298a1fa3bd8ec04350b1bff6a6d92e34abf2e198
Move range_minus_one to pedantic This moves the range_minus_one lint to the pedantic category, so there will not be any warnings emitted by default. This should work around problems where the suggestion is impossible to resolve due to the range consumer only accepting a specific range implementation, rather than the `RangeBounds` trait (see #3307). While it is possible to work around this by extracting the boundary into a variable, I don't think clippy should encourage people to disable or work around lints, but instead the lints should be fixable. So hopefully this will help until a proper implementation checks what the range is used for.
commit sha ba2a85dadc61bbfeb483ca0d05ddfda213da1329
Run update_lints
commit sha 2ca24b618e40e92f8061419928dcd0f1f15527e5
Add margin after doc search results
commit sha 780a4c87de88d7f747c7847b71c90c8268fe4b66
Fix typo
commit sha b3c719608d2c969323714517837f0c68aca23d81
Fix test failures
commit sha afa4148cc6dee0f9e0ca5b33f2511b9305d84fcb
Fix tests a bit more
commit sha 7d611d92240d43d9a04cf8db0cb4fb5690f8249c
Auto merge of #5769 - robojumper:match_like_matches_macro, r=phansch new lint: match_like_matches_macro Suggests using the `matches!` macro from `std` where appropriate. `redundant_pattern_matching` has been moved into the `matches` pass to allow suppressing the suggestion where `is_some` and friends are a better replacement. changelog: new lint: `match_like_matches_macro`
commit sha 23d7b3f6f1a345ad95f0812c85613627164b6c39
Remove an unwrap in layout computation
commit sha 1466598e19321bc6b97aef8271a317e78211d54d
Address review comments
commit sha dd872be5da0887d800ae9a001ec212c7161f661c
Stabilize `transmute` in constants and statics but not const fn
commit sha 1eb0053dcddcb55e46f8ba5b4083f7a3f5872be0
Stabilize `transmute` in constants and statics but not const fn
commit sha 689e360d8273ed13e433ce3e7ae1046e33894234
test: rustdoc-ui: Add issue-74134, replacing test/rustdoc/issue-74134-* As per the discussion in PR #74147, the 4 individual tests are replaced by a single one. The test is expanded to cover all 4 public/private cases, each with and without --document-private-items.
commit sha 97048595e1e7bf3fc270ecf14ccaaac4cc71a241
test: rustdoc-ui: Expand issue-74134 to cover types in a private module
commit sha b929f721198c9c9467c0a427a23a974be0baa0d4
Fix try_print_visible_def_path_recur for opt_def_id usage This to fix #74081.
commit sha 87895251ea372a8a776a229c45dd703b4e5b22eb
test: rustdoc-ui: issue-74134: Shorten a too long line
commit sha 6bda2e8a7dbd5e0c0263b26ab89f9fe62920824c
update miri
commit sha 933ba82266da94a812cc3052c6b91b7f8f5b4c35
RISC-V GNU/Linux as host platform
commit sha 1b3bc16533a3e701616648920603c10674eb653b
Fix out of bounds access by checking length equality BEFORE accessing by index. Fixes #5780
commit sha f5de23b5c132db8064c98e0e20ef216d6defdc44
Add the test case mentioned in #74236
commit sha 0979545330689186dff27e22f539c1a06887981f
rustdoc: insert newlines between attributes
push time in 2 months
issue closedrust-lang/rust
rust virtual machine compile /run rust code in debug mode.
In some cases with large amounts of code, compilation can take a long time Even modifying a string takes seconds (Even though my computer is 6 core Cpus)
rust virtual machine(Implemented in pure rust languages) compile /run rust code in debug mode. (we need very fast Develop code) llvm ir compile in release mode. (we need very fast Execution speed)
advantage:
- compile fast (may be Less than one second)
- Smart tips fast (less than one second, for now it takes delay of more than 1 second or more)
- Develop fast (for example developing a website)
- when debug mode runing,Automatically generate the Release mode of LLVM IR (so we compile release mode code fast!)
disadvantage:
- debug run code may be Slow down.(but release mode fast)
- debug run may be consume more memory
closed time in 2 months
zhuxiujiaissue commentrust-lang/rust
rust virtual machine compile /run rust code in debug mode.
cargo check compiles rust code without involvement of llvm cc https://doc.rust-lang.org/edition-guide/rust-2018/cargo-and-crates-io/cargo-check-for-faster-checking.html
comment created time in 2 months
push eventcsmoe/rust
commit sha 234019758bfff600e8972481158882d9e12280cf
Add peek test for projections
commit sha 15e81beb474235d100995f3bcc72d15086a8e29e
moves terminator types to sub module
commit sha cf398a33ebff501a01c9c91fe5615992c936d292
removes unnecessary tidy ignore
commit sha 36ac08e2643dc5cc035031007a8a36f4c87d3543
Make `fn_arg_names` return `Ident` instead of symbol Also, implement this query for the local crate, not just foreign crates.
commit sha fa6a61c68930b390407d73e0ba71f2af5555f0f0
Explain move errors that occur due to method calls involving `self` This is a re-attempt of #72389 (which was reverted in #73594) Instead of using `ExpnKind::Desugaring` to represent operators, this PR checks the lang item directly.
commit sha 224bc052564117abfb8716772779ade221133395
Fix allow_internal_unstable with rustc_const_unstable
commit sha fc239e82fe1ef91632dfa858487d89141aaab7a7
Make `likely` and `unlikely` const They are gated by internal feature gate const_likely
commit sha 8adc781a1ff2fac9e54034ffdfaef90656f047e0
Rollup merge of #72771 - jyn514:rustdoc, r=Manishearth Warn if linking to a private item Closes https://github.com/rust-lang/rust/issues/72769 r? @GuillaumeGomez
commit sha 38cbf158b8f565af3d2027f96227858cb7abbb57
Rollup merge of #72937 - AdrianCX:master, r=nikomatsakis Fortanix SGX target libunwind build process changes Ticket: https://github.com/fortanix/rust-sgx/issues/174 LLVM related changes (merged): https://github.com/rust-lang/llvm-project/pull/57 Description: libunwind changes needed to run code in sgx environment via rust-sgx. Target that uses this in rust: x86_64-fortanix-unknown-sgx. Without this change, rust std for this toolchain is forced to use a precompiled library loaded via environment variable. With this change we act the same as musl target.
commit sha f13d09abe1d7a02007ac8591dc409c8d820b903a
Rollup merge of #73485 - estebank:dedup-preds, r=nikomatsakis Perform obligation deduplication to avoid buggy `ExistentialMismatch` Address #59326.
commit sha 23b0776a594a0728a7706521c5193245de2ea823
Rollup merge of #73529 - pickfire:liballoc-specfromelem-i8, r=cuviper Add liballoc impl SpecFromElem for i8 Speedup vec![1_i8; N] for non-zero element. Before test do_bench_from_elem_i8 ... bench: 130 ns/iter (+/- 7) = 61 MB/s test do_bench_from_elem_u8 ... bench: 121 ns/iter (+/- 4) = 66 MB/s After test do_bench_from_elem_i8 ... bench: 123 ns/iter (+/- 7) = 65 MB/s test do_bench_from_elem_u8 ... bench: 121 ns/iter (+/- 5) = 66 MB/s No speed difference if element is already zero. ```rust #[bench] fn do_bench_from_elem_i8(b: &mut Bencher) { b.bytes = 8 as u64; b.iter(|| { let dst = ve::vec![10_i8; 100]; assert_eq!(dst.len(), 100); assert!(dst.iter().all(|x| *x == 10)); }) } ``` As suggested by @cuviper https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/SpecForElem.20for.20other.20integers r? @cuviper CC @joshtriplett Edit: Wow, I just realized both reviewers are Josh.
commit sha 92af945256913dbec2c679a06e154469d60a0d7e
Rollup merge of #73579 - RalfJung:doc-missing-links, r=shepmaster add missing doc links The doc comments contain ``[`size_of_val`]`` but the link target was missing.
commit sha dfbba65786279b5f73cbf26bff4f6d984cb77105
Rollup merge of #73627 - ssomers:btree_iter_min_max, r=Mark-Simulacrum Shortcuts for min/max on double-ended BTreeMap/BTreeSet iterators Closes #59947: a performance tweak that might benefit some. Optimizes `min` and `max ` on all btree double-ended iterators that do not drop, i.e. the iterators created by: - `BTreeMap::iter` - `BTreeMap::iter_mut` - `BTreeMap::keys` and `BTreeSet::iter` - `BTreeMap::range` and `BTreeSet::range` - `BTreeMap::range_mut` Also in these (currently) single-ended iterators, but obviously for `min` only: - `BTreeSet::difference` - `BTreeSet::intersection` - `BTreeSet::symmetric_difference` - `BTreeSet::union` Did not do this in iterators created by `into_iter` to preserve drop order, as outlined in #62316. Did not do this in iterators created by `drain_filter`, possibly to preserve drop order, possibly to preserve predicate invocation, mostly to not have to think about it too hard (I guess maybe it wouldn't be a change for `min`, which is the only shortcut possible in this single-ended iterator).
commit sha c18e919a79c701d25b33cffa0a183ee21085f2e6
Rollup merge of #73691 - ajpaverd:bootstrap-windows-73689, r=Mark-Simulacrum Bootstrap: detect Windows based on sys.platform Closes #73689.
commit sha 8d9c00d7f1b00113d1052d1e44948ec6e8597a76
Rollup merge of #73694 - poliorcetics:self-upper-keyword, r=Mark-Simulacrum Document the Self keyword Partial fix of #34601. Document the `Self` keyword. This contains simple examples of the places where `Self` can be used.
commit sha bc10bb02f5a763ffeea906c48f90114e4bfab625
Rollup merge of #73718 - poliorcetics:super-keyword, r=shepmaster Document the super keyword Partial fix of #34601. Quite short, just a small example and a link to the reference. @rustbot modify labels: T-doc,C-enhancement
commit sha 83f6d0a93f8159fe18b4a9ccfaf395a0fbabf07c
Rollup merge of #73728 - oli-obk:const_prop_cleanup, r=wesleywiser Document some invariants correctly/more r? @wesleywiser
commit sha 7926c64642d070fe400dda1a53b4183f415d8445
Rollup merge of #73738 - nbdd0121:comment, r=nikomatsakis Remove irrelevant comment Iterator is no longer a lang item since 216e72f8d9499d012e23bc4563215e693fcb4f35.
commit sha 50026aed2493da03cb0c669497ca489d57c93729
Rollup merge of #73765 - kraai:remove-blank-line, r=jonas-schievink Remove blank line
commit sha df88972f8ce9ddbebec6d551810f7127fe25d2a3
Update psm version This new version includes a fix for building on aarch64 windows.
push time in 2 months
issue commentrust-lang/rust
suggest `await` for future-related type errors
@tmandry yes, in slow progress since time is tough these days.
comment created time in 2 months
push eventcsmoe/rust-analyzer
commit sha 65943c058583f912175f2cfde64ff2a0d92809b6
Remove redundancy in syntax highlighting tests
commit sha 3937b225e7918ae6d75849a0959754af43fbf08c
Change management of test cfg to better support json projects
commit sha 3aaaf924cb649ecc3b1a59653f47d1735fa7cb5d
Fix bug in lexer for format specifier where the `type` and `width` were not correctly distinguished
commit sha c59ffac4c832e71cd4dadd6a8ec46918891985a2
Merge #4780 4780: Fix VSCode settings r=SomeoneToIgnore a=vincentisambart closes #4779 #4779 was reproducing every time, so doing a bisect I found out the problem to be coming from #4730. The only change to the extension that #4730 included was changes to editors/code/package.json. So I tried modifying those changes a bit and got it working. Co-authored-by: Vincent Isambart <[email protected]>
commit sha 0d01be7e186bf8c0676ddfa5ae719852315a936b
Update quote
commit sha d6967762dd1fff3cfb65d481ba5a169143205c0e
Merge #4788 4788: Update quote r=kjeremy a=kjeremy Co-authored-by: Jeremy Kolb <[email protected]>
commit sha b366b98a9e8f70711eba6965817a063565009f6a
Merge #4787 4787: Fix bug in lexer for format specifier r=matklad a=ltentrup The `type` and `width` were not correctly distinguished. Fixes #4696. Co-authored-by: Leander Tentrup <[email protected]>
commit sha bb0d4600fff40565ed679c0d879c7a9256570b61
Merge #4770 4770: Clean up handling of int/float literal types r=matklad a=flodiebold 'Unknown' int/float types actually never exist as such, they get replaced by type variables immediately. So the whole `Uncertain<IntTy>` thing was unnecessary and just led to a bunch of match branches that were never hit. Co-authored-by: Florian Diebold <[email protected]>
commit sha d8552d114c3b2cedbc485ebe26d7b784c0845bd8
Merge #4781 4781: Remove redundancy in syntax highlighting tests r=matklad a=ltentrup Follow up from #4683. Improves syntax highlighting testing by introducing a function that contains the boilerplate comparison code. Keeps the `ra_fixture` argument in the first position, thus, the editor syntax highlighting injection still works. Co-authored-by: Leander Tentrup <[email protected]>
commit sha ee8dec5dc11cfecf219b6510b0eadd9691a82ba5
IDE API
commit sha cc07c82fefb2affc1772e12b8357471cccc8d578
Preconditions style
commit sha 3623c1663f9135504c943c44212e99e5198b16a5
Merge #4792 4792: Document more knowledge r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
commit sha 4968321706fc5c24d9f2c35cdbbd5e9047c97c96
Don't @ people in commit messages
commit sha b7db9f058ad51b7ba47db02b581a76b6756d74e8
Apply suggestions from code review
commit sha a5f427ced3ee0ec27041f0b7632b4baae6a736b2
Merge #4793 4793: Don't @ people in commit messages r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
commit sha 6e4fca5882bdd6d00dfcc384473c1f612e00baa2
Merge #4773 4773: Run|Debug hover actions. r=matklad a=vsrs  This hover actions work exactly like corresponding lenses. Co-authored-by: vsrs <[email protected]>
commit sha c5d5d2185816d90ad1420fe544d93150cb9c9a48
Add `FieldShorthand` variant to `NameClass`
commit sha 97ea2dfc4b6b49a175d4d0f85b37c77bd1ea3f3b
Move to a dedicated file
commit sha cbc5eb87386e132c63ec33ff496019fad7478fe8
Refactor
commit sha ab86f15ff2c237ac3f4237961e4484ae71cedf00
Merge #4794 4794: Tweak release r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
push time in 3 months
push eventcsmoe/rust
commit sha 40b27ff5f3828abd8d1ab951853bf70b5fbf6ed5
review comments: add comment
commit sha 5a9ff052b4879e4ef6748c2f85563a7db0548c0b
Disable core benches on wasm (benches not supported).
commit sha 036b5fec49aa5d5143b83360442400d1e83ccefa
Auto merge of #73446 - ecstatic-morse:issue-73431, r=pnkfelix Make novel structural match violations not a `bug` Fixes (on master) #73431. Ideally, `CustomEq` would emit a strict subset of the structural match errors that are found by `search_for_structural_match_violation`, since it allows more cases due to value-based reasoning. However, const qualification is more conservative than `search_for_structural_match_violation` around associated constants, since qualification does not try to substitute type parameters. In the long term, we should probably make const qualification work for generic associated constants, but I don't like extending its capabilities even further. r? @pnkfelix
commit sha 9d388d465d3ecab18843ae356256060a3612fce4
Rollup merge of #70551 - mark-i-m:ty-err-2, r=varkor Make all uses of ty::Error delay a span bug r? @eddyb A second attempt at https://github.com/rust-lang/rust/pull/70245 resolves https://github.com/rust-lang/rust/issues/70866
commit sha 45d033b21cdd009961860e62e1d1c785ecb2af41
Rollup merge of #71338 - estebank:recursive-impl-trait, r=nikomatsakis Expand "recursive opaque type" diagnostic Fix #70968, partially address #66523.
commit sha 39f8784eb6056c21c120bfa93bbec73e19773727
Rollup merge of #71976 - mibac138:let-recovery, r=estebank Improve diagnostics for `let x += 1` Fixes(?) #66736 The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem. r? @estebank
commit sha 49ab0cab618d9d1cb49220d7c253556a56148283
Rollup merge of #72279 - RalfJung:raw-ref-macros, r=nikomatsakis add raw_ref macros In https://github.com/rust-lang/rust/issues/64490, various people were in favor of exposing `&raw` as a macro first before making the actual syntax stable. So this PR (unstably) introduces those macros. I'll create the tracking issue if we're okay moving forward with this.
commit sha 9262fc2a68133330a8f78c73afa54b3ff09724b5
Rollup merge of #72628 - MikailBag:array-default-tests, r=shepmaster Add tests for 'impl Default for [T; N]' Related: #71690. This pull request adds two tests: - Even it T::default() panics, no leaks occur. - [T; 0] is Default even if T is not. I believe at some moment `Default` impl for arrays will be rewritten to use const generics instead of macros, and these tests will help to prevent behavior changes.
commit sha 40fd2bdcfec7a30a2cce0d4a2cc08d09e64cabeb
Rollup merge of #72804 - estebank:opaque-missing-lts-in-fn-2, r=nikomatsakis Further tweak lifetime errors involving `dyn Trait` and `impl Trait` in return position * Suggest substituting `'static` lifetime in impl/dyn `Trait + 'static` instead of `Trait + 'static + '_` * When `'static` is explicit, also suggest constraining argument with it * Reduce verbosity of suggestion message and mention lifetime in label * Tweak output for overlapping required/captured spans * Give these errors an error code Follow up to #72543. r? @nikomatsakis
commit sha e0b59b2c07adec376b7c57fb3d81726b6bc2822d
Rollup merge of #72814 - RalfJung:mir-visir-terminator, r=oli-obk remove visit_terminator_kind from MIR visitor For some reason, we had both `visit_terminator` and `visit_terminator_kind`. In contrast, for `Statement` we just have `visit_statement`. So this cleans things up by removing `visit_terminator_kind` and porting its users to `visit_terminator`.
commit sha e1549786ff6105af4f3e9be30496c812b7ca71b3
Rollup merge of #72836 - poliorcetics:std-time-os-specificities, r=shepmaster Complete the std::time documentation to warn about the inconsistencies between OS Fixes #48980. I put the new documentation in `src/libstd/time.rs` at the module-level because it affects all types, even the one that are not directly system dependents if they are used with affected types, but there may be a better place for it.
commit sha bf59152c01d9ffc4ceeb982e26b3df2354ebede6
Rollup merge of #72968 - integer32llc:docs-arrow-keys, r=GuillaumeGomez Only highlight doc search results via mouseover if mouse has moved ## What happens - Go to https://doc.rust-lang.org/stable/std/index.html - Put your mouse cursor somewhere in the middle where search results will appear and then don't move the mouse - Press 's' to focus the search box - Type a query that brings up enough search results to go under where your mouse cursor is - Press the down arrow - The search result that is one below where your mouse cursor is will be highlighted. ## What I expected When not currently using the mouse, I expect doing a search and then pressing the down arrow to always highlight the first search result immediately below the search box. ## The fix This feels a bit hacky to me; I'm open to other solutions. This introduces a global JS var that keeps track of whether the person searching has moved their mouse after doing a search or not, and only uses the mouse position to highlight search results if the person HAS moved the mouse AFTER doing a search.
commit sha 0e332e9e3c4a33458cac1801f59c2d0a3ca28484
Rollup merge of #73034 - doctorn:nomangle-inline-linkage, r=matthewjasper Export `#[inline]` fns with extern indicators In ancient history (#36280) we stopped `#[inline]` fns being codegened if they weren't used. However, - #72944 - #72463 observe that when writing something like ```rust #![crate_type = "cdylib"] #[no_mangle] #[inline] pub extern "C" fn foo() { // ... } ``` we really _do_ want `foo` to be codegened. This change makes this the case. Resolves #72944, resolves #72463 (and maybe some more)
commit sha ed92b6a63304dfbc0b8a29aa4cf89f9ce814b27b
Rollup merge of #73315 - GuillaumeGomez:clean-up-config-strs, r=kinnison Clean up some weird command strings r? @kinnison
commit sha f4b5f581a9c2604a951043decd6acf4e2852fe35
Rollup merge of #73320 - estebank:type-param-sugg-more, r=davidtwco Make new type param suggestion more targetted Do not suggest new type param when encountering a missing type in an ADT field with generic parameters. Fix #72640.
commit sha 9ca811772c2fddefeda4567cdfb8c790c94e0085
Rollup merge of #73361 - estebank:non-primitive-cast, r=davidtwco Tweak "non-primitive cast" error - Suggest borrowing expression if it would allow cast to work. - Suggest using `<Type>::from(<expr>)` when appropriate. - Minor tweak to `;` typo suggestion. Partily address #47136.
commit sha 9f8f994ad9cc996b304a90e5ca7c1d894c7eff4d
Rollup merge of #73425 - poliorcetics:zeroed-functions-pointers, r=dtolnay Mention functions pointers in the documentation Fixes #51615. This mentions function pointers in the documentation for `core::mem::zeroed`, adding them to the list of types that are **always** wrong when zeroed, with `&T` and `&mut T`. @rustbot modify labels: T-doc, C-enhancement, T-libs
commit sha 1db7dc4794f0a8cf2fafb26ed97f2067321b198c
Rollup merge of #73428 - pierwill:patch-1, r=jonas-schievink Fix typo in librustc_ast docs Fixed sentence by removing a word.
commit sha f15b346f3adf03a976e9468401e443a3ecb61a71
Rollup merge of #73447 - lzutao:stabilize-result_as_deref, r=dtolnay Improve document for `Result::as_deref(_mut)` methods cc #50264
commit sha 6c53a0c2b5c73a0ea0750dd6c84298ce9348ecff
Rollup merge of #73476 - JakobDegen:should_panic_rustdoc, r=GuillaumeGomez Added tooltip for should_panic code examples This change adds a tooltip to the documentation for `should_panic` examples. It currently displays identically to `compile_fail` examples, save for the changed text. It may be helpful to change the color that this displays in to make it visually more clear what is going on, but I'm unsure if additional colors wouldn't just be distracting. I brought this [up on internals](https://internals.rust-lang.org/t/indicating-that-an-example-is-should-panic-in-docs/12544) a few days ago, and there seemed to be a mild positive response to it.
push time in 3 months