Skip to content

Rollup of 11 pull requests #36012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e4dd785
Correct formatting docs: fmt::Result != io::Result<()>
Stebalien Aug 20, 2016
f2655e2
Note that formatters should not return spurious errors.
Stebalien Aug 20, 2016
31b7ff4
refactor range examples
matthew-piziak Aug 17, 2016
33560ee
add links to interesting items in `std::ptr` documentation
matthew-piziak Aug 21, 2016
a377adb
Improve Path and PathBuf docs
GuillaumeGomez Aug 18, 2016
c7d5f7e
Rust has type aliases, not typedefs.
Stebalien Aug 23, 2016
b400a43
add `fn main` wrappers to enable Rust Playground "Run" button
matthew-piziak Aug 23, 2016
28f057d
accumulate vector and assert for RangeFrom and RangeInclusive examples
matthew-piziak Aug 17, 2016
ff3a761
add more-evocative examples for `Shl` and `Shr`
matthew-piziak Aug 20, 2016
711333f
add a note that whitespace alignment is nonidiomatic
matthew-piziak Aug 23, 2016
bf22a7a
Updated code sample in chapter on syntax extensions.
regexident Aug 24, 2016
6f93d3c
Make E0094 underline better
kyrias Aug 24, 2016
874a20d
Update E0277 to new error format
0xmohit Aug 25, 2016
905644d
Rename {uint,int} methods to {usize,isize}.
frewsxcv Aug 24, 2016
cf8e1fe
add a simple example for `thread::current()`
matthew-piziak Aug 25, 2016
bea3cec
Rollup merge of #35758 - matthew-piziak:vec-assert-over-println-remai…
steveklabnik Aug 26, 2016
b397caa
Rollup merge of #35759 - matthew-piziak:refactor-range-examples, r=st…
steveklabnik Aug 26, 2016
2fccdbd
Rollup merge of #35786 - GuillaumeGomez:paths_doc, r=steveklabnik
steveklabnik Aug 26, 2016
05efbde
Rollup merge of #35862 - Stebalien:fmt-docs, r=steveklabnik
steveklabnik Aug 26, 2016
0bd1eae
Rollup merge of #35863 - matthew-piziak:shl-example, r=steveklabnik
steveklabnik Aug 26, 2016
3fd6295
Rollup merge of #35880 - matthew-piziak:ptr-linking, r=steveklabnik
steveklabnik Aug 26, 2016
23df512
Rollup merge of #35962 - regexident:compiler-plugin-docs, r=steveklabnik
steveklabnik Aug 26, 2016
528608e
Rollup merge of #35977 - frewsxcv:usize-isize, r=eddyb
steveklabnik Aug 26, 2016
8c97f1c
Rollup merge of #35980 - kyrias:E0094-underline, r=jonathandturner
steveklabnik Aug 26, 2016
c559c9c
Rollup merge of #35985 - 0xmohit:pr/error-code-E0277, r=jonathandturner
steveklabnik Aug 26, 2016
92e0528
Rollup merge of #35997 - matthew-piziak:thread-current-example, r=Gui…
steveklabnik Aug 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make E0094 underline better
Fixes #35966.

Signed-off-by: Johannes Löthberg <[email protected]>
  • Loading branch information
kyrias committed Aug 25, 2016
commit 6f93d3ce46d157b97da1b9ddbbd72f4bd40fbc2b
17 changes: 11 additions & 6 deletions src/librustc_typeck/check/intrinsic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
}));
let i_n_tps = i_ty.generics.types.len();
if i_n_tps != n_tps {
struct_span_err!(tcx.sess, it.span, E0094,
"intrinsic has wrong number of type \
parameters: found {}, expected {}",
i_n_tps, n_tps)
.span_label(it.span, &format!("expected {} type parameter", n_tps))
.emit();
let span = match it.node {
hir::ForeignItemFn(_, ref generics) => generics.span().unwrap_or(it.span),
hir::ForeignItemStatic(_, _) => it.span
};

struct_span_err!(tcx.sess, span, E0094,
"intrinsic has wrong number of type \
parameters: found {}, expected {}",
i_n_tps, n_tps)
.span_label(span, &format!("expected {} type parameter", n_tps))
.emit();
} else {
require_same_types(ccx,
TypeOrigin::IntrinsicType(it.span),
Expand Down