about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2021-06-07note :sparkles: uwuuuEllen-8/+13
2021-05-29Fix missing note on type mismatch error diagnosticsEllen-5/+15
2021-05-29Make lifetime ordering error pretty print const param defaultsEllen-5/+21
2021-05-28Auto merge of #85607 - LeSeulArtichaut:thir-unsafeck-closures, r=nikomatsakisbors-17/+173
Make closures inherit their parent's "safety context" Fixes rust-lang/project-thir-unsafeck#9, ~~blocked on #85273~~. r? `@nikomatsakis`
2021-05-28Auto merge of #85789 - ptrojahn:generator_typo, r=nagisabors-1/+1
Fix typo
2021-05-28Auto merge of #85700 - Bobo1239:dso_local_ppc64, r=nagisabors-46/+46
Fix static relocation model for PowerPC64 We now also use `should_assume_dso_local()` for declarations and port two additional cases from clang: - Exclude PPC64 [1] - Exclude thread-local variables [2] [1]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1038-L1040 [2]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1048-L1050 Tbh I don't know enough about PowerPC(64) to explain why the TOC (table of contents; like the GOT in x86?) is still needed even with the static relocation model. But with these changes [Rust-For-Linux](https://github.com/Rust-for-Linux/linux) runs again on ppc64le. (instead of [getting loaded successfully but crashing](https://github.com/Bobo1239/linux/runs/2646478783?check_suite_focus=true#step:47:358)) r? `@nagisa`
2021-05-28Auto merge of #85546 - hyd-dev:unwind, r=RalfJungbors-94/+168
const-eval: disallow unwinding across functions that `!fn_can_unwind()` Following https://github.com/rust-lang/miri/pull/1776#discussion_r633074343, so r? `@RalfJung` This PR turns `unwind` in `StackPopCleanup::Goto` into a new enum `StackPopUnwind`, with a `NotAllowed` variant to indicate that unwinding is not allowed. This variant is chosen based on `rustc_middle::ty::layout::fn_can_unwind()` in `eval_fn_call()` when pushing the frame. A check is added in `unwind_to_block()` to report UB if unwinding happens across a `StackPopUnwind::NotAllowed` frame. Tested with Miri `HEAD` with [minor changes](https://github.com/rust-lang/miri/compare/HEAD..9cf3c7f0d86325a586fbcbf2acdc9232b861f1d8) and the rust-lang/miri#1776 branch with [these changes](https://github.com/rust-lang/miri/compare/d866c1c52f48bf562720383455b75c257bb1ad92..626638fbfe2fff34648dda29a34d59db498a6e52).
2021-05-28Auto merge of #85745 - veber-alex:panic_any, r=m-ou-sebors-0/+1
Add #[track_caller] to panic_any Report the panic location from the user code. ```rust use std::panic; use std::panic::panic_any; fn main() { panic::set_hook(Box::new(|panic_info| { if let Some(location) = panic_info.location() { println!( "panic occurred in file '{}' at line {}", location.file(), location.line(), ); } else { println!("panic occurred but can't get location information..."); } })); panic_any(42); } ```` Before: `panic occurred in file '/rustc/ff2c947c00f867b9f012e28ba88cecfbe556f904/library/std/src/panic.rs' at line 59` After: `panic occurred in file 'src/main.rs' at line 17`
2021-05-28Auto merge of #84968 - FabianWolff:master, r=estebankbors-17/+74
Fix incorrect suggestions for E0605 Fixes #84598. Here is a simplified version of the problem presented in issue #84598: ```Rust #![allow(unused_variables)] #![allow(dead_code)] trait T { fn t(&self) -> i32; } unsafe fn foo(t: *mut dyn T) { (t as &dyn T).t(); } fn main() {} ``` The current output is: ``` error[E0605]: non-primitive cast: `*mut (dyn T + 'static)` as `&dyn T` --> src/main.rs:7:5 | 7 | (t as &dyn T).t(); | ^^^^^^^^^^^^^ invalid cast | help: borrow the value for the cast to be valid | 7 | (&t as &dyn T).t(); | ^ ``` This is incorrect, though: The cast will _not_ be valid when writing `&t` instead of `t`: ``` error[E0277]: the trait bound `*mut (dyn T + 'static): T` is not satisfied --> t4.rs:7:6 | 7 | (&t as &dyn T).t(); | ^^ the trait `T` is not implemented for `*mut (dyn T + 'static)` | = note: required for the cast to the object type `dyn T` ``` The correct suggestion is `&*t`, which I have implemented in this pull request. Of course, this suggestion will always require an unsafe block, but arguably, that's what the user really wants if they're trying to cast a pointer to a reference. In any case, claiming that the cast will be valid after implementing the suggestion is overly optimistic, as the coercion logic doesn't seem to resolve all nested obligations, i.e. the cast may still be invalid after implementing the suggestion. I have therefore rephrased the suggestion slightly ("consider borrowing the value" instead of "borrow the value for the cast to be valid"). Additionally, I have fixed another incorrect suggestion not mentioned in #84598, which relates to casting immutable references to mutable ones: ```rust fn main() { let mut x = 0; let m = &x as &mut i32; } ``` currently leads to ``` error[E0605]: non-primitive cast: `&i32` as `&mut i32` --> t5.rs:3:13 | 3 | let m = &x as &mut i32; | ^^^^^^^^^^^^^^ invalid cast | help: borrow the value for the cast to be valid | 3 | let m = &mut &x as &mut i32; | ^^^^ ``` which is obviously incorrect: ``` error[E0596]: cannot borrow data in a `&` reference as mutable --> t5.rs:3:13 | 3 | let m = &mut &x as &mut i32; | ^^^^^^^ cannot borrow as mutable ``` I've changed the suggestion to a note explaining the problem: ``` error[E0605]: non-primitive cast: `&i32` as `&mut i32` --> t5.rs:3:13 | 3 | let m = &x as &mut i32; | ^^^^^^^^^^^^^^ invalid cast | note: this reference is immutable --> t5.rs:3:13 | 3 | let m = &x as &mut i32; | ^^ note: trying to cast to a mutable reference type --> t5.rs:3:19 | 3 | let m = &x as &mut i32; | ^^^^^^^^ ``` In this example, it would have been even nicer to suggest replacing `&x` with `&mut x`, but this would be much more complex because we would have to take apart the expression to be cast (currently, we only look at its type), and `&x` could be stored in a variable, where such a suggestion would not even be directly applicable: ```rust fn main() { let mut x = 0; let r = &x; let m = r as &mut i32; } ``` My solution covers this case, too.
2021-05-28Fix static relocation model for PowerPC64Boris-Chengbiao Zhou-46/+46
We now also use `should_assume_dso_local()` for declarations and port two additional cases from clang: - Exclude PPC64 [1] - Exclude thread-local variables [2] [1]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1038-L1040 [2]: https://github.com/llvm/llvm-project/blob/033138ea452f5f493fb5095e5963419905ad12e1/clang/lib/CodeGen/CodeGenModule.cpp#L1048-L1050
2021-05-28Rewrite to a `match`hyd-dev-5/+4
2021-05-28"a frame" -> "a stack frame"hyd-dev-1/+1
2021-05-28Auto merge of #85743 - bjorn3:sync_cg_clif-2021-05-27, r=bjorn3bors-306/+218
Sync rustc_codegen_cranelift The main highlight this sync is the removal of several dependencies, making compilation of cg_clif itself faster. There have also been a couple of new features like `#[link_section]` now supporting different segments for Mach-O binaries (thanks `@eggyal!)` and the `imported_main` feature, which is currently unstable. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2021-05-27Auto merge of #84568 - andoriyu:libtest/junit_formatter, r=yaahcbors-5/+190
feat(libtest): Add JUnit formatter tracking issue: https://github.com/rust-lang/rust/issues/85563 Add an alternative formatter to `libtest`. Formatter produces valid xml that later can be interpreted as JUnit report. Caveats: - `timestamp` is required by schema, but every viewer/parser ignores it. Attribute is not set to avoid depending on chrono; - Running all "suits" (unit tests, doc-tests and integration tests) will produce a mess; - I couldn't find a way to get integration test binary name, so it's just goes by "integration"; Sample output for unit tests (pretty printed by 3rd party tool): ``` <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="13" skipped="1"> <testcase classname="results::tests" name="test_completed_bad" time="0"/> <testcase classname="results::tests" name="suite_started" time="0"/> <testcase classname="results::tests" name="suite_ended_ok" time="0"/> <testcase classname="results::tests" name="suite_ended_bad" time="0"/> <testcase classname="junit::tests" name="test_failed_output" time="0"/> <testcase classname="junit::tests" name="test_simple_output" time="0"/> <testcase classname="junit::tests" name="test_multiple_outputs" time="0"/> <testcase classname="results::tests" name="test_completed_ok" time="0"/> <testcase classname="results::tests" name="test_stared" time="0"/> <testcase classname="junit::tests" name="test_generate_xml_no_error_single_testsuite" time="0"/> <testcase classname="results::tests" name="test_simple_output" time="0"/> <testcase classname="test" name="should_panic" time="0"/> <system-out/> <system-err/> </testsuite> </testsuites> ``` Sample output for integration tests (pretty printed by 3rd party tool): ``` <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0"> <testcase classname="integration" name="test_add" time="0"/> <system-out/> <system-err/> </testsuite> </testsuites> ``` Sample output for Doc-tests (pretty printed by 3rd party tool): ``` <?xml version="1.0" encoding="UTF-8"?> <testsuites> <testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0"> <testcase classname="src/lib.rs" name="(line 2)" time="0"/> <system-out/> <system-err/> </testsuite> </testsuites> ```
2021-05-27Test THIR unsafeck for unsafe ops in closuresLeSeulArtichaut-15/+143
2021-05-27Auto merge of #85757 - GuillaumeGomez:rollup-k8hfhp8, r=GuillaumeGomezbors-10/+47
Rollup of 3 pull requests Successful merges: - #85722 (Fix trait methods' toggle) - #85730 (Mention workaround for floats in Iterator::{min, max}) - #85738 (Rename opensbd to openbsd) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-27Rollup merge of #85738 - 370417:opensbd, r=m-ou-seGuillaume Gomez-3/+3
Rename opensbd to openbsd OpenBsd was sometimes spelled "opensbd" in the standard library.
2021-05-27Rollup merge of #85730 - Smittyvb:iter-min-max-floats, r=m-ou-seGuillaume Gomez-2/+26
Mention workaround for floats in Iterator::{min, max} `Iterator::{min, max}` can't be used with iterators of floats due to NaN issues. This suggests a workaround in the documentation of those functions.
2021-05-27Rollup merge of #85722 - GuillaumeGomez:trait-toggle, r=jshaGuillaume Gomez-5/+18
Fix trait methods' toggle A `<details>` tag wasn't closed on trait methods, which created broken DOM. I also used this occasion to only generate the toggle in case there is documentation on the method. r? `@jsha`
2021-05-27Auto merge of #85729 - LeSeulArtichaut:thir-no-hash, r=nikomatsakisbors-0/+2
Don't hash `thir_body` Experiment to see if/how much this helps negate the perf impact of #85273. r? `@ghost`
2021-05-27Make closures inherit their parent's "safety context"LeSeulArtichaut-2/+30
2021-05-27Update compiler/rustc_middle/src/query/mod.rsNiko Matsakis-0/+1
Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
2021-05-27Auto merge of #85737 - scottmcm:vec-calloc-option-nonzero, r=m-ou-sebors-0/+33
Enable Vec's calloc optimization for Option<NonZero> Someone on discord noticed that `vec![None::<NonZeroU32>; N]` wasn't getting the optimization, so here's a PR 🙃 We can certainly do this in the standard library because we know for sure this is ok, but I think it's also a necessary consequence of documented guarantees like those in https://doc.rust-lang.org/std/option/#representation and https://doc.rust-lang.org/core/num/struct.NonZeroU32.html It feels weird to do this without adding a test, but I wasn't sure where that would belong. Is it worth adding codegen tests for these?
2021-05-27Remove unused tidy dep exceptionsbjorn3-10/+0
2021-05-27Add #[track_caller] to panic_anyAlex Veber-0/+1
2021-05-27Merge commit '40dd3e2b7089b5e96714e064b731f6dbf17c61a9' into ↵bjorn3-296/+218
sync_cg_clif-2021-05-27
2021-05-27Auto merge of #85732 - Smittyvb:trait-alias-camelcase-lint, r=varkorbors-0/+19
Lint against non-CamelCase trait alias names Type aliases are linted as such, so (unstable) trait aliases should be treated the same way.
2021-05-27Rustfmtbjorn3-1/+2
2021-05-27Rustup to rustc 1.54.0-nightly (ff2c947c0 2021-05-25)bjorn3-5/+5
2021-05-26Enable Vec's calloc optimization for Option<NonZero>Scott McMurray-0/+33
2021-05-26Rename opensbd to openbsdAlbert Ford-3/+3
2021-05-27Auto merge of #84124 - 12101111:libunwind, r=petrochenkovbors-76/+106
libunwind fix and cleanup Fix: 1. "system-llvm-libunwind" now only skip build-script for linux target 2. workaround from https://github.com/rust-lang/rust/pull/65972 is not needed, upstream fix it in https://github.com/llvm/llvm-project/commit/68c50708d1f2b9aee3f10ec710df0b1387f701e5 ( LLVM 11 ) 3. remove code for MSCV and Apple in `compile()`, as they are not used 4. fix https://github.com/rust-lang/rust/issues/69222 , compile c files and cpp files in different config 5. fix conditional compilation for musl target. 6. fix that x86_64-fortanix-unknown-sgx don't link libunwind built in build-script into rlib
2021-05-27Auto merge of #85734 - Dylan-DPC:rollup-q6iiees, r=Dylan-DPCbors-388/+447
Rollup of 8 pull requests Successful merges: - #84221 (E0599 suggestions and elision of generic argument if no canditate is found) - #84701 (stabilize member constraints) - #85564 ( readd capture disjoint fields gate) - #85583 (Get rid of PreviousDepGraph.) - #85649 (Update cc) - #85689 (Remove Iterator #[rustc_on_unimplemented]s that no longer apply.) - #85719 (Add inline attr to CString::into_inner so it can optimize out NonNull checks) - #85725 (Remove unneeded workaround) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-27Rollup merge of #85725 - Smittyvb:rm-24159-workaround, r=RalfJungDylan DPC-5/+3
Remove unneeded workaround This removes a workaround for #24159, which has been fixed.
2021-05-27Rollup merge of #85719 - elichai:cstring-into_inner-inline, r=m-ou-seDylan DPC-0/+1
Add inline attr to CString::into_inner so it can optimize out NonNull checks It seems that currently if you convert any of the standard library's container to a pointer and then to a NonNull pointer, all will optimize out the NULL check except `CString`(https://godbolt.org/z/YPKW9G5xn), because for some reason `CString::into_inner` isn't inlined even though it's a private function that should compile into a simple `mov` instruction. Adding a simple `#[inline]` attribute solves this, code example: ```rust use std::ffi::CString; use std::ptr::NonNull; pub fn cstring_nonull(mut n: CString) -> NonNull<i8> { NonNull::new(CString::into_raw(n)).unwrap() } ``` assembly before: ```asm __ZN3wat14cstring_nonull17h371c755bcad76294E: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp callq __ZN3std3ffi5c_str7CString10into_inner17h28ece07b276e2878E testq %rax, %rax je LBB0_2 popq %rbp retq LBB0_2: leaq l___unnamed_1(%rip), %rdi leaq l___unnamed_2(%rip), %rdx movl $43, %esi callq __ZN4core9panicking5panic17h92a83fa9085a8f73E .cfi_endproc .section __TEXT,__const l___unnamed_1: .ascii "called `Option::unwrap()` on a `None` value" l___unnamed_3: .ascii "wat.rs" .section __DATA,__const .p2align 3 l___unnamed_2: .quad l___unnamed_3 .asciz "\006\000\000\000\000\000\000\000\006\000\000\000(\000\000" ``` Assembly after: ```asm __ZN3wat14cstring_nonull17h9645eb9341fb25d7E: .cfi_startproc pushq %rbp .cfi_def_cfa_offset 16 .cfi_offset %rbp, -16 movq %rsp, %rbp .cfi_def_cfa_register %rbp movq %rdi, %rax popq %rbp retq .cfi_endproc ``` (Related discussion on zulip: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/NonNull.20From.3CBox.3CT.3E.3E)
2021-05-27Rollup merge of #85689 - m-ou-se:array-intoiter-3, r=estebankDylan DPC-34/+0
Remove Iterator #[rustc_on_unimplemented]s that no longer apply. Now that `IntoIterator` is implemented for arrays, all the `rustc_on_unimplemented` for arrays of ranges (e.g. `for _ in [1..3] {}`) no longer apply, since they are now valid Rust. Separated these from #85670, because we should discuss a potential new (clippy?) lint for these. Until Rust 1.52, `for _ in [1..3] {}` produced: ``` error[E0277]: `[std::ops::Range<{integer}>; 1]` is not an iterator --> src/main.rs:2:14 | 2 | for _ in [1..3] {} | ^^^^^^ if you meant to iterate between two values, remove the square brackets | = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 1]` = note: `[start..end]` is an array of one `Range`; you might have meant to have a `Range` without the brackets: `start..end` = note: required by `std::iter::IntoIterator::into_iter` ``` But in Rust 1.53 and later, it compiles fine. It iterates over the array by value, for one iteration with the element `1..3`. This is probably a mistake, which is no longer caught. Should we have a lint for it? Should Clippy have a lint for it? cc ```@estebank``` ```@flip1995``` cc https://github.com/rust-lang/rust/issues/84513
2021-05-27Rollup merge of #85649 - ChrisDenton:update-cc, r=matthewjasperDylan DPC-8/+8
Update cc Recent commits have improved `cc`'s finding of MSVC tools on Windows. In particular it should help to address these issues: #83043 and #43468
2021-05-27Rollup merge of #85583 - cjgillot:no-previous-dg, r=petrochenkovDylan DPC-79/+49
Get rid of PreviousDepGraph. Its only role is to access the `SerializedDepGraph`.
2021-05-27Rollup merge of #85564 - ↵Dylan DPC-15/+47
pnkfelix:issue-85435-readd-capture-disjoint-fields-gate, r=nikomatsakis readd capture disjoint fields gate This readds a feature gate guard that was added in PR #83521. (Basically, there were unintended consequences to the code exposed by removing the feature gate guard.) The root bug still remains to be resolved, as discussed in issue #85561. This is just a band-aid suitable for a beta backport. Cc issue #85435 Note that the latter issue is unfixed until we backport this (or another fix) to 1.53 beta
2021-05-27Rollup merge of #84701 - nikomatsakis:stabilize-member-constraints-61997, ↵Dylan DPC-238/+31
r=jackh726 stabilize member constraints Stabilizes the use of "member constraints" in solving `impl Trait` bindings. This is a step towards stabilizing a "MVP" of "named impl Trait". # Member constraint stabilization report | Info | | | --- | --- | | Tracking issue | [rust-lang/rust#61997](https://github.com/rust-lang/rust/issues/61997) | | Implementation history | [rust-lang/rust#61775] | | rustc-dev-guide coverage | [link](https://rustc-dev-guide.rust-lang.org/borrow_check/region_inference/member_constraints.html) | | Complications | [rust-lang/rust#61773] | [rust-lang/rust#61775]: https://github.com/rust-lang/rust/pull/61775 [rust-lang/rust#61773]: https://github.com/rust-lang/rust/issues/61773 ## Background Member constraints are an extension to our region solver that was introduced to make async fn region solving tractable. There are used in situations like the following: ```rust fn foo<'a, 'b>(...) -> impl Trait<'a, 'b> { .. } ``` The problem here is that every region R in the hidden type must be equal to *either* `'a` *or* `'b` (or `'static`). This cannot be expressed simply via 'outlives constriants' like `R: 'a`. Therefore, we introduce a 'member constraint' `R member of ['a, 'b]`. These constraints were introduced in [rust-lang/rust#61775]. At the time, we kept them feature gated and used them only for `impl Trait` return types that are derived from `async fn`. The intention, however, was always to support them in other contexts once we had time to gain more experience with them. **In the time since their introduction, we have encountered no surprises or bugs due to these member constraints.** They are tested extensively as part of every async function that involves multiple unrelated lifetimes in its arguments. ## Tests The behavior of member constraints is covered by the following tests: * [`src/test/ui/async-await/multiple-lifetimes`](https://github.com/rust-lang/rust/tree/20e032e65007ff1376e8480c1fbdb0a5068028fa/src/test/ui/async-await/multiple-lifetimes) -- tests using the async await, which are mostly already stabilized * [`src/test/ui/impl-trait/multiple-lifetimes.rs`](https://github.com/rust-lang/rust/blob/20e032e65007ff1376e8480c1fbdb0a5068028fa/src/test/ui/impl-trait/multiple-lifetimes.rs) * [`src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.rs`](https://github.com/rust-lang/rust/blob/20e032e65007ff1376e8480c1fbdb0a5068028fa/src/test/ui/impl-trait/multiple-lifetimes/ordinary-bounds-unsuited.rs) * [`src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-fg.rs`](https://github.com/rust-lang/rust/blob/20e032e65007ff1376e8480c1fbdb0a5068028fa/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-fg.rs) * [`src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs`](https://github.com/rust-lang/rust/blob/20e032e65007ff1376e8480c1fbdb0a5068028fa/src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rs) These tests cover a number of scenarios: * `-> implTrait<'a, 'b>` with unrelated lifetimes `'a` and `'b`, as described above * `async fn` that returns an `impl Trait` like the previous case, which desugars to a kind of "nested" impl trait like `impl Future<Output = impl Trait<'a, 'b>>` ## Potential concerns There is a potential interaction with `impl Trait` on local variables, described in [rust-lang/rust#61773]. The challenge is that if you have a program like: ```rust= trait Foo<'_> { } impl Foo<'_> for &u32 { } fn bar() { let x: impl Foo<'_> = &44; // let's call the region variable for `'_` `'1` } ``` then we would wind up with `'0 member of ['1, 'static]`, where `'0` is the region variable in the hidden type (`&'0 u32`) and `'1` is the region variable in the bounds `Foo<'1>`. This is tricky because both `'0` and `'1` are being inferred -- so making them equal may have other repercussions. That said, `impl Trait` in bindings are not stable, and the implementation is pretty far from stabilization. Moreover, the difficulty highlighted here is not due to the presence of member constraints -- it's inherent to the design of the language. In other words, stabilizing member constraints does not actually cause us to accept anything that would make this problem any harder. So I don't see this as a blocker to stabilization of member constraints; it is potentially a blocker to stablization of `impl trait` in let bindings.
2021-05-27Rollup merge of #84221 - ABouttefeux:generic-arg-elision, r=estebankDylan DPC-9/+308
E0599 suggestions and elision of generic argument if no canditate is found fixes #81576 changes: In error E0599 (method not found) generic argument are eluded if the method was not found anywhere. If the method was found in another inherent implementation suggest that it was found elsewhere. Example ```rust struct Wrapper<T>(T); struct Wrapper2<T> { x: T, } impl Wrapper2<i8> { fn method(&self) {} } fn main() { let wrapper = Wrapper(i32); wrapper.method(); let wrapper2 = Wrapper2{x: i32}; wrapper2.method(); } ``` ``` Error[E0599]: no method named `method` found for struct `Wrapper<_>` in the current scope .... error[E0599]: no method named `method` found for struct `Wrapper2<i32>` in the current scope ... = note: The method was found for Wrapper2<i8>. ``` I am not very happy with the ```no method named `test` found for struct `Vec<_, _>` in the current scope```. I think it might be better to show only one generic argument `Vec<_>` if there is a default one. But I haven't yet found a way to do that,
2021-05-26don't use unneeded closureSmittyvb-1/+1
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
2021-05-26don't use unneeded closureSmittyvb-1/+1
Co-authored-by: Alphyr <47725341+a1phyr@users.noreply.github.com>
2021-05-26Lint against non-camelCase trait alias namesSmitty-0/+19
Type aliases are linted as such, so (unstable) trait aliases should be treated the same way.
2021-05-26Auto merge of #85652 - ehuss:linkchecker-perf, r=Mark-Simulacrumbors-227/+505
Optimize linkchecker and add report. This makes three changes to the linkchecker: * Adds a report displayed after it finishes. * Improves the performance by caching all filesystem access. The linkchecker can take over a minute to run on some systems, and this should make it about 2-3 times faster. * Added a few tests.
2021-05-26Mention float workaround in Iterator::{min,max}Smitty-2/+26
2021-05-26Don't hash `thir_body`LeSeulArtichaut-0/+1
2021-05-26Auto merge of #83770 - the8472:tra-extend, r=Mark-Simulacrumbors-25/+63
Add `TrustedRandomAccess` specialization for `Vec::extend()` This should do roughly the same as the `TrustedLen` specialization but result in less IR by using `__iterator_get_unchecked` instead of `Iterator::for_each` Conflicting specializations are manually prioritized by grouping them under yet another helper trait.
2021-05-26Fix typoPaul Trojahn-1/+1
2021-05-26Remove unneeded workaroundSmitty-5/+3
This removes a workaround for #24159, which has been fixed.